@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #0f172a;
    --bg-light: #1e293b;
    --bg-lighter: #334155;
    --text: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-light: #94a3b8;
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #1d4ed8;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --card-bg: #1e293b;
    --card-hover: #334155;
    --border: #475569;
    --border-light: #64748b;
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 70px;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

html, body {
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-light);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.5rem;
    max-width: 100%;
    gap: 1rem;
}

.logo-section {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.logo img {
    width: 45px;
    height: 45px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}

.logo-text {
    min-width: 0;
    flex: 1;
}

.logo-text h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.1rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.login-header-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    height: 38px;
    flex-shrink: 0;
}

.login-header-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.login-icon {
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.login-text {
    font-size: 0.85rem;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
    flex-shrink: 0;
}

.mobile-menu-btn span {
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: var(--transition);
    border-radius: 2px;
}

.layout-container {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--header-height));
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-light);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    overflow-y: auto;
    transition: var(--transition);
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

.main-nav {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    margin: 0 1.5rem 1rem;
    letter-spacing: 0.05em;
}

.nav-menu {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--bg-lighter);
    color: var(--text);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    border-left-color: var(--accent);
    font-weight: 500;
}

.nav-icon {
    font-size: 1.2rem;
    width: 20px;
    display: flex;
    justify-content: center;
}

.nav-text {
    font-size: 0.9rem;
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--bg);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.main-content::-webkit-scrollbar {
    display: none;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.page-info h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.page-info p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.class-badges {
    display: flex;
    gap: 0.5rem;
}

.class-badge, .scope-badge {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
}

.class-badge {
    background: var(--primary);
    color: white;
}

.scope-badge {
    background: var(--accent);
    color: white;
}

.content-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.intro-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.intro-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.intro-card h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.intro-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.intro-text p {
    margin: 1.5rem 0;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text);
    text-align: justify;
}

.quote-card {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 2.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border-left: 5px solid var(--primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.quote-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.quote-icon {
    font-size: 3rem;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 0.5rem;
}

.quote-content {
    flex: 1;
}

.quote-content blockquote {
    margin: 0;
    padding: 0;
    background: none;
    border-left: none;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text);
    font-style: italic;
    text-align: justify;
}

.quote-author {
    margin-top: 1.5rem;
    text-align: right;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.info-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.info-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.info-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.info-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background: var(--card-bg);
    color: var(--text);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.close-btn:hover {
    background: var(--bg-lighter);
    color: var(--text);
}

#login-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-submit-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.login-submit-btn:hover {
    background: var(--primary-dark);
}

#error-message {
    display: none;
    text-align: center;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.main-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    flex-wrap: wrap;
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

.footer-left, .footer-right {
    flex: 1;
}

.footer-right {
    text-align: right;
}

@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    
    .nav-section h3,
    .nav-text {
        display: none;
    }
    
    .nav-link {
        justify-content: center;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .layout-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 280px;
        height: calc(100vh - var(--header-height));
        z-index: 90;
        transition: var(--transition);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .class-badges {
        width: 100%;
        justify-content: flex-start;
    }
    
    .header-content {
        padding: 0 1rem;
        gap: 0.5rem;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .logo-text p {
        display: none;
    }
    
    .logo img {
        width: 40px;
        height: 40px;
    }
    
    .login-header-btn {
        padding: 0.4rem 0.6rem;
        height: 34px;
    }
    
    .login-text {
        display: none;
    }
    
    .login-icon {
        font-size: 0.9rem;
    }
    
    .nav-text {
        display: block;
    }
    
    .nav-section h3 {
        display: block;
    }
    
    .quote-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        gap: 1.5rem;
    }
    
    .quote-icon {
        margin: 0 auto;
    }
    
    .quote-content blockquote {
        text-align: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-left, .footer-right {
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .header-content {
        padding: 0 0.75rem;
    }
    
    .logo-text h1 {
        font-size: 0.9rem;
    }
    
    .logo img {
        width: 36px;
        height: 36px;
    }
    
    .mobile-menu-btn {
        padding: 0.4rem;
    }
    
    .mobile-menu-btn span {
        width: 20px;
    }
    
    .login-header-btn {
        padding: 0.35rem 0.5rem;
        height: 32px;
    }
    
    .class-badges {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .class-badge, .scope-badge {
        width: 100%;
        text-align: center;
    }
    
    .intro-card,
    .quote-card,
    .info-card {
        padding: 1.5rem;
    }
    
    .page-info h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 375px) {
    .header-content {
        padding: 0 0.5rem;
        gap: 0.4rem;
    }
    
    .logo-text h1 {
        font-size: 0.85rem;
        max-width: 140px;
    }
    
    .logo {
        gap: 0.5rem;
    }
    
    .logo img {
        width: 32px;
        height: 32px;
    }
    
    .mobile-menu-btn {
        padding: 0.3rem;
    }
    
    .mobile-menu-btn span {
        width: 18px;
    }
    
    .login-header-btn {
        padding: 0.3rem 0.4rem;
        height: 30px;
    }
    
    .login-icon {
        font-size: 0.85rem;
    }
}

.hidden {
    display: none;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}