/* ========================================
   IIEE-ERCSA - UNIVERSAL STYLESHEET
   Version: 3.0
   ======================================== */

/* ----------------------------------------
   RESET & BASE STYLES
   ---------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0d1117;
    --primary-dark: #010409;
    --primary-light: #161b22;
    --secondary: #10a37f;
    --secondary-dark: #0d8c6c;
    --secondary-light: #3bdfb0;
    --accent: #3b82f6;
    --accent-dark: #2563eb;
    --accent-light: #60a5fa;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f6f8fa;
    --dark: #ffffff;
    --gray: #8b949e;
    --gray-light: #30363d;
    --gray-dark: #21262d;
    --glass-bg: rgba(13, 17, 23, 0.95);
    --glass-border: rgba(16, 163, 127, 0.25);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background: var(--primary-dark);
    min-height: 100vh;
    color: var(--light);
    line-height: 1.6;
}

/* ----------------------------------------
   ANIMATED BACKGROUND (DEEPSEEK STYLE)
   ---------------------------------------- */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.animated-bg::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(16, 163, 127, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
    animation: bgPulse 15s ease infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* ----------------------------------------
   TYPOGRAPHY
   ---------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    color: var(--light);
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.8rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.4rem;
}

p {
    color: var(--gray);
}

/* ----------------------------------------
   AUTO-HIDE NAVIGATION
   ---------------------------------------- */
.navbar {
    background: rgba(13, 17, 23, 0.98);
    backdrop-filter: blur(10px);
    padding: 0.8rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--gray-light);
}

.navbar.hide {
    transform: translateY(-100%);
}

.navbar.show {
    transform: translateY(0);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeInLeft 0.8s ease;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}

.logo-text p {
    font-size: 0.7rem;
    opacity: 0.7;
    letter-spacing: 1px;
    color: var(--gray);
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    flex-wrap: wrap;
    align-items: center;
}

.nav-links a, .nav-links button {
    color: var(--gray);
    text-decoration: none;
    padding: 0.5rem 0.9rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-links a:hover, .nav-links button:hover {
    color: var(--light);
    background: var(--gray-light);
}

.nav-links a.active {
    color: var(--secondary);
    background: rgba(16, 163, 127, 0.1);
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--gray-dark);
    padding: 0.3rem 0.8rem 0.3rem 0.5rem;
    border-radius: 2rem;
    transition: all 0.2s;
}

.user-menu:hover {
    background: var(--gray-light);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    color: var(--primary-dark);
}

.user-name {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--light);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--light);
}

/* ----------------------------------------
   MAIN CONTAINER
   ---------------------------------------- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 5rem 2rem 2rem;
    position: relative;
    z-index: 5;
}

/* ----------------------------------------
   CARDS (DEEPSEEK STYLE)
   ---------------------------------------- */
.card {
    background: var(--primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    border: 1px solid var(--gray-light);
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--secondary);
    box-shadow: var(--shadow-lg);
}

.card h2, .card h3 {
    color: var(--light);
    margin-bottom: 1rem;
    border-left: 3px solid var(--secondary);
    padding-left: 0.75rem;
}

/* ----------------------------------------
   GRID LAYOUTS
   ---------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ----------------------------------------
   BUTTONS (DEEPSEEK STYLE)
   ---------------------------------------- */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--secondary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-dark);
    color: var(--light);
    border: 1px solid var(--gray-light);
}

.btn-secondary:hover {
    background: var(--gray-light);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
}

.btn-outline:hover {
    background: rgba(16, 163, 127, 0.1);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
}

/* ----------------------------------------
   FORM ELEMENTS (DEEPSEEK STYLE)
   ---------------------------------------- */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray);
    font-size: 0.85rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-family: inherit;
    background: var(--primary-dark);
    color: var(--light);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray);
}

/* ----------------------------------------
   MODAL
   ---------------------------------------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(2px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.2s ease;
    border: 1px solid var(--gray-light);
}

.modal-content h2,
.modal-content h3 {
    color: var(--light);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----------------------------------------
   ALERTS & NOTIFICATIONS
   ---------------------------------------- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ----------------------------------------
   LOADING SPINNER
   ---------------------------------------- */
.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--gray-light);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}

.spinner-container {
    text-align: center;
    padding: 2rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------
   ANIMATIONS
   ---------------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ----------------------------------------
   FOOTER
   ---------------------------------------- */
.footer {
    background: var(--primary-dark);
    color: var(--gray);
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid var(--gray-light);
}

.footer a {
    color: var(--secondary);
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--secondary-light);
}

/* ----------------------------------------
   UTILITY CLASSES
   ---------------------------------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }

/* ----------------------------------------
   RESPONSIVE DESIGN
   ---------------------------------------- */
@media (max-width: 1024px) {
    .container {
        padding: 4rem 1.5rem 1.5rem;
    }
    
    .grid-4 {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        text-align: center;
        padding: 1rem 0;
        gap: 0.5rem;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .container {
        padding: 4rem 1rem 1rem;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    .modal-content {
        padding: 1.25rem;
        width: 95%;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo-img {
        width: 30px;
        height: 30px;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .logo-text p {
        font-size: 0.55rem;
    }
    
    .navbar {
        padding: 0.6rem 1rem;
    }
    
    .container {
        padding: 3.5rem 0.75rem 0.75rem;
    }
}

/* ----------------------------------------
   CUSTOM SCROLLBAR (DEEPSEEK STYLE)
   ---------------------------------------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* ----------------------------------------
   SELECTION STYLES
   ---------------------------------------- */
::selection {
    background: var(--secondary);
    color: var(--primary-dark);
}

::-moz-selection {
    background: var(--secondary);
    color: var(--primary-dark);
}

/* ----------------------------------------
   PRINT STYLES
   ---------------------------------------- */
@media print {
    .navbar,
    .footer,
    .btn,
    .modal {
        display: none;
    }
    
    .container {
        padding: 1rem;
        margin: 0;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        background: white;
    }
    
    .card h2, .card h3 {
        color: #000;
    }
}

/* ----------------------------------------
   TOAST NOTIFICATIONS
   ---------------------------------------- */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--gray-dark);
    color: var(--secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    z-index: 2001;
    animation: slideInRight 0.2s ease;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--secondary);
    font-size: 0.85rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ----------------------------------------
   EMPTY STATES
   ---------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-state h3 {
    color: var(--light);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray);
}

/* ----------------------------------------
   STATS CARDS (DEEPSEEK STYLE)
   ---------------------------------------- */
.stat-card {
    background: var(--primary);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--gray);
}

/* ----------------------------------------
   BADGES
   ---------------------------------------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 500;
}

.badge-primary {
    background: var(--secondary);
    color: var(--primary-dark);
}

.badge-secondary {
    background: var(--gray-dark);
    color: var(--light);
}

/* ----------------------------------------
   LINKS
   ---------------------------------------- */
a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--secondary-light);
}