/* ===== RESET & VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #03060b;
    --bg-secondary: #0a1420;
    --bg-card: rgba(8, 18, 28, 0.7);
    --accent: #0d6efd;
    --accent-glow: #0d6efd80;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888;
    --border: rgba(13, 110, 253, 0.2);
    --border-hover: rgba(13, 110, 253, 0.4);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
}

/* ===== HEADER ===== */
.header {
    margin-bottom: 30px;
}

.nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 40px;
    border: 1px solid transparent;
}

.back-link:hover {
    background: rgba(13, 110, 253, 0.15);
    border-color: var(--border-hover);
    transform: translateX(-3px);
}

.logo-small {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    padding: 6px 16px;
    border-radius: 40px;
    border: 1px solid var(--border);
}

.logo-small .logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(145deg, #fff, #6ea5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-small .logo-badge {
    background: var(--accent);
    color: #03060b;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.title-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.lang-icon-header {
    font-size: 2.8rem;
    color: var(--accent);
    background: rgba(13, 110, 253, 0.1);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 25px;
    border: 1px solid var(--border);
}

.title-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #a0c0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.title-text .subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.header-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    padding: 16px 20px;
    background: linear-gradient(90deg, rgba(13, 110, 253, 0.05), transparent);
    border-left: 4px solid var(--accent);
    border-radius: 0 16px 16px 0;
    margin-top: 15px;
}

/* ===== CONTENT WRAPPER ===== */
.content-wrapper {
    display: flex;
    gap: 30px;
    margin: 30px 0;
    position: relative;
}

/* ===== SIDEBAR ===== */
.sidebar {
    flex: 0 0 280px;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid var(--border);
    height: fit-content;
    transition: 0.3s;
}

.sidebar:hover {
    border-color: var(--border-hover);
    box-shadow: 0 10px 30px -10px var(--accent-glow);
}

.sidebar h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.material-count {
    background: rgba(13, 110, 253, 0.2);
    padding: 3px 10px;
    border-radius: 30px;
    font-size: 0.8rem;
    color: var(--accent);
}

.sidebar-nav {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-secondary);
    margin-bottom: 20px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.material-list {
    list-style: none;
}

.material-list li {
    margin-bottom: 4px;
}

.material-list a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 12px;
    display: block;
    border-radius: 12px;
    transition: 0.2s;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}

.material-list a:hover {
    background: rgba(13, 110, 253, 0.1);
    color: #fff;
    transform: translateX(3px);
}

.material-list a.active {
    background: rgba(13, 110, 253, 0.15);
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 500;
}

.sidebar-footer {
    background: rgba(13, 110, 253, 0.05);
    border-radius: 16px;
    padding: 15px;
    border: 1px dashed var(--border);
}

.progress-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.progress-percent {
    color: var(--accent);
    font-weight: 600;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #4a9eff);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    min-width: 0;
}

.material-section {
    margin-bottom: 50px;
    scroll-margin-top: 100px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    background: linear-gradient(to right, #fff, #c0d0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.section-meta span {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 5px 12px;
    border-radius: 30px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge {
    background: rgba(13, 110, 253, 0.2) !important;
    color: var(--accent) !important;
    border-color: rgba(13, 110, 253, 0.3) !important;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 20px;
    transition: 0.3s;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 10px 30px -10px var(--accent-glow);
}

.card-body {
    padding: 25px;
}

.card-body h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #fff;
}

.card-body h4 {
    font-size: 1.1rem;
    margin: 20px 0 10px;
    color: #fff;
}

/* ===== CODE CARDS ===== */
.code-card {
    background: #0a0f17;
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    margin: 20px 0;
}

.code-header {
    background: #141c28;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.code-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 15px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.copy-btn:hover {
    background: var(--accent);
    color: #03060b;
    border-color: var(--accent);
}

.code-card pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    background: #0a0f17;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-card code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* ===== NOTES ===== */
.note {
    padding: 16px 20px;
    border-radius: 16px;
    margin: 20px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-left-width: 4px;
    border-left-style: solid;
}

.note.info {
    background: rgba(13, 110, 253, 0.1);
    border-left-color: var(--accent);
}

.note.tip {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success);
}

.note.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--warning);
}

.note i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.note.info i {
    color: var(--accent);
}

.note.tip i {
    color: var(--success);
}

.note.warning i {
    color: var(--warning);
}

/* ===== LISTS ===== */
.feature-list, .rule-list, .method-list, .oop-list {
    list-style: none;
    margin: 15px 0;
}

.feature-list li, .rule-list li, .method-list li, .oop-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-list i {
    color: var(--success);
}

.rule-list .bullet {
    color: var(--accent);
    font-size: 1.2rem;
}

/* ===== STEP LIST ===== */
.step-list {
    list-style: none;
    margin: 20px 0;
}

.step-list li {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.step-number {
    background: var(--accent);
    color: #03060b;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ===== IDE LIST ===== */
.ide-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.ide-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.ide-item i {
    color: var(--accent);
    width: 20px;
}

/* ===== OPERATOR GRID ===== */
.operator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.operator-group h4 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 1rem;
}

.operator-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.operator-list code {
    background: rgba(13, 110, 253, 0.1);
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* ===== TABLE ===== */
.table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    overflow: hidden;
}

.data-table th {
    background: rgba(13, 110, 253, 0.2);
    color: #fff;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
}

.data-table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(13, 110, 253, 0.05);
}

/* ===== PILLAR BOX ===== */
.pillar-box {
    background: rgba(13, 110, 253, 0.05);
    border-radius: 16px;
    padding: 15px;
    margin-top: 20px;
}

.pillar-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.pillar {
    background: rgba(13, 110, 253, 0.15);
    color: var(--accent);
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    border: 1px solid rgba(13, 110, 253, 0.3);
}

/* ===== INLINE CODE ===== */
code, .inline-code {
    background: #1e293b;
    color: #a5d8ff;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

pre.inline-code {
    background: #1e293b;
    padding: 15px;
    border-radius: 12px;
    margin: 10px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    display: flex;
    justify-content: space-between;
    margin: 50px 0 30px;
}

.nav-btn {
    background: rgba(13, 110, 253, 0.1);
    border: 1px solid var(--border);
    color: #fff;
    padding: 12px 25px;
    border-radius: 40px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.nav-btn:hover:not(.disabled) {
    background: var(--accent);
    color: #03060b;
    border-color: var(--accent);
    transform: translateY(-2px);
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== FOOTER ===== */
.footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-links {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.social-link {
    color: var(--text-secondary);
    font-size: 1.3rem;
    transition: 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    border: 1px solid var(--border);
}

.social-link:hover {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-3px);
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: 0.2s;
    padding: 5px 10px;
}

.footer-link:hover {
    color: var(--accent);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== LINKS ===== */
.link {
    color: var(--accent);
    text-decoration: none;
    transition: 0.2s;
}

.link:hover {
    text-decoration: underline;
    color: #fff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .content-wrapper {
        gap: 20px;
    }
    
    .sidebar {
        flex: 0 0 250px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        position: static;
        width: 100%;
        margin-bottom: 20px;
    }
    
    .sidebar-nav {
        max-height: 300px;
    }
    
    .title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .title-text h1 {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .operator-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 15px;
    }
    
    .code-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .copy-btn {
        width: 100%;
        justify-content: center;
    }
    
    .bottom-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
}