﻿

.calendar-table {
    border-collapse: collapse;
    margin: 1%;
    width:98%;
    padding: 0;
    height: min-content;
}

    .calendar-table th, .calendar-table td {
        border: 1px solid #ddd;
        text-align: center;
        vertical-align: top;
        position: relative;
    }

    .calendar-table th {
        color: #333;
        padding: 2px 8px 4px 8px;
        position:relative;
    }

    .calendar-table td {
        height: 100px;
        width: 14.28%; /* 100% divided by 7 days */
    }

    .calendar-table .day-header {
        font-weight: bold;
        font-size: 0.8em;
    }
    .calendar-table .day-header.non-work-day {
        background-color:lightgray;
    }

    .calendar-table .date-label {
        font-weight: bold;
        display: block;
        color: #666;
    }


    .calendar-table .calendar-time-details {
        background-color: #eff1f36e;
    }
    .calendar-table .time-entry-table {
        background-color: #b6e5f478;
    }
.calendar-table .calendar-time-details, 
.calendar-table .time-entry-table
{
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 1em;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    margin-bottom:0.5em;
}
.calendar-time-details .detail-item,
.time-entry-table .detail-item {
    display: flex;
    justify-content: space-between;
}
.calendar-time-details span,
.time-entry-table span {
    margin-bottom: 2px;
    margin-right: 5px;
}
.calendar-time-details .label,
.time-entry-table label {
    font-weight: bold;
    color: #333;
}
.time-entry-table .validation-error-message {
    color: red;
    font-size: 0.9em;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    white-space: nowrap;
}

/*Add time record button*/
table:not(.locked) th:hover .calendar-add-time-button {
    display: block !important;
}


.calendar-add-time-button {
    position: absolute;
    height: 100%;
    width: 100%;
    background: #ffb87be8;
    margin: 0px;
    left: 0;
    top: 0;
    text-align: center;
    vertical-align: middle;
    margin: auto;
    padding: 10px;
    display: none;
    text-shadow: 1px 1px 2px #ffffff;
    cursor: pointer;
}
/*.calendar-add-time-button:hover::after {
    content: "Click to add a time record";
    position: absolute;*/
/*    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);*/
    /*background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px;
    border-radius: 3px;
    font-size: 10px;
    pointer-events: none;
}*/


/*Dragging Validation Highlights*/
.calendar-day.drop-target {
    border: 5px dashed #4CAF50; /* Green dashed border */
    /*background-color: #f0fff0;*/ /* Light green background */
    /*transition: background-color 0.01s ease, border 0.01s ease;*/ /* Smooth transition */
    background-color: #e6ffe6; /* Slightly darker green on hover */
}
/*.calendar-day.drop-target:hover {
    border-color: #388E3C;*/ /* Darker green border on hover */
/*}*/

.time-entry-table .detail-item.hidden {
    display: none;
}
.table-edge-highlight {
    outline: 2px solid #ff9800;
    box-shadow: 0 0 10px #ff9800;
}
.table-edge-flash {
    outline: 3px solid #ff0000;
    box-shadow: 0 0 16px 4px #ff0000;
    animation: table-flash-red 0.3s;
    animation-fill-mode: forwards;
}

@keyframes table-flash-red {
    0% {
        outline-color: transparent;
        box-shadow: none;
    }


    50% {
        outline-color: #ff0000;
        box-shadow: 0 0 16px 4px #ff0000;
    }

    100% {
        outline-color: transparent;
        box-shadow: none;
    }
}


/*Drag calendar details style*/

.dragging {
    cursor: move;
    opacity: 0.8; /* Make the element slightly transparent while dragging */
    z-index: 1000; /* Ensure it appears above other elements */
}
.calendar-time-details .button-container {  
   display: flex;  
   justify-content: flex-end; 
   padding: 0;  
   margin: -5px 0px 5px 0px; 
   z-index:10;
}

table.locked .calendar-time-details .button-container {
    display: none !important;
}

    .calendar-time-details .button-container {  
       display: flex;  
       justify-content: flex-end;  
       padding: 0;  
       margin: -5px 0px -30px 0px;  
       opacity: 0; /* Initially hidden */  
       transition: opacity 0.3s ease; /* Smooth transition */  
    }  

    .calendar-time-details:hover .button-container {  
       opacity: 1; /* Show on hover */  
    }  

    .calendar-time-details .button-container .calendar-detail-btn { 
        position:static;
       height: 25px;  
       width: 30px;
       min-width:auto;
       padding:0;
       margin:0;
       display: inline-block;  
       color: white;  
       border-radius: 50%; /* Circular buttons */  
       border: none;  
       box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Subtle shadow */  
       cursor: pointer;  
       transition: background-color 0.3s ease, transform 0.2s ease; /* Smooth hover effects */  
    }  

    .calendar-time-details .button-container .calendar-detail-btn:hover {  
       background-color: #0056b3; /* Darker blue on hover */  
       transform: scale(1.1); /* Slightly enlarge on hover */  
    }
