/* ============================================
   Team Drive HRMS - Futuristic Frontend Styles
   ============================================ */

/* CSS Variables */
:root {
    --td-primary: #6366f1;
    --td-primary-light: #818cf8;
    --td-primary-dark: #4f46e5;
    --td-secondary: #0ea5e9;
    --td-accent: #f472b6;
    --td-success: #10b981;
    --td-warning: #f59e0b;
    --td-danger: #ef4444;
    --td-info: #06b6d4;
    
    --td-bg-dark: #0f172a;
    --td-bg-light: #f8fafc;
    --td-bg-card: rgba(255, 255, 255, 0.95);
    --td-bg-glass: rgba(255, 255, 255, 0.7);
    --td-border-color: rgba(99, 102, 241, 0.2);
    --td-text-primary: #1e293b;
    --td-text-secondary: #64748b;
    --td-text-muted: #94a3b8;
    
    --td-gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --td-gradient-secondary: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    --td-gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --td-gradient-warm: linear-gradient(135deg, #f59e0b 0%, #f472b6 100%);
    --td-gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    --td-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --td-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --td-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --td-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --td-shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    --td-shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    
    --td-radius-sm: 8px;
    --td-radius-md: 12px;
    --td-radius-lg: 16px;
    --td-radius-xl: 24px;
    --td-radius-2xl: 32px;
    
    --td-transition-fast: 0.15s ease;
    --td-transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --td-transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --td-transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Animations */
@keyframes td-fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes td-fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes td-fadeInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes td-fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes td-scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes td-slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes td-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes td-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes td-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6); }
}

@keyframes td-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes td-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes td-gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes td-ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

@keyframes td-bounce-in {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes td-slide-in-stagger {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Base Container Styles */
.td-hrms-frontend-dashboard,
.td-hrms-leave-request,
.td-hrms-attendance-frontend,
.td-hrms-payslip-frontend {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0;
    background: transparent;
    animation: td-fadeIn 0.8s ease-out;
}

/* Main Container with Background */
.td-hrms-frontend-dashboard::before,
.td-hrms-leave-request::before,
.td-hrms-attendance-frontend::before,
.td-hrms-payslip-frontend::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(244, 114, 182, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Page Header */
.td-hrms-frontend-dashboard > h2,
.td-hrms-leave-request .td-leave-header h2,
.td-hrms-attendance-frontend > h2,
.td-hrms-payslip-frontend > h2 {
    font-size: 32px;
    font-weight: 800;
    background: var(--td-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    animation: td-fadeInLeft 0.6s ease-out;
}

.td-leave-header {
    margin-bottom: 32px;
    animation: td-fadeIn 0.6s ease-out;
}

.td-leave-header p {
    color: var(--td-text-secondary);
    font-size: 16px;
    animation: td-fadeInLeft 0.6s ease-out 0.1s both;
}

/* Employee Info Card */
.td-employee-info {
    background: var(--td-bg-card);
    padding: 32px;
    border-radius: var(--td-radius-xl);
    margin-bottom: 32px;
    box-shadow: var(--td-shadow-card);
    border: 1px solid var(--td-border-color);
    position: relative;
    overflow: hidden;
    animation: td-fadeInUp 0.6s ease-out 0.1s both;
}

.td-employee-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--td-gradient-primary);
}

.td-employee-info::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.td-employee-info h3 {
    margin-top: 0;
    font-size: 24px;
    font-weight: 700;
    background: var(--td-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.td-employee-info p {
    margin: 12px 0;
    color: var(--td-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.td-employee-info p strong {
    color: var(--td-text-primary);
    font-weight: 600;
    min-width: 120px;
}

/* Attendance Section */
.td-attendance-section,
.td-leaves-section {
    margin: 32px 0;
    padding: 32px;
    background: var(--td-bg-card);
    border-radius: var(--td-radius-xl);
    box-shadow: var(--td-shadow-card);
    border: 1px solid var(--td-border-color);
    position: relative;
    overflow: hidden;
    animation: td-fadeInUp 0.6s ease-out backwards;
}

.td-attendance-section {
    animation-delay: 0.2s;
}

.td-leaves-section {
    animation-delay: 0.3s;
}

.td-attendance-section::before,
.td-leaves-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--td-gradient-primary);
}

.td-attendance-section h3,
.td-leaves-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
    color: var(--td-text-primary);
}

/* Clock In/Out Button */
#td-clock-in-btn,
#td-clock-out-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--td-radius-lg);
    cursor: pointer;
    transition: all var(--td-transition-normal);
    position: relative;
    overflow: hidden;
    margin-top: 16px;
}

#td-clock-in-btn {
    background: var(--td-gradient-success);
    color: #fff;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

#td-clock-out-btn {
    background: var(--td-gradient-warm);
    color: #fff;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

#td-clock-in-btn:hover,
#td-clock-out-btn:hover {
    transform: translateY(-4px) scale(1.02);
}

#td-clock-in-btn:hover {
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.5);
}

#td-clock-out-btn:hover {
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.5);
}

#td-clock-in-btn:active,
#td-clock-out-btn:active {
    transform: translateY(-2px) scale(0.98);
}

/* Tables */
.td-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    border-radius: var(--td-radius-lg);
    overflow: hidden;
    box-shadow: var(--td-shadow-md);
}

.td-table th,
.td-table td {
    padding: 16px 20px;
    text-align: left;
}

.td-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 700;
    color: var(--td-text-primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--td-border-color);
}

.td-table tbody tr {
    background: #fff;
    transition: all var(--td-transition-normal);
    animation: td-slide-in-stagger 0.4s ease-out backwards;
}

.td-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.td-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.td-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.td-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.td-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.td-table tbody tr:nth-child(n+6) { animation-delay: 0.3s; }

.td-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
    transform: translateX(8px);
}

.td-table td {
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    color: var(--td-text-secondary);
}

.td-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.td-status {
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--td-transition-fast);
}

.td-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: td-pulse 2s ease-in-out infinite;
}

.td-status-pending {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(251, 191, 36, 0.15) 100%);
    color: #b45309;
}
.td-status-pending::before { background: #f59e0b; }

.td-status-approved {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(52, 211, 153, 0.15) 100%);
    color: #047857;
}
.td-status-approved::before { background: #10b981; }

.td-status-rejected {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(248, 113, 113, 0.15) 100%);
    color: #b91c1c;
}
.td-status-rejected::before { background: #ef4444; }

.td-status-active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(52, 211, 153, 0.15) 100%);
    color: #047857;
}
.td-status-active::before { background: #10b981; }

.td-status-present {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(52, 211, 153, 0.15) 100%);
    color: #047857;
}
.td-status-present::before { background: #10b981; }

.td-status-generated {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    color: #4338ca;
}
.td-status-generated::before { background: #6366f1; }

.td-status-paid {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(52, 211, 153, 0.15) 100%);
    color: #047857;
}
.td-status-paid::before { background: #10b981; }

.td-status-absent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(248, 113, 113, 0.15) 100%);
    color: #b91c1c;
}
.td-status-absent::before { background: #ef4444; }

/* Leave Request Form Layout */
.td-leave-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 32px;
    animation: td-fadeIn 0.6s ease-out 0.2s both;
}

/* Cards */
.td-leave-card {
    background: var(--td-bg-card);
    border-radius: var(--td-radius-xl);
    padding: 32px;
    box-shadow: var(--td-shadow-card);
    border: 1px solid var(--td-border-color);
    position: relative;
    overflow: hidden;
    transition: all var(--td-transition-normal);
}

.td-leave-form-card {
    animation: td-fadeInLeft 0.6s ease-out 0.2s both;
}

.td-leave-history-card {
    animation: td-fadeInRight 0.6s ease-out 0.3s both;
}

.td-leave-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--td-gradient-primary);
    opacity: 0;
    transition: opacity var(--td-transition-normal);
}

.td-leave-card:hover::before {
    opacity: 1;
}

.td-leave-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--td-shadow-xl), var(--td-shadow-glow);
}

.td-leave-card h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--td-text-primary);
}

.td-leave-card-subtitle {
    margin: 0 0 24px;
    color: var(--td-text-secondary);
    font-size: 14px;
}

/* Form Styles */
.td-leave-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.td-leave-form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.td-leave-form-group label {
    font-weight: 600;
    color: var(--td-text-primary);
    font-size: 14px;
}

.td-leave-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.td-leave-form-group input,
.td-leave-form-group select,
.td-leave-form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--td-border-color);
    border-radius: var(--td-radius-md);
    font-size: 15px;
    transition: all var(--td-transition-normal);
    background: #fff;
    color: var(--td-text-primary);
}

.td-leave-form-group input:focus,
.td-leave-form-group select:focus,
.td-leave-form-group textarea:focus {
    border-color: var(--td-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
}

.td-leave-form-group input:hover,
.td-leave-form-group select:hover,
.td-leave-form-group textarea:hover {
    border-color: var(--td-primary-light);
}

.td-leave-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.td-leave-form-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
}

/* Buttons */
.button,
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: var(--td-radius-md);
    cursor: pointer;
    transition: all var(--td-transition-normal);
    position: relative;
    overflow: hidden;
}

.button-primary,
button[type="submit"].button-primary {
    background: var(--td-gradient-primary);
    color: #fff;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.button-primary:hover,
button[type="submit"].button-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.button-primary:active,
button[type="submit"].button-primary:active {
    transform: translateY(-1px);
}

.button-large {
    padding: 16px 36px;
    font-size: 16px;
}

/* Message Box */
#td-leave-message {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: var(--td-radius-md);
    display: none;
    animation: td-slideDown 0.4s ease-out;
    font-weight: 500;
}

#td-leave-message.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(52, 211, 153, 0.15) 100%);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: block;
}

#td-leave-message.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(248, 113, 113, 0.15) 100%);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: block;
}

/* Leave History */
.td-leave-history {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.td-leave-history li {
    padding: 20px;
    border-radius: var(--td-radius-lg);
    border: 1px solid var(--td-border-color);
    background: linear-gradient(135deg, #fff 0%, #fafbfc 100%);
    transition: all var(--td-transition-normal);
    animation: td-fadeInUp 0.4s ease-out backwards;
}

.td-leave-history li:nth-child(1) { animation-delay: 0.1s; }
.td-leave-history li:nth-child(2) { animation-delay: 0.15s; }
.td-leave-history li:nth-child(3) { animation-delay: 0.2s; }
.td-leave-history li:nth-child(4) { animation-delay: 0.25s; }
.td-leave-history li:nth-child(5) { animation-delay: 0.3s; }

.td-leave-history li:hover {
    transform: translateX(8px);
    border-color: var(--td-primary);
    box-shadow: var(--td-shadow-md);
}

.td-leave-history-dates {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--td-text-secondary);
    margin-bottom: 8px;
}

.td-leave-history-dates strong {
    color: var(--td-text-primary);
}

.td-leave-history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.td-leave-type {
    font-weight: 700;
    color: var(--td-primary);
    font-size: 14px;
}

.td-leave-history-reason {
    margin: 12px 0 0;
    color: var(--td-text-secondary);
    font-size: 13px;
    padding-top: 12px;
    border-top: 1px dashed var(--td-border-color);
}

/* Empty State */
.td-empty-state {
    margin: 0;
    padding: 40px;
    text-align: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: var(--td-radius-lg);
    border: 2px dashed var(--td-border-color);
    color: var(--td-text-secondary);
    font-weight: 500;
}

/* Form Tables */
.td-form-table {
    width: 100%;
    margin: 20px 0;
}

.td-form-table th {
    width: 200px;
    padding: 14px;
    text-align: left;
    vertical-align: top;
    font-weight: 600;
    color: var(--td-text-primary);
}

.td-form-table td {
    padding: 14px;
}

.td-form-table input[type="text"],
.td-form-table input[type="email"],
.td-form-table input[type="date"],
.td-form-table input[type="month"],
.td-form-table input[type="number"],
.td-form-table select,
.td-form-table textarea {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid var(--td-border-color);
    border-radius: var(--td-radius-md);
    font-size: 15px;
    transition: all var(--td-transition-normal);
}

.td-form-table input:focus,
.td-form-table select:focus,
.td-form-table textarea:focus {
    border-color: var(--td-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
}

/* Attendance Page Specific */
.td-hrms-attendance-frontend form {
    background: var(--td-bg-card);
    padding: 24px 32px;
    border-radius: var(--td-radius-xl);
    margin-bottom: 32px;
    box-shadow: var(--td-shadow-card);
    border: 1px solid var(--td-border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    animation: td-fadeInUp 0.5s ease-out 0.1s both;
}

.td-hrms-attendance-frontend form label {
    font-weight: 600;
    color: var(--td-text-primary);
}

.td-hrms-attendance-frontend form input[type="month"] {
    padding: 12px 16px;
    border: 2px solid var(--td-border-color);
    border-radius: var(--td-radius-md);
    font-size: 15px;
    transition: all var(--td-transition-normal);
}

.td-hrms-attendance-frontend form input[type="month"]:focus {
    border-color: var(--td-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
}

.td-hrms-attendance-frontend form .button {
    background: var(--td-gradient-primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--td-radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--td-transition-normal);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.td-hrms-attendance-frontend form .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Payslip Page Specific */
.td-hrms-payslip-frontend .td-table td strong {
    color: var(--td-primary);
    font-size: 16px;
}

/* Scrollbar Styling */
.td-leave-history::-webkit-scrollbar {
    width: 6px;
}

.td-leave-history::-webkit-scrollbar-track {
    background: rgba(99, 102, 241, 0.1);
    border-radius: 3px;
}

.td-leave-history::-webkit-scrollbar-thumb {
    background: var(--td-gradient-primary);
    border-radius: 3px;
}

/* Responsive Design */
@media (max-width: 960px) {
    .td-hrms-frontend-dashboard,
    .td-hrms-leave-request,
    .td-hrms-attendance-frontend,
    .td-hrms-payslip-frontend {
        margin: 20px;
        padding: 0;
    }
    
    .td-leave-layout {
        grid-template-columns: 1fr;
    }
    
    .td-leave-history-meta,
    .td-leave-history-dates {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 600px) {
    .td-leave-card,
    .td-employee-info,
    .td-attendance-section,
    .td-leaves-section {
        padding: 24px;
    }
    
    .td-leave-form-actions {
        flex-direction: column;
    }
    
    .td-leave-form-actions .button {
        width: 100%;
    }
    
    .td-table {
        display: block;
        overflow-x: auto;
    }
    
    .td-leave-history li {
        padding: 16px;
    }
    
    .td-hrms-attendance-frontend form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .td-hrms-attendance-frontend form input[type="month"],
    .td-hrms-attendance-frontend form .button {
        width: 100%;
    }
}

/* Loading States */
.td-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.td-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid var(--td-border-color);
    border-top-color: var(--td-primary);
    border-radius: 50%;
    animation: td-spin 0.8s linear infinite;
}

/* Button Loading State */
.button.loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: td-spin 0.8s linear infinite;
}

/* Hover Effects */
.td-hover-lift {
    transition: all var(--td-transition-normal);
}

.td-hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--td-shadow-xl);
}

/* Focus Ring */
*:focus-visible {
    outline: 2px solid var(--td-primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .td-leave-card,
    .td-employee-info,
    .td-attendance-section,
    .td-leaves-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .td-status::before {
        display: none;
    }
}

/* ============================================
   Facial Recognition Attendance Styles
   ============================================ */

.td-face-attendance-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    animation: td-fadeIn 0.5s ease-out;
}

.td-attendance-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--td-gradient-primary);
    border-radius: var(--td-radius-xl);
    color: #fff;
    box-shadow: var(--td-shadow-lg);
}

.td-attendance-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.td-employee-id {
    font-size: 14px;
    opacity: 0.9;
    margin: 5px 0;
}

.td-current-date {
    font-size: 16px;
    margin-top: 10px;
    opacity: 0.95;
}

/* Attendance Status Card */
.td-attendance-status-card {
    margin-bottom: 30px;
}

.td-status-indicator {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--td-bg-card);
    border-radius: var(--td-radius-lg);
    box-shadow: var(--td-shadow-md);
    margin-bottom: 15px;
    transition: var(--td-transition-normal);
}

.td-status-indicator:hover {
    transform: translateY(-2px);
    box-shadow: var(--td-shadow-lg);
}

.td-status-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: bold;
    margin-right: 20px;
    flex-shrink: 0;
}

.td-status-clocked-in .td-status-icon {
    background: var(--td-gradient-success);
    color: #fff;
}

.td-status-clocked-out .td-status-icon {
    background: var(--td-gradient-warm);
    color: #fff;
}

.td-status-not-clocked .td-status-icon {
    background: var(--td-gradient-secondary);
    color: #fff;
}

.td-status-info h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    color: var(--td-text-primary);
}

.td-status-info p {
    margin: 5px 0;
    color: var(--td-text-secondary);
    font-size: 14px;
}

.td-total-hours {
    font-weight: 600;
    color: var(--td-primary) !important;
}

.td-location-info {
    font-size: 12px !important;
    color: var(--td-text-muted) !important;
}

/* Camera Section */
.td-camera-section {
    margin-bottom: 30px;
}

.td-camera-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 20px;
    background: #000;
    border-radius: var(--td-radius-lg);
    overflow: hidden;
    box-shadow: var(--td-shadow-xl);
}

.td-camera-container video,
.td-camera-container canvas {
    width: 100%;
    height: auto;
    display: block;
}

.td-camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.td-face-guide {
    width: 200px;
    height: 250px;
    border: 3px solid rgba(99, 102, 241, 0.8);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    animation: td-pulse 2s ease-in-out infinite;
}

.td-camera-instruction {
    margin-top: 20px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center;
    padding: 0 20px;
}

.td-captured-preview {
    text-align: center;
    margin: 20px 0;
}

.td-captured-preview img {
    max-width: 100%;
    border-radius: var(--td-radius-lg);
    box-shadow: var(--td-shadow-md);
    margin-bottom: 15px;
}

/* Camera Controls */
.td-camera-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Buttons */
.td-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--td-radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--td-transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: var(--td-shadow-sm);
}

.td-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.td-btn-primary {
    background: var(--td-gradient-primary);
    color: #fff;
}

.td-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--td-shadow-md);
}

.td-btn-success {
    background: var(--td-gradient-success);
    color: #fff;
}

.td-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: #fff;
}

.td-btn-secondary {
    background: #e2e8f0;
    color: var(--td-text-primary);
}

.td-btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.td-btn-icon {
    font-size: 20px;
}

/* Attendance Actions */
.td-attendance-actions {
    text-align: center;
    margin-bottom: 30px;
}

.td-completed-message {
    padding: 20px;
    background: var(--td-gradient-success);
    color: #fff;
    border-radius: var(--td-radius-lg);
    font-size: 18px;
    font-weight: 600;
}

/* Location Status */
.td-location-status {
    padding: 20px;
    background: var(--td-bg-card);
    border-radius: var(--td-radius-lg);
    box-shadow: var(--td-shadow-md);
    margin-bottom: 30px;
}

.td-location-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--td-text-secondary);
}

.td-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--td-primary);
    border-radius: 50%;
    animation: td-spin 0.8s linear infinite;
}

@keyframes td-spin {
    to { transform: rotate(360deg); }
}

.td-location-info p {
    margin: 8px 0;
    color: var(--td-text-primary);
}

.td-distance-far {
    color: var(--td-danger);
    font-weight: 600;
}

.td-location-error {
    color: var(--td-danger);
}

/* Messages */
.td-message {
    padding: 15px 20px;
    border-radius: var(--td-radius-md);
    margin-bottom: 20px;
    font-weight: 500;
}

.td-message-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-left: 4px solid var(--td-success);
}

.td-message-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-left: 4px solid var(--td-danger);
}

.td-message-info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--td-primary-dark);
    border-left: 4px solid var(--td-primary);
}

/* Attendance History */
.td-attendance-history {
    margin-top: 40px;
}

.td-attendance-history h3 {
    margin-bottom: 20px;
    color: var(--td-text-primary);
    font-size: 24px;
}

.td-history-table-wrapper {
    overflow-x: auto;
    background: var(--td-bg-card);
    border-radius: var(--td-radius-lg);
    box-shadow: var(--td-shadow-md);
}

.td-attendance-table {
    width: 100%;
    border-collapse: collapse;
}

.td-attendance-table thead {
    background: var(--td-gradient-primary);
    color: #fff;
}

.td-attendance-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.td-attendance-table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--td-transition-fast);
}

.td-attendance-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.td-attendance-table td {
    padding: 15px;
    color: var(--td-text-primary);
    font-size: 14px;
}

.td-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.td-status-present {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.td-status-absent {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.td-face-verified-badge {
    margin-left: 8px;
    font-size: 16px;
}

.td-no-data {
    text-align: center;
    color: var(--td-text-muted);
    padding: 40px !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .td-face-attendance-container {
        padding: 15px;
    }
    
    .td-attendance-header {
        padding: 15px;
    }
    
    .td-attendance-header h2 {
        font-size: 22px;
    }
    
    .td-status-indicator {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .td-status-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .td-camera-container {
        border-radius: var(--td-radius-md);
    }
    
    .td-face-guide {
        width: 150px;
        height: 180px;
    }
    
    .td-camera-instruction {
        font-size: 14px;
    }
    
    .td-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .td-btn-large {
        padding: 14px 28px;
        font-size: 16px;
        width: 100%;
    }
    
    .td-camera-controls {
        flex-direction: column;
    }
    
    .td-camera-controls .td-btn {
        width: 100%;
        justify-content: center;
    }
    
    .td-attendance-table {
        font-size: 12px;
    }
    
    .td-attendance-table th,
    .td-attendance-table td {
        padding: 10px 8px;
    }
    
    .td-attendance-history h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .td-face-attendance-container {
        padding: 10px;
    }
    
    .td-attendance-header h2 {
        font-size: 20px;
    }
    
    .td-status-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .td-face-guide {
        width: 120px;
        height: 150px;
    }
    
    .td-attendance-table {
        font-size: 11px;
    }
    
    .td-attendance-table th,
    .td-attendance-table td {
        padding: 8px 5px;
    }
}

/* Error State */
.td-face-attendance-error {
    padding: 20px;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-radius: var(--td-radius-md);
    border-left: 4px solid var(--td-danger);
    text-align: center;
}