/* Topic Page Styles */
.topic-hero {
    background: linear-gradient(135deg, rgba(13, 27, 42, 0.9), rgba(67, 97, 238, 0.8)),
                url('https://images.unsplash.com/photo-1550751827-4bd374c3f58b?auto=format&fit=crop&w=1470&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 7rem 0 4rem;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

.topic-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 27, 42, 0.7);
    z-index: 1;
}

.topic-hero .container {
    position: relative;
    z-index: 2;
}

.topic-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.topic-hero .topic-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.topic-level {
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topic-level.beginner {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.topic-level.intermediate {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.topic-level.advanced {
    background: linear-gradient(135deg, #fce4ec, #f8bbd9);
    color: #c2185b;
    border: 1px solid #f8bbd9;
}

.topic-time {
    color: white;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topic-time::before {
    content: '⏱️';
    font-size: 1rem;
}

/* Back Navigation */
.back-nav {
    background: #f8f9fa;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #4361ee;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #3a56d4;
    transform: translateX(-3px);
}

/* Topic Content */
.topic-content {
    padding: 4rem 0;
    background: white;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

.main-content {
    max-width: 100%;
}

.content-section {
    margin-bottom: 3rem;
}

.content-section h2 {
    color: #0d1b2a;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.5rem;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #4361ee, #3a56d4);
    border-radius: 2px;
}

.content-section h3 {
    color: #0d1b2a;
    font-size: 1.4rem;
    margin: 2rem 0 1rem;
    font-weight: 600;
}

.content-section p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

.content-section ul, .content-section ol {
    color: #555;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.content-section li {
    margin-bottom: 0.8rem;
    position: relative;
}

.content-section ul li::before {
    content: '•';
    color: #4361ee;
    font-weight: bold;
    position: absolute;
    left: -1rem;
}

.content-section ol {
    list-style-type: decimal;
}

.content-section ol li::marker {
    color: #4361ee;
    font-weight: bold;
}

/* Info Cards */
.info-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-left: 4px solid #4361ee;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.info-card h4 {
    color: #0d1b2a;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Definition Lists */
.definition-list {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.definition-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.definition-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.definition-item strong {
    color: #0d1b2a;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.definition-item p {
    margin: 0;
    color: #555;
}

/* Code Blocks */
.code-block {
    background: #1a1b26;
    color: #a9b1d6;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    overflow-x: auto;
}

.code-block .comment {
    color: #565f89;
    font-style: italic;
}

.code-block .keyword {
    color: #bb9af7;
    font-weight: bold;
}

.code-block .string {
    color: #9ece6a;
}

.code-block .number {
    color: #ff9e64;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f4;
    margin-bottom: 1.5rem;
}

.sidebar-card h3 {
    color: #0d1b2a;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-card h3 i {
    color: #4361ee;
}

.sidebar-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-card ul li {
    margin-bottom: 0.8rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.sidebar-card ul li:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.sidebar-card ul li a {
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-card ul li a:hover {
    color: #4361ee;
    transform: translateX(5px);
}

.sidebar-card ul li a i {
    color: #4361ee;
    font-size: 0.8rem;
}

/* Key Points */
.key-points {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.key-points h4 {
    color: #2e7d32;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.key-points ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-points li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    color: #2e7d32;
}

.key-points li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2e7d32;
    font-weight: bold;
}

/* Warning Box */
.warning-box {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border: 1px solid #ffcdd2;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.warning-box h4 {
    color: #c2185b;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 968px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .sidebar {
        position: static;
    }
    
    .topic-hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .topic-hero {
        padding: 6rem 0 3rem;
    }
    
    .topic-hero h1 {
        font-size: 2rem;
    }
    
    .topic-hero .topic-meta {
        flex-direction: column;
        gap: 1rem;
    }
    
    .content-section h2 {
        font-size: 1.5rem;
    }
    
    .content-section h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .topic-hero h1 {
        font-size: 1.8rem;
    }
    
    .content-section {
        margin-bottom: 2rem;
    }
    
    .sidebar-card {
        padding: 1rem;
    }
}