/* Global Styles */
body {
    font-size: 0.875rem;
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Navbar Styles */
.custom-navbar {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 0.8rem 1rem;
    border-bottom: 3px solid #2980b9;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: 76px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: translateY(-2px);
}

.brand-text {
    background: linear-gradient(45deg, #ffffff, #e3f2fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome-text {
    font-weight: 500;
    color: #e3f2fd !important;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.role-badge {
    font-size: 0.8rem;
    opacity: 0.9;
}

.logout-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white !important;
}

.logout-btn:hover {
    background: linear-gradient(45deg, #c0392b, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.custom-toggler {
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.4rem 0.6rem;
}

/* Enhanced Sidebar Styles */
.sidebar {
    position: fixed;
    top: 76px;
    bottom: 0;
    left: 0;
    z-index: 1020;
    padding: 1rem 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    width: 240px;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    transform: translateX(-100%);
}

.sidebar.show {
    transform: translateX(0);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
}

.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #ecf0f1;
    padding: 0.75rem 1.5rem;
    margin: 0.2rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #3498db;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.sidebar .nav-link i {
    width: 1.5rem;
    text-align: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    color: #ecf0f1;
    font-size: 0.75rem;
    text-align: center;
}

/* Sidebar backdrop for mobile */
.sidebar-backdrop {
    position: fixed;
    top: 76px;
    left: 0;
    width: 100%;
    height: calc(100% - 76px);
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1015;
    display: none;
}

.sidebar-backdrop.show {
    display: block;
}

/* Main content adjustment */
.main-container {
    flex: 1;
    display: flex;
    margin-top: 76px;
    min-height: calc(100vh - 76px);
}

main {
    flex: 1;
    padding: 2rem;
    margin-left: 0;
    transition: margin-left 0.3s ease-in-out, padding 0.3s ease;
    overflow-y: auto;
    background-color: #f8f9fa;
    min-height: calc(100vh - 76px);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.5rem;
    border: none;
}

.card-title {
    margin: 0;
    font-weight: 600;
}

/* Table Styles */
.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.table thead th {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #ecf0f1;
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* Button Styles */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Badge Styles */
.badge {
    padding: 0.5rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Progress Bar Styles */
.progress {
    height: 20px;
    border-radius: 10px;
    background: #ecf0f1;
}

.progress-bar {
    border-radius: 10px;
    font-weight: 600;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 2px solid #ecf0f1;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
}

/* Footer Styles */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
    position: relative;
    z-index: 1030;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.footer-text {
    margin: 0;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #3498db;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px; /* Increased width for better mobile experience */
        top: 76px;
        z-index: 1010;
        bottom: 0;
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
    }
    
    .main-container {
        margin-left: 0;
    }
    
    main {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }
    
    .overlay {
        display: none;
        position: fixed;
        top: 76px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1005;
    }
    
    .overlay.show {
        display: block;
    }
    
    .navbar-nav {
        background: linear-gradient(135deg, #2c3e50 0%, #2980b9 100%);
        padding: 1rem;
        border-radius: 8px;
        margin-top: 1rem;
    }
    
    .welcome-text {
        margin-bottom: 1rem;
        text-align: center;
        display: block;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    /* Mobile specific styles */
    .mobile-navbar {
        display: flex !important;
        align-items: center;
    }
    
    .desktop-navbar {
        display: none !important;
    }
    
    .sidebar-backdrop {
        position: fixed;
        top: 76px;
        left: 0;
        width: 100%;
        height: calc(100% - 76px);
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1009;
        display: none;
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
    
    .footer {
        height: auto;
        padding: 1rem 0;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .welcome-text {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .logout-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (min-width: 992px) {
    .sidebar-toggler {
        display: none;
    }
    
    .desktop-navbar {
        display: block !important;
    }
    
    .mobile-navbar {
        display: none !important;
    }
    
    .sidebar {
        transform: translateX(0) !important;
    }
    
    .sidebar-backdrop {
        display: none !important;
    }
    
    main {
        margin-left: 240px;
    }
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Mobile sidebar toggler button */
.sidebar-toggler {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    margin-right: 1rem;
    cursor: pointer;
    z-index: 1030;
}

.sidebar-toggler:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Password toggle */
.password-toggle {
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Print styles */
@media print {
    .sidebar, .custom-navbar, .footer, .btn {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* Prevent body scrolling when sidebar is open on mobile */
body.sidebar-open {
    overflow: hidden;
}

/* Toast notifications */
.toast-container {
    z-index: 1060;
}

/* Custom utilities */
.text-gradient {
    background: linear-gradient(45deg, #3498db, #2980b9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%) !important;
}

.border-gradient {
    border: double 2px transparent;
    background-image: linear-gradient(white, white), 
                      linear-gradient(45deg, #3498db, #2980b9);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

/* Custom hover effects */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Custom focus states */
.btn-focus:focus {
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.5) !important;
}

.form-focus:focus {
    border-color: #3498db !important;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25) !important;
}