/*
Table of Contents:
1. Global Styles
2. Employee Entry Page (page-employee-entry.php)
3. Clock Page (page-clock.php)
4. Time Card Page (page-time-card.php)
5. Admin Shifts List Page (tc_shifts_list_page function)
*/

/* 1. Global Styles
   ========================================================================== */


.tc-clock-in-card {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    border-bottom: 1px solid rgba(26, 54, 126, .125);
}


/* 2. Employee Entry Page (page-employee-entry.php)
   ========================================================================== */
.tc-employee-entry-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.tc-notification {
    background-color: #4CAF50;
    color: white;
    text-align: center;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
}

#tc_employee_number {
    font-size: 24px;
    padding: 10px;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
}

#numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}

.numpad-btn {
    font-size: 24px;
    padding: 15px;
    border: none;
    background-color: #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.numpad-btn:hover {
    background-color: #e0e0e0;
}

.numpad-btn.clear {
    background-color: #ff9999;
}

.numpad-btn.submit {
    background-color: #99ff99;
}

/* Clocked in list */
.tc-clocked-in-list {
    list-style-type: none;
    padding: 0;
}

.tc-clocked-in-list li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.tc-clock-in-dot {
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
}


/* 3. Clock Page (page-clock.php)
   ========================================================================== */
.tc-clock-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.tc-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
}

.tc-status.clocked-in {
    background-color: #4CAF50;
    /* Green */
}

.tc-status.clocked-out {
    background-color: #f44336;
    /* Red */
}

#tc-current-date,
#tc-current-time {
    font-size: 1.2em;
    margin: 10px 0;
}

#tc-current-time {
    font-weight: bold;
    font-size: 1.5em;
    padding-bottom: 20px;
}

.tc-clock-button {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    color: #444;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    border: none;
    outline: none;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.tc-clock-button::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 10px solid;
    transition: all 0.3s ease;
    z-index: -1;
}

.tc-clock-button.clock-in::before {
    border-color: #4CAF50;
    /* Green */
}

.tc-clock-button.clock-out::before {
    border-color: #f44336;
    /* Red */
}

.tc-clock-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
    /* Subtle gray background on hover */
}

.tc-clock-button.clock-in:hover {
    box-shadow: inset 0 0 0 5px rgba(76, 175, 80, 0.2);
    /* Subtle green inner shadow */
}

.tc-clock-button.clock-out:hover {
    box-shadow: inset 0 0 0 5px rgba(244, 67, 54, 0.2);
    /* Subtle red inner shadow */
}

.tc-clock-button:hover::before {
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
}

.tc-clock-button:active {
    transform: scale(0.95);
}

.tc-clock-footer {
    display: flex;
    gap: 10px;
    margin-top: 40px;
    /* Increased to clear the button's halo/glow expansion */
    width: 100%;
}

.tc-clock-footer>a,
.tc-clock-footer>form {
    flex: 1;
}

.tc-clock-footer .button {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}


.tc-view-timecard-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2196F3;
    /* Blue */
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.tc-view-timecard-button:hover {
    background-color: #1976D2;
    /* Darker blue */
}


.admin-override-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
}

.admin-override-form input[type="password"] {
    padding: 8px;
    margin-right: 10px;
}





/* 4. Time Card Page (page-time-card.php)
   ========================================================================== */
.tc-time-card-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.tc-time-card-container h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tc-rate {
    font-size: 0.8em;
    font-weight: normal;
    color: #666;
}

.tc-time-card-header,
.tc-time-card-row,
.tc-time-card-footer {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.tc-time-card-header {
    background-color: #f2f2f2;
    border-top: solid 1px #ddd;
    border-radius: 5px 5px 0 0;
}

.tc-time-card-header .tc-time-card-cell {
    font-weight: bold;
}

.tc-time-card-footer {
    margin-bottom: 40px;
    border-bottom: solid 1px #ddd;
    border-radius: 0 0 5px 5px;
}

.tc-time-card-cell {
    padding: 5px;
    text-align: left;
}

.tc-hourly-rate {
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #333;
}

.tc-button-container {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}


/* Mobile-friendly adjustments */
@media screen and (max-width: 600px) {
    .tc-time-card-header {
        display: none;
    }

    .tc-time-card-row {
        display: flex;
        flex-direction: column;
        padding: 5px 10px;
        border: 1px solid #ddd;
        border-radius: 5px;
        margin-bottom: 15px;
    }

    .tc-time-card-cell {
        position: relative;
        padding-left: 50%;
    }

    .tc-time-card-cell::before {
        content: attr(data-label);
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
    }

    .tc-time-card-footer {
        display: flex;
        flex-direction: column;
        padding: 10px;
        border: solid 1px #ddd;
        border-radius: 3px;
    }

    .tc-time-card-footer .tc-time-card-cell {
        position: unset;
        padding: unset;
        text-align: unset;
    }

    .tc-time-card-footer .ktc-clock-in,
    .tc-time-card-footer .ktc-clock-out {
        display: none;
    }

    .tc-button-container {
        flex-direction: column;
    }

    .tc-button-container .button {
        margin-bottom: 10px;
    }
}


.tc-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 20px;
}

.tc-summary-item {
    flex-basis: calc(33.333% - 20px);
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.tc-summary-item h4 {
    margin-top: 0;
    color: #333;
}

@media screen and (max-width: 768px) {
    .tc-summary-item {
        flex-basis: 100%;
    }
}

/* 5. Admin Shifts List Page (tc_shifts_list_page function)
   ========================================================================== */
.tc-shifts-admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.tc-shifts-admin-table th,
.tc-shifts-admin-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.tc-shifts-admin-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.tc-shifts-admin-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Responsive design for smaller screens */
@media screen and (max-width: 600px) {

    .tc-employee-entry-container,
    .tc-clock-container,
    .tc-time-card-container {
        padding: 10px;
    }

    .tc-employee-entry-container input[type="text"],
    .tc-employee-entry-container input[type="submit"],
    .tc-clock-container input[type="submit"] {
        width: 100%;
        margin: 5px 0;
    }

    .tc-shifts-admin-table,
    .tc-time-card-table {
        font-size: 14px;
    }

    .tc-shifts-admin-table th,
    .tc-shifts-admin-table td,
    .tc-time-card-table th,
    .tc-time-card-table td {
        padding: 5px;
    }
}




/* 5. Time Card Login
   ========================================================================== */
.tc-timecard-login {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.tc-timecard-login h2 {
    margin-bottom: 20px;
}

.tc-timecard-login input[type="number"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
}

.tc-timecard-login input[type="submit"] {
    width: 100%;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

.tc-timecard-login .error {
    color: red;
    margin-bottom: 10px;
}

.tc-hourly-rate {
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #333;
}

/* 6. Unified Login Styles
   ========================================================================== */
.tc-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tc-login-card {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    text-align: center;
    margin: 0 auto;
}

.tc-login-card h2 {
    margin-top: 0;
    color: #333;
}

.tc-input-lg {
    font-size: 18px;
    padding: 12px;
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    text-align: center;
    margin-bottom: 20px;
}

.button-block {
    width: 100%;
    display: block;
    padding: 12px !important;
    height: auto !important;
    font-size: 16px !important;
}

.error-message {
    background: #fee;
    color: #c00;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #fcc;
    margin-bottom: 15px;
}

.tc-login-form .form-group {
    margin-bottom: 15px;
}