/* Subtopic Detail Page Styles */

.subtopic-page {
    min-height: calc(100vh - 64px);
    padding: 2rem 0 4rem;
}

.subtopic-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
    color: #6b7280;
    flex-wrap: wrap;
}

.breadcrumb-nav a {
    color: #111827;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.breadcrumb-nav a:hover {
    color: #2563eb;
}

.breadcrumb-separator {
    color: #9ca3af;
}

.breadcrumb-current {
    color: #2563eb;
    font-weight: 600;
}

/* Page Header */
.page-header {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.page-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.75rem 0;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0;
    font-weight: 400;
}

/* Theory Card */
.theory-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.theory-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(135deg, #87cefa, #63b9ee);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #87cefa, #63b9ee);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon svg {
    width: 28px;
    height: 28px;
    stroke: white;
}

.card-heading {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.theory-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #374151;
}

.theory-content h1,
.theory-content h2,
.theory-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
    font-weight: 600;
}

.theory-content h1 {
    font-size: 1.875rem;
}

.theory-content h2 {
    font-size: 1.5rem;
}

.theory-content h3 {
    font-size: 1.25rem;
}

.theory-content p {
    margin-bottom: 1.25rem;
}

.theory-content ul,
.theory-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.75rem;
}

.theory-content li {
    margin-bottom: 0.5rem;
}

.theory-content code {
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e11d48;
}

.theory-content pre {
    background: #1f2937;
    color: #f3f4f6;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.theory-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Test CTA Card */
.test-cta-card {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.test-cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.test-cta-content {
    position: relative;
    z-index: 1;
}

.test-cta-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.test-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.test-icon svg {
    width: 36px;
    height: 36px;
    stroke: white;
}

.test-cta-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.test-cta-description {
    font-size: 1.125rem;
    color: #d1d5db;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.test-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.test-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669, #047857);
}

.test-cta-button svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

/* Responsive Design */
@media (max-width: 768px) {
    .subtopic-page {
        padding: 1rem 0 2rem;
    }

    .page-header {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .theory-card,
    .test-cta-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .card-heading {
        font-size: 1.5rem;
    }

    .theory-content {
        font-size: 1rem;
    }

    .test-cta-title {
        font-size: 1.5rem;
    }

    .test-cta-description {
        font-size: 1rem;
    }

    .test-cta-button {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 2rem;
    }

    .breadcrumb-nav {
        font-size: 0.875rem;
    }
}

/* Search Button Override */
.compact-search-wrapper {
    position: fixed;
    top: 80px;
    right: 40px;
    z-index: 1000;
}

@media (max-width: 768px) {
    .compact-search-wrapper {
        display: none;
    }
}

/* ========================================
   DARK MODE SUPPORT
======================================== */
[data-theme="dark"] .subtopic-page {
    background: #1e293b;
}

[data-theme="dark"] .breadcrumb-nav {
    color: #cbd5e1;
}

[data-theme="dark"] .breadcrumb-nav a {
    color: #f1f5f9;
}

[data-theme="dark"] .breadcrumb-nav a:hover {
    color: #60a5fa;
}

[data-theme="dark"] .breadcrumb-separator {
    color: #64748b;
}

[data-theme="dark"] .breadcrumb-current {
    color: #60a5fa;
}

[data-theme="dark"] .page-header {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .page-title {
    color: #f1f5f9;
}

[data-theme="dark"] .page-subtitle {
    color: #cbd5e1;
}

[data-theme="dark"] .theory-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .theory-card::before {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

[data-theme="dark"] .card-icon {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

[data-theme="dark"] .card-heading {
    color: #f1f5f9;
}

[data-theme="dark"] .theory-content {
    color: #cbd5e1;
}

[data-theme="dark"] .theory-content h1,
[data-theme="dark"] .theory-content h2,
[data-theme="dark"] .theory-content h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .theory-content code {
    background: #0f172a;
    color: #fca5a5;
}

[data-theme="dark"] .theory-content pre {
    background: #0f172a;
    color: #f1f5f9;
    border: 1px solid #334155;
}

[data-theme="dark"] .test-cta-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .test-cta-card::before {
    background: radial-gradient(circle, rgba(96, 165, 250, 0.15) 0%, transparent 70%);
}

[data-theme="dark"] .test-cta-description {
    color: #cbd5e1;
}
