/* CSS Custom Properties for Themes */
:root {
    --bg-color: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --text-color: #2d3748;
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --section-bg: rgba(255, 255, 255, 0.95);
    --input-bg: #f8fafc;
    --input-border: #e2e8f0;
    --input-focus-border: #667eea;
    --btn-secondary-bg: #e2e8f0;
    --btn-secondary-color: #2d3748;
    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border-color: #e2e8f0;
}

[data-theme="dark"] {
    --bg-color: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    --text-color: #e2e8f0;
    --navbar-bg: rgba(45, 55, 72, 0.95);
    --section-bg: rgba(45, 55, 72, 0.95);
    --input-bg: #2d3748;
    --input-border: #4a5568;
    --input-focus-border: #667eea;
    --btn-secondary-bg: #4a5568;
    --btn-secondary-color: #e2e8f0;
    --scrollbar-track: #2d3748;
    --scrollbar-thumb: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border-color: #4a5568;
}

/* Modern Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent animations on page load and navigation */
html {
    scroll-behavior: smooth;
}

body {
    animation: none;
}

/* Disable hover effects during page transitions */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Prevent layout shifts and animations on initial load */
.stat-card, .section, .btn, .nav-menu a, .table-row, .list-item {
    animation: none;
    transition: none;
}

/* Enable animations after page load */
body.loaded .stat-card,
body.loaded .section,
body.loaded .btn,
body.loaded .nav-menu a,
body.loaded .table-row,
body.loaded .list-item {
    transition: all 0.3s ease;
}

body.loaded .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

body.loaded .section:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

body.loaded .btn-primary:hover,
body.loaded .btn-secondary:hover,
body.loaded .btn-danger:hover {
    transform: translateY(-2px);
}

body.loaded .nav-menu a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

body.loaded .table-row:hover,
body.loaded .list-item:hover {
    transform: translateX(5px);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    min-height: 100vh;
    font-size: 16px;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Modern Navigation */
.navbar {
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 20px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s ease;
    flex-wrap: wrap;
    min-height: 70px;
}

.nav-brand {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-menu li {
    display: flex;
    align-items: center;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    display: inline-block;
    white-space: nowrap;
    font-size: 1rem;
    line-height: 1.4;
}

.nav-menu a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.nav-menu a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-menu a:hover::before {
    width: 80%;
}

.nav-menu .btn {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    margin: 0 !important;
    border: none;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    height: 44px;
}

.nav-menu .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.nav-menu .btn i {
    font-size: 1.1rem;
}

/* Enhanced Forms */
.login-form, .form-container {
    max-width: 450px;
    margin: 3rem auto;
    background: var(--section-bg);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.3s ease;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--input-bg);
    transition: all 0.3s ease;
    font-family: inherit;
    color: var(--text-color);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: var(--input-bg);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Modern Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6b35 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

/* Ripple Effect CSS */
.btn {
    position: relative;
    overflow: hidden;
}

.btn span {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Enhanced Messages */
.message {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border-left: 4px solid;
    backdrop-filter: blur(10px);
}

.message.success {
    background: rgba(198, 246, 213, 0.9);
    color: #22543d;
    border-left-color: #38a169;
}

.message.error {
    background: rgba(254, 202, 202, 0.9);
    color: #742a2a;
    border-left-color: #e53e3e;
}

/* Modern Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--section-bg);
    backdrop-filter: blur(10px);
    padding: 2.5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.stat-card h3 {
    margin-bottom: 1rem;
    color: #718096;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.section {
    background: var(--section-bg);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.section:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.5rem;
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Enhanced Lists and Tables */
.list-container {
    max-height: 350px;
    overflow-y: auto;
    border-radius: 12px;
}

.list-item, .table-row {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.list-item:hover, .table-row:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: translateX(5px);
}

.table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.table th, .table td {
    padding: 1.2rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    color: var(--text-color);
}

.table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* Data Table Styling */
.data-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    background: var(--section-bg);
    margin-top: 1.5rem;
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-table th {
    padding: 1.2rem 1.5rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-color);
}

.data-table tbody tr {
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.btn-small {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
    margin-right: 0.5rem;
    display: inline-block;
}

.btn-small:last-child {
    margin-right: 0;
}

/* Modern Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: var(--btn-secondary-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(245, 101, 101, 0.4);
}

/* Modern Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--section-bg);
    backdrop-filter: blur(10px);
    margin: 3% auto;
    padding: 3rem;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        border-radius: 0 0 15px 15px;
        flex-wrap: nowrap;
    }

    .nav-brand {
        font-size: 1.5rem;
        flex-shrink: 0;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0.75rem;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--navbar-bg);
        backdrop-filter: blur(10px);
        padding: 1.5rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 15px 15px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        width: 100%;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        width: 100%;
        text-align: center;
        padding: 1rem 1.25rem;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .dashboard-stats, .dashboard-sections {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .container {
        padding: 20px 15px;
    }

    .stat-card, .section {
        padding: 2rem 1.5rem;
    }

    .modal-content {
        margin: 5% auto;
        padding: 2rem 1.5rem;
    }
}

/* Additional Modern Touches */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

p {
    color: var(--text-color);
    line-height: 1.7;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Link and Anchor Styling */
a {
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

a:hover {
    color: #764ba2;
    text-decoration: underline;
}

[data-theme="dark"] a {
    color: #a0aec0;
}

[data-theme="dark"] a:hover {
    color: #cbd5e0;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}
