/* ----------------------------------------------------
   Core Pages CSS (Courses, Exams, Apply, Wizard)
   Desktop App Modern Design
   ---------------------------------------------------- */

/* === Course Grid === */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 0;
}

.course-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-smooth);
    position: relative;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(5, 150, 105, 0.15);
}

.course-thumbnail {
    height: 170px;
    background-size: cover;
    background-position: center;
    background-color: var(--secondary);
    position: relative;
}

.course-thumbnail::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.04));
}

.course-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.course-title {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: var(--text-main);
    font-weight: 600;
    line-height: 1.35;
}

.course-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-badge {
    background: var(--bg-inset);
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Locked State */
.course-card.locked {
    filter: grayscale(100%);
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
}

.course-card.locked::after {
    content: "\f023";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--secondary);
    opacity: 0.7;
    z-index: 10;
}

.progress-bar-container {
    height: 3px;
    background: var(--border);
    margin-top: auto;
    width: 100%;
    border-radius: 2px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    width: 0%;
    transition: width 0.6s ease;
    border-radius: 2px;
}

/* === Exam Paper Interface === */
.exam-paper-container {
    max-width: 800px;
    margin: 2.5rem auto;
    background: white;
    padding: 3rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    min-height: 70vh;
}

.exam-header {
    border-bottom: 2px solid var(--text-main);
    padding-bottom: 0.85rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.exam-title {
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 700;
}

.exam-meta {
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Gap Input */
.gap-input {
    border: none;
    border-bottom: 2px solid var(--border);
    background: transparent;
    font-family: 'Courier New', monospace;
    text-align: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    padding: 0 0.25rem;
    width: 120px;
    margin: 0 0.25rem;
    transition: all var(--transition-fast);
}

.gap-input:focus {
    outline: none;
    border-bottom-color: var(--primary);
    background: var(--primary-subtle);
}

.exam-text {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--text-main);
    text-align: justify;
}

/* Sticky Timer */
.exam-timer {
    position: fixed;
    top: 80px;
    right: 1.5rem;
    background: var(--secondary);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* === Placement Test Wizard === */
.wizard-container {
    max-width: 660px;
    margin: 3rem auto;
}

.wizard-step {
    display: none;
    animation: fadeIn 0.35s ease;
}

.wizard-step.active {
    display: block;
}

.wizard-question {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 1.75rem;
    text-align: center;
    color: var(--text-main);
    line-height: 1.4;
}

.option-grid {
    display: grid;
    gap: 0.75rem;
}

.option-card {
    background: white;
    border: 2px solid var(--border);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-weight: 500;
}

.option-card:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
    transform: translateX(4px);
}

.option-card.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.option-marker {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.option-card:hover .option-marker {
    border-color: var(--primary);
}

.option-card.selected .option-marker {
    border-color: white;
    background: white;
}

.option-card.selected .option-marker::after {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    display: block;
}

/* === Application Form === */
.apply-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 75vh;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

@media (max-width: 900px) {
    .apply-container {
        grid-template-columns: 1fr;
    }
    .apply-left {
        padding: 2.5rem 2rem !important;
        min-height: 200px;
    }
    .apply-right {
        padding: 2rem !important;
    }
}

.apply-left {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.apply-left::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('https://www.transparenttextures.com/patterns/cubes.png');
    opacity: 0.08;
}

.apply-right {
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.floating-label-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.floating-input {
    width: 100%;
    padding: 0.85rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    background: var(--bg-inset);
    font-family: var(--font-sans);
}

.floating-input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: var(--shadow-focus);
}

.floating-label {
    position: absolute;
    left: 0.75rem;
    top: 0.85rem;
    pointer-events: none;
    color: var(--text-muted);
    transition: 0.2s ease all;
    font-size: 0.9rem;
}

.floating-input:focus~.floating-label,
.floating-input:not(:placeholder-shown)~.floating-label {
    top: -0.55rem;
    font-size: 0.72rem;
    background: white;
    padding: 0 0.25rem;
    color: var(--primary);
    font-weight: 600;
}

/* === Mobile Responsive for Pages === */
@media (max-width: 768px) {
    .course-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem 0;
    }
    .course-thumbnail {
        height: 150px;
    }
    .course-body {
        padding: 1rem;
    }
    .course-title {
        font-size: 1rem;
    }
    .exam-paper-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    .wizard-container {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }
    .wizard-question {
        font-size: 1.15rem;
    }
    .option-card {
        padding: 1rem;
        font-size: 0.92rem;
    }
}

@media (max-width: 480px) {
    .course-grid {
        grid-template-columns: 1fr;
    }
    .course-thumbnail {
        height: 130px;
    }
    .exam-paper-container {
        padding: 1rem;
        margin: 0.5rem;
    }
    .wizard-question {
        font-size: 1.05rem;
        margin-bottom: 1.25rem;
    }
    .option-card {
        padding: 0.85rem;
        font-size: 0.88rem;
        gap: 0.65rem;
    }
    .option-marker {
        width: 20px;
        height: 20px;
    }
}