/* ============================= */
/* Employee & Dependent Table */
/* ============================= */
.employee-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

.employee-table th,
.employee-table td {
    padding: 12px 10px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.employee-table th {
    background-color: #4CAF50;
    color: #fff;
    font-weight: bold;
}

.employee-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.employee-table img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

/* Status badges */
.status-active {
    color: #155724;
    background-color: #d4edda;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.status-pending {
    color: #856404;
    background-color: #fff3cd;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.status-rejected {
    color: #721c24;
    background-color: #f8d7da;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
}

/* ============================= */
/* Progress bar */
/* ============================= */
.usage-container {
    padding: 10px;
    background: #f7f7f7;
    border-radius: 8px;
    margin: 10px 0;
}

.usage-heading {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.progress-bar {
    position: relative;
    background-color: #e0e0e0;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    background-color: #4CAF50;
    height: 100%;
    width: 0%;
    transition: width 0.5s ease-in-out;
}

.progress-percent {
    position: absolute;
    right: 10px;
    top: 0;
    font-size: 12px;
    line-height: 20px;
    color: #fff;
    font-weight: bold;
}

.info-block {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 12px;
    color: #555;
}

.comment-cell {
    text-align: center;
}

/* ============================= */
/* Animations */
@keyframes fadeIn {
    from {opacity: 0; transform: translateY(-10px);}
    to {opacity: 1; transform: translateY(0);}
}

/* Responsive modal */
@media (max-width: 600px) {
    .modal-wrapper {
        width: 100%;
        margin: 40px auto;
        padding: 20px;
    }
}

/* ============================= */
/* Table Action Buttons Styling */
/* ============================= */

/* Base button style for table actions */
.employee-table button.request-approval,
.employee-table button.view-comment {
    display: inline-block;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
    min-width: 120px;
}

/* Request Approval button */
.employee-table button.request-approval {
    background-color: #4CAF50;
    color: #fff;
}

.employee-table button.request-approval:hover {
    background-color: #45a049;
    transform: translateY(-1px);
}

/* Disabled Request Approval button */
.employee-table button.request-approval:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    color: #666;
}

/* View Comment button */
.employee-table button.view-comment {
    background-color: #2196F3;
    color: #fff;
}

.employee-table button.view-comment:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
}

/* Optional: slightly smaller button for compact look */
.employee-table button.view-comment,
.employee-table button.request-approval {
    font-size: 13px;
    padding: 6px 10px;
}

/* ==================================== */
/* Web App Style - Approval Request Form */
/* ==================================== */

/* Modal background */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Changed from flex to none - controlled by JS */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

/* Modal wrapper */
.modal-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 25px 30px;
    width: 90%;
    max-width: 480px; /* Slightly wider for better form layout */
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close button */
.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close:hover {
    background-color: #f5f5f5;
    color: #333;
    transform: rotate(90deg);
}

/* Form inside modal */
#approvalForm {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: "Inter", "Segoe UI", Roboto, sans-serif;
    margin-top: 10px;
}

/* Form header */
.form-header {
    text-align: center;
    margin-bottom: 10px;
}

.form-header h3 {
    color: #202124;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.form-header p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Form groups */
#approvalForm .form-group {
    display: flex;
    flex-direction: column;
}

#approvalForm label {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
}

.required::after {
    content: " *";
    color: #e53935;
    font-weight: bold;
}

/* Input fields */
#approvalForm input[type="text"],
#approvalForm input[type="date"],
#approvalForm input[type="tel"],
#approvalForm input[type="hidden"],
#approvalForm select,
#approvalForm textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    background-color: #fafafa;
    transition: all 0.25s ease;
    font-family: inherit;
}

#approvalForm input:focus,
#approvalForm select:focus,
#approvalForm textarea:focus {
    border-color: #1a73e8;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
    outline: none;
    transform: translateY(-1px);
}

/* Disabled fields styling */
#approvalForm input[readonly] {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

/* Placeholder text */
#approvalForm input::placeholder,
#approvalForm textarea::placeholder {
    color: #999;
    font-size: 13px;
}

/* Field groups for better organization */
.field-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #1a73e8;
}

.field-group-title {
    font-weight: 700;
    color: #1a73e8;
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Using CSS icons instead of emojis */
.field-group-title::before {
    content: "\\1F4C4"; /* Clipboard icon */
    font-size: 16px;
}

.medical-fields .field-group-title::before {
    content: "\\1F3E5"; /* Hospital icon */
}

/* Submit button */
#approvalForm button[type="submit"] {
    padding: 14px 0;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

#approvalForm button[type="submit"]:hover {
    background: linear-gradient(135deg, #1669c1, #0b3d91);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
    transform: translateY(-2px);
}

#approvalForm button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

#approvalForm button[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading state */
#approvalForm button[type="submit"].loading {
    color: transparent;
}

#approvalForm button[type="submit"].loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s ease infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form validation styles */
#approvalForm input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #e53935;
    background-color: #fff5f5;
}

#approvalForm input:valid:not(:focus):not(:placeholder-shown) {
    border-color: #4caf50;
}

.error-message {
    color: #e53935;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

/* Responsive Design */
@media (max-width: 600px) {
    .modal-wrapper {
        width: 95%;
        padding: 20px;
        margin: 10px;
    }
    
    #approvalForm {
        gap: 14px;
    }
    
    #approvalForm input[type="text"],
    #approvalForm input[type="date"],
    #approvalForm input[type="tel"],
    #approvalForm select {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    #approvalForm button[type="submit"] {
        padding: 12px 0;
        font-size: 16px;
    }
    
    .field-group {
        padding: 12px;
    }
}

/* Scrollbar styling for modal */
.modal-wrapper::-webkit-scrollbar {
    width: 6px;
}

.modal-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}