/* Scroll override for courses page */
html:has(body.courses-page) {
    touch-action: auto;
    overflow-x: hidden;
}

body.courses-page {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
    touch-action: auto;
    overscroll-behavior: auto;
    background: #fefefa;
    margin: 0;
}

body.courses-page .container {
    overflow: visible;
}

/* ── Header ── */
.courses-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fefefa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    height: 64px;
    display: flex;
    align-items: center;
}

.courses-header-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.courses-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

.courses-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.courses-header-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.courses-nav-link {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 300;
    transition: color 0.2s;
}

.courses-nav-link:hover {
    color: #3C4BFB;
}

/* ── Three-column layout ── */
.courses-layout {
    display: flex;
    min-height: calc(100vh - 48px);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.courses-side-col {
    display: none;
    flex: 1;
    flex-direction: column;
}

.courses-side-row {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.courses-side-fill {
    flex: 1;
    width: 100%;
}

.courses-center-col {
    position: relative;
    width: 100%;
    max-width: 650px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
}

/* ── Gradient blobs ── */
.courses-blob-container {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.courses-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: blobDrift 12s ease-in-out infinite alternate;
}

.courses-blob-1 {
    width: 300px;
    height: 300px;
    background: #C5E67380;
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.courses-blob-2 {
    width: 250px;
    height: 250px;
    background: #3C4BFB4D;
    top: 40%;
    right: -5%;
    animation-delay: -4s;
}

.courses-blob-3 {
    width: 280px;
    height: 280px;
    background: #D4B9FB80;
    bottom: 10%;
    left: 20%;
    animation-delay: -8s;
}

@keyframes blobDrift {
    0% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -20px) scale(1.05);
    }
    66% {
        transform: translate(-20px, 15px) scale(0.95);
    }
    100% {
        transform: translate(10px, -10px) scale(1.02);
    }
}

/* ── Hero section ── */
.courses-hero {
    position: relative;
    z-index: 1;
    height: 240px;
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.courses-hero-icon {
    height: 32px;
    width: auto;
    margin-bottom: 8px;
}

.courses-hero-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 28px;
    font-weight: 300;
    line-height: 1.3;
    color: #1a1a2e;
    text-align: left;
}

.courses-hero-rotating {
    font-style: italic;
    display: inline;
    transition: opacity 0.4s ease;
}

.courses-hero-rotating.fade-out {
    opacity: 0;
}

.courses-hero-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #1a1a2e;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.courses-hero-subtitle {
    margin-top: 16px;
    font-size: 16px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 300;
    color: #333;
    text-align: left;
    line-height: 1.5;
}

.courses-hero-subtitle p {
    margin: 0;
}

/* ── Input section ── */
.courses-input-section {
    position: relative;
    z-index: 1;
    min-height: 130px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.courses-input-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 1.5rem;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.025);
}

.courses-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.5;
    color: #1a1a2e;
    background: transparent;
    padding: 0 8px;
}

.courses-textarea::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

.courses-input-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.courses-submit-btn {
    border: none;
    background: none;
    color: #1a1a2e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 36px;
    transition: color 0.2s;
}

.courses-submit-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

.courses-submit-btn:hover:not(:disabled) {
    color: #3C4BFB;
}

/* ── Credits widget ── */
.courses-credits {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 13px;
    color: #888;
    margin-top: 12px;
}

.courses-credits a {
    color: #3C4BFB;
    text-decoration: none;
}

.courses-credits a:hover {
    text-decoration: underline;
}

/* ── Status text (loading state) ── */
.courses-status-text {
    position: relative;
    z-index: 1;
    padding: 16px 24px;
    margin: 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 16px;
    font-weight: 300;
    color: #1a1a2e;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.courses-status-icon {
    height: 24px;
    width: 24px;
}

.courses-dots::after {
    content: '';
    animation: dotCycle 1.5s steps(1) infinite;
}

@keyframes dotCycle {
    0%      { content: '.'; }
    16.67%  { content: '..'; }
    33.33%  { content: '...'; }
    50%     { content: '..'; }
    66.67%  { content: '.'; }
    83.33%  { content: ''; }
}

.courses-status-text.fade-out {
    opacity: 0;
}

/* ── Questions list ── */
.courses-questions-section {
    position: relative;
    z-index: 1;
    padding: 24px 24px 48px;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
}

.courses-question-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 16px;
    border-bottom: none;
    text-decoration: none;
    color: #1a1a2e;
    transition: background 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border-radius: 16px;
}

.courses-question-item:hover {
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.courses-question-arrow {
    font-size: 18px;
    flex-shrink: 0;
    color: #888;
    transition: color 0.15s;
}

.courses-question-text {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
}

/* ── Desktop ── */
@media (min-width: 768px) {
    .courses-side-col {
        display: flex;
    }

    .courses-side-col:first-child {
        border-right: 1px solid rgba(0, 0, 0, 0.1);
    }

    .courses-side-col:last-child {
        border-left: 1px solid rgba(0, 0, 0, 0.1);
    }

    .courses-center-col {
        width: 650px;
    }

    .courses-hero {
        padding: 0 32px 24px;
    }

    .courses-hero-title {
        font-size: 22px;
    }

    .courses-questions-section {
        padding: 24px 48px 48px;
    }

}

/* ── Mobile ── */
@media (max-width: 767px) {
    .courses-header-links {
        gap: 16px;
    }

    .courses-hero-title {
        font-size: 26px;
    }

    .courses-center-col {
        max-width: 100%;
    }
}
