/* Root Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --card-gradient: linear-gradient(145deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.3) 100%);
    --hover-gradient: linear-gradient(145deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.5) 100%);
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #f59e0b;
    --text-color: #1a1a1a;
    --background-color: #f6f7ff;
    --card-background: rgba(255, 255, 255, 0.9);
}

/* Global Styles */
body {
    background: linear-gradient(135deg, var(--background-color) 0%, #eef1ff 100%);
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--text-color);
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

body.loaded {
    opacity: 1;
}

/* Icon Specific Styles */
.material-icons {
    vertical-align: middle;
    font-size: inherit;
}

/* Header Styles */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(231, 231, 231, 0.8);
    position: sticky;
    top: 0;
    z-index: 1020;
    transition: all 0.3s ease;
}

.navbar {
    padding: 0.5rem 0;
    position: relative; /* For positioning the dropdown */
}


.navbar-brand {
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.logo-img {
    transition: transform 0.3s ease;
}

.nav-link {
    color: #2d3748;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.nav-link.active {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

/* Enhanced Profile Styles */
.profile-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-photo, .profile-initial {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.profile-photo {    
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.profile-initial {
    background: var(--primary-gradient);
    color: white;    
    font-weight: 600;
    font-size: 1rem;
}


.profile-btn:hover .profile-photo,
.profile-btn:hover .profile-initial { /*Combine hover effects*/
    transform: scale(1.05);
}
.profile-btn:hover .profile-initial {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

/* Mobile Menu (Navbar Collapse) Styles */
@media (max-width: 991.98px) {
    .navbar-toggler {
        padding: 0.5rem;
        border-radius: 8px;
        transition: background-color 0.3s ease;
    }

    .navbar-toggler:hover {
        background-color: rgba(99, 102, 241, 0.1);
    }

    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        padding: 1rem;
        border-radius: 12px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        z-index: 10;
        transform-origin: top;
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    }

    .navbar-collapse > .navbar-nav {  /* Target the direct child for transitions */
      transition: opacity 0.3s ease-in-out;
    }
    .navbar-collapse:not(.show) {
        transform: scaleY(0);
        opacity: 0;
    }

    .navbar-collapse.show {
        transform: scaleY(1);
        opacity: 1;
    }

    .navbar-collapse > .navbar-nav {
        opacity: 1;
        transition: opacity 0.2s ease-in-out;
    }

    .navbar-collapse:not(.show) > .navbar-nav {
        opacity: 0;
    }

    .navbar-collapse .nav-link {
        transition: color 0.3s ease, background-color 0.3s ease;
    }
}

    .navbar-collapse .dropdown-menu { /* Dropdown animation */
              transition: opacity 0.3s ease !important, transform 0.3s ease !important;
    }
    .dropdown-menu.show { /* Ensure smooth visibility on show */
        opacity: 1;
        transform: none; /* or translate(0) */
    }
}

/* Dropdown Menu Animation (Outside of media query – applies to all) */
@keyframes dropdownFade { /* Shared by desktop & mobile */
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu { /* Affects all dropdowns unless overridden in the media query above*/
    animation: dropdownFade 0.2s ease;
}

/* Enhanced Dropdown Styles */
.dropdown-menu {
    border: none;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    min-width: 250px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    color: #2d3748;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: normal;
}

.dropdown-item .material-icons {
    font-size: 1.1rem;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    transform: translateX(5px);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: rgba(0, 0, 0, 0.1);
}

/* Login/Logout Link Styles */
.login-link,
.logout-link {
    color: #dc2626;
    transition: all 0.3s ease;
}

.login-link:hover,
.logout-link:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .profile-btn {
        margin-left: 1rem;
    }
}

/* Profile Section */
.profile-photo {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.profile-photo:hover {
    transform: scale(1.1);
    background: rgba(99, 102, 241, 0.2);
}

.profile-photo .material-icons {
    font-size: 1.5rem;
}

/* Dropdown Styles */
.dropdown-menu {
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    min-width: 250px;
    padding: 0.5rem;
    max-height: 80vh;
    overflow-y: auto;
}

.dropdown-item {
    color: #2d3748;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: normal;
}

.dropdown-item .material-icons {
    font-size: 1.1rem;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    transform: translateX(5px);
}

/* Login Page Styles */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem;
}

.login-card {
    background: var(--card-gradient);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    width: 400px;
    padding: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.login-form .form-label {
    font-weight: 500;
    color: #2d3748;
}

.login-form .form-control {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.login-form .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-form .btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}

.login-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.login-form .btn-primary:active {
    transform: translateY(0);
}

.login-form .alert {
    border: none;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.login-form .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

@media (max-width: 576px) {
    .login-card {
        width: 100%;
        padding: 2rem;
    }

    .login-title {
        font-size: 1.75rem;
    }
}

/* Card Styles */
.dashboard-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.dashboard-card {
    background: var(--card-gradient);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    text-decoration: none;
    color: #1a1a1a;
    opacity: 0;
    transform: translateY(20px);
}

.dashboard-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.dashboard-card:hover {
    transform: translateY(-5px) scale(1.02);
    background: var(--hover-gradient);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.15);
}

.card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 220px;
    position: relative;
    z-index: 1;
}

.card-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    color: #6366f1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-icon .material-icons {
    font-size: 2rem;
}

.dashboard-card:hover .card-icon {
    transform: scale(1.1) translateY(-5px);
    background: rgba(99, 102, 241, 0.2);
}

.card-title {
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.dashboard-card:hover .card-title {
    color: #6366f1;
}

.card-text {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Footer Styles */
.footer {
    background: linear-gradient(135deg, #2a2a72 0%, #009ffd 100%);
    color: white;
    position: relative;
    overflow: hidden;
    margin-top: auto;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    color: white;
}

.social-links a .material-icons {
    font-size: 1.25rem;
}

.social-links a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-3px);
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateY(1rem);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate {
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

.slideIn {
    animation-name: slideIn;
}

/* User Greeting Styles */
.user-greeting {
    text-align: center;
    margin: 2rem 0 3rem;
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-greeting.visible {
    opacity: 1;
    transform: translateY(0);
}

.birthday-wish {
    background: linear-gradient(to right, #f35d5d, #f28705, #f9d423, #43b02a, #00a0c6, #4364f7, #9b2ede);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
    margin-top: 1rem;
}

@keyframes shine {
    to { background-position: 200% center; }
}


@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card-icon {
        width: 56px;
        height: 56px;
    }
    
    .card-icon .material-icons {
        font-size: 1.75rem;
    }
}

/* My Attendance Page CSS */  
.attendance-status-card {
    background: var(--card-gradient);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.attendance-status-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.15);
}

.check-button {
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 1rem 0;
    width: 100%;
    max-width: 300px;
}

.check-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.check-button:disabled {
    background: #e2e8f0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.attendance-table {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(31, 38, 135, 0.1);
    width: 100%;
}

.attendance-table th {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    padding: 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.attendance-table td {
    padding: 1rem;
    font-size: 0.9rem;
    vertical-align: middle;
    white-space: nowrap;          
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;          
}

/* Status badges with regularized indicator */      
.badge-present {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.badge-late {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.badge-leave {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.badge-week-off {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

.badge-incomplete {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.badge-pending {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    color: white;
}

/* Regularized status indicator */
.badge.regularized {
    position: relative;
    animation: glow 2s infinite;
}

.badge.regularized::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #059669;
    border: 1px solid currentColor;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
    50% { box-shadow: 0 0 15px rgba(255, 255, 255, 0.8); }
}

.request-btn {
    background: none;
    border: 1px solid #6366f1;
    color: #6366f1;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;          
}

.request-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.modal-content {
    background: var(--card-gradient);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.month-filter-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.month-filter-form .form-group {
    flex: 1;
}

.month-filter-form .btn {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 16px;
}

@media (max-width: 768px) {
    .month-filter-form {
        flex-direction: column;
        gap: 0.5rem;
    }

    .month-filter-form .form-group,
    .month-filter-form .btn {
        width: 100%;
    }

    .check-button {
        width: 100%;
        max-width: none;
        padding: 0.75rem;
    }

    .table-responsive {
        margin: -1px;
        width: calc(100% + 2px);
    }

    .attendance-table {
        min-width: 800px;
    }
}

/* Settings Page Styles */
.settings-page {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.settings-header {
    margin-bottom: 2rem;
    text-align: center;
}

.settings-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.settings-description {
    color: #666;
    font-size: 0.95rem;
}

.settings-section {
    background: var(--card-background);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.settings-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.section-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    color: var(--primary-color);
}

.color-picker-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.color-picker-wrapper {
    position: relative;
}

.color-picker-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.color-picker-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-picker-input:hover {
    border-color: var(--primary-color);
}

.color-preview {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Mobile Specific Styles */
@media (max-width: 768px) {
    .settings-section {
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .section-icon {
        width: 32px;
        height: 32px;
    }
}