/**
 * RC Solver Styles
 * 
 * @package GeneratePress_Child_RClite
 * @version 1.1.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --rcl-dark-900: #0a0a0f;
    --rcl-dark-800: #16161f;
    --rcl-dark-700: #1e1e2a;
    --rcl-light-50: #fafaf9;
    --rcl-light-100: #f5f5f4;
    --rcl-light-200: #e7e5e4;
    --rcl-light-300: #d6d3d1;
    --rcl-light-400: #a8a29e;
    --rcl-light-500: #78716c;
    --rcl-light-600: #57534e;
    --rcl-light-700: #44403c;
    --rcl-light-900: #1c1917;
    --rcl-accent: #06b6d4;
    --rcl-accent-dark: #0891b2;
    --rcl-success: #22c55e;
    --rcl-success-light: rgba(34, 197, 94, 0.1);
    --rcl-error: #ef4444;
    --rcl-error-light: rgba(239, 68, 68, 0.1);
    --rcl-warning: #f59e0b;
    --rcl-warning-light: rgba(245, 158, 11, 0.1);
}

/* ==========================================================================
   Base Layout
   ========================================================================== */

.rcl {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--rcl-light-900);
    -webkit-font-smoothing: antialiased;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    background: var(--rcl-light-100);
}

/* Admin bar adjustment */
.admin-bar .rcl {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .rcl {
        top: 46px;
    }
}

/* ==========================================================================
   Header
   ========================================================================== */

.rcl__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
    background: var(--rcl-dark-900);
    color: #fff;
    flex-shrink: 0;
}

.rcl__header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.rcl__exit {
    color: var(--rcl-light-400);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.rcl__exit:hover {
    color: #fff;
    background: var(--rcl-dark-700);
}

.rcl__logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
}

.rcl__header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.rcl__header-title {
    font-size: 0.9375rem;
    font-weight: 600;
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rcl__header-meta {
    font-size: 0.75rem;
    color: var(--rcl-light-500);
}

.rcl__header-right {
    display: flex;
    align-items: center;
}

.rcl__timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--rcl-dark-800);
    border: 1px solid var(--rcl-dark-700);
    border-radius: 10px;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.rcl__timer-icon {
    font-size: 1rem;
}

.rcl__timer--warning {
    background: var(--rcl-warning);
    border-color: var(--rcl-warning);
}

.rcl__timer--danger {
    background: var(--rcl-error);
    border-color: var(--rcl-error);
    animation: rcl-pulse 1s infinite;
}

@keyframes rcl-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ==========================================================================
   Main Two-Column Layout
   ========================================================================== */

.rcl__main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    overflow: hidden;
}

/* ==========================================================================
   Passage (Left Column)
   ========================================================================== */

.rcl__passage {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--rcl-light-200);
    overflow: hidden;
}

.rcl__passage-header {
    padding: 24px;
    border-bottom: 1px solid var(--rcl-light-100);
    flex-shrink: 0;
}

.rcl__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.rcl__badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

.rcl__badge--easy {
    background: var(--rcl-success-light);
    color: #166534;
}

.rcl__badge--medium {
    background: var(--rcl-warning-light);
    color: #92400e;
}

.rcl__badge--hard {
    background: var(--rcl-error-light);
    color: #991b1b;
}

.rcl__badge--topic {
    background: var(--rcl-light-100);
    color: var(--rcl-light-600);
}

.rcl__badge--exam {
    background: #dbeafe;
    color: #1d4ed8;
}

.rcl__title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--rcl-light-900);
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.rcl__meta {
    display: flex;
    gap: 16px;
    font-size: 0.8125rem;
    color: var(--rcl-light-500);
}

.rcl__passage-text {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    font-family: 'Merriweather', Georgia, 'Times New Roman', serif;
    font-size: 1.0625rem;
    line-height: 1.9;
    color: #292524;
}

.rcl__passage-text p {
    margin-bottom: 1.25em;
}

.rcl__passage-text p:last-child {
    margin-bottom: 0;
}

/* Custom scrollbar */
.rcl__passage-text::-webkit-scrollbar {
    width: 8px;
}

.rcl__passage-text::-webkit-scrollbar-track {
    background: var(--rcl-light-100);
}

.rcl__passage-text::-webkit-scrollbar-thumb {
    background: var(--rcl-light-300);
    border-radius: 4px;
}

.rcl__passage-text::-webkit-scrollbar-thumb:hover {
    background: var(--rcl-light-400);
}

/* ==========================================================================
   Quiz (Right Column)
   ========================================================================== */

.rcl__quiz {
    display: flex;
    flex-direction: column;
    background: var(--rcl-light-50);
    overflow: hidden;
}

.rcl__quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #fff;
    border-bottom: 1px solid var(--rcl-light-200);
    flex-shrink: 0;
}

.rcl__quiz-progress {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rcl-light-700);
}

.rcl__dots {
    display: flex;
    gap: 8px;
}

.rcl__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--rcl-light-300);
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}

.rcl__dot:hover {
    transform: scale(1.15);
}

.rcl__dot--current {
    background: var(--rcl-accent);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.25);
}

.rcl__dot--answered {
    background: var(--rcl-success);
}

.rcl__dot--answered.rcl__dot--current {
    background: var(--rcl-success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.rcl__dot--flagged {
    background: var(--rcl-warning);
}

.rcl__dot--flagged.rcl__dot--current {
    background: var(--rcl-warning);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

/* ==========================================================================
   Question Area
   ========================================================================== */

.rcl__question {
    flex: 1;
    padding: 28px 24px;
    overflow-y: auto;
}

.rcl__q-text {
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--rcl-light-900);
    line-height: 1.6;
    margin: 0 0 24px 0;
}

.rcl__options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rcl__option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border: 2px solid var(--rcl-light-200);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.rcl__option:hover {
    border-color: var(--rcl-light-300);
    background: var(--rcl-light-50);
}

.rcl__option.selected {
    border-color: var(--rcl-accent);
    background: rgba(6, 182, 212, 0.05);
}

.rcl__option-letter {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rcl-light-100);
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--rcl-light-600);
    flex-shrink: 0;
    transition: all 0.15s;
}

.rcl__option.selected .rcl__option-letter {
    background: var(--rcl-accent);
    color: #fff;
}

.rcl__option-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--rcl-light-700);
    line-height: 1.5;
    padding-top: 5px;
}

.rcl__option.selected .rcl__option-text {
    color: var(--rcl-light-900);
}

/* Correct/Incorrect states */
.rcl__option--correct {
    border-color: var(--rcl-success) !important;
    background: var(--rcl-success-light) !important;
    cursor: default;
}

.rcl__option--correct .rcl__option-letter {
    background: var(--rcl-success);
    color: #fff;
}

.rcl__option--incorrect {
    border-color: var(--rcl-error) !important;
    background: var(--rcl-error-light) !important;
    cursor: default;
}

.rcl__option--incorrect .rcl__option-letter {
    background: var(--rcl-error);
    color: #fff;
}

/* Explanation */
.rcl__explanation {
    margin-top: 24px;
    padding: 20px;
    background: #f0fdfa;
    border-left: 4px solid var(--rcl-accent);
    border-radius: 0 12px 12px 0;
}

.rcl__explanation-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--rcl-accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

.rcl__explanation-text {
    font-size: 0.9375rem;
    color: var(--rcl-light-700);
    line-height: 1.7;
}

/* Actions */
.rcl__actions {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--rcl-light-200);
}

.rcl__flag-btn,
.rcl__clear-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--rcl-light-500);
    cursor: pointer;
    transition: all 0.15s;
}

.rcl__flag-btn:hover,
.rcl__clear-btn:hover {
    background: var(--rcl-light-100);
    color: var(--rcl-light-700);
}

.rcl__flag-btn.active {
    background: var(--rcl-warning);
    color: #fff;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.rcl__nav {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: #fff;
    border-top: 1px solid var(--rcl-light-200);
    flex-shrink: 0;
}

.rcl__nav-btn {
    flex: 1;
    padding: 16px;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.rcl__nav-btn--prev {
    background: var(--rcl-light-100);
    color: var(--rcl-light-700);
}

.rcl__nav-btn--prev:hover:not(:disabled) {
    background: var(--rcl-light-200);
}

.rcl__nav-btn--prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rcl__nav-btn--next {
    background: var(--rcl-dark-900);
    color: #fff;
}

.rcl__nav-btn--next:hover {
    background: var(--rcl-dark-800);
}

.rcl__nav-btn--submit {
    background: var(--rcl-success);
}

.rcl__nav-btn--submit:hover {
    background: #16a34a;
}

/* ==========================================================================
   Results Modal
   ========================================================================== */

.rcl__modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rcl__modal.active {
    display: flex;
}

.rcl__modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.rcl__modal-box {
    position: relative;
    background: #fff;
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.rcl__result-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.rcl__result-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--rcl-light-900);
}

.rcl__result-subtitle {
    font-size: 0.9375rem;
    color: var(--rcl-light-500);
    margin: 0 0 24px 0;
}

.rcl__score {
    width: 130px;
    height: 130px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--rcl-accent), var(--rcl-accent-dark));
    color: #fff;
}

.rcl__score--good {
    background: linear-gradient(135deg, var(--rcl-success), #16a34a);
}

.rcl__score--bad {
    background: linear-gradient(135deg, var(--rcl-error), #dc2626);
}

.rcl__score-num {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
}

.rcl__score-label {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 4px;
}

.rcl__stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 28px;
    padding: 16px;
    background: var(--rcl-light-50);
    border-radius: 12px;
}

.rcl__stat {
    text-align: center;
}

.rcl__stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rcl-light-900);
}

.rcl__stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--rcl-light-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rcl__btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s;
    background: var(--rcl-dark-900);
    color: #fff;
}

.rcl__btn:hover {
    background: var(--rcl-dark-800);
    color: #fff;
}

.rcl__btn--secondary {
    background: var(--rcl-light-100);
    color: var(--rcl-light-700);
}

.rcl__btn--secondary:hover {
    background: var(--rcl-light-200);
    color: var(--rcl-light-700);
}

.rcl__btn--large {
    padding: 16px 24px;
    font-size: 1.0625rem;
}

.rcl__signup-prompt {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--rcl-light-200);
}

.rcl__signup-prompt p {
    font-size: 0.875rem;
    color: var(--rcl-light-500);
    margin-bottom: 12px;
}

/* ==========================================================================
   Guest Limit Page
   ========================================================================== */

.rcl__guest-limit {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    background: var(--rcl-light-100);
}

.rcl__guest-limit-box {
    text-align: center;
    max-width: 420px;
    padding: 48px 40px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.rcl__guest-limit-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 16px;
}

.rcl__guest-limit h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: var(--rcl-light-900);
}

.rcl__guest-limit-box > p {
    color: var(--rcl-light-600);
    margin-bottom: 24px;
    line-height: 1.6;
}

.rcl__guest-limit-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px 0;
    text-align: left;
}

.rcl__guest-limit-features li {
    padding: 8px 0;
    font-size: 0.9375rem;
    color: var(--rcl-light-700);
}

.rcl__guest-limit-login {
    margin-top: 16px;
    font-size: 0.875rem;
    color: var(--rcl-light-500);
}

.rcl__guest-limit-login a {
    color: var(--rcl-accent-dark);
    text-decoration: underline;
}

/* ==========================================================================
   Previous Attempt Summary
   ========================================================================== */

.rcl__attempt-summary {
    text-align: center;
    padding: 40px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.rcl__attempt-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.rcl__attempt-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rcl-light-900);
    margin: 0 0 24px 0;
}

.rcl__attempt-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.rcl__attempt-stat {
    text-align: center;
}

.rcl__attempt-stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--rcl-light-900);
    line-height: 1.2;
}

.rcl__attempt-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rcl-light-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 4px;
}

.rcl__attempt-date {
    font-size: 0.875rem;
    color: var(--rcl-light-500);
    margin-bottom: 32px;
}

.rcl__attempt-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 300px;
    margin: 0 auto;
}

.rcl__btn--tertiary {
    background: transparent;
    color: var(--rcl-light-600);
    border: 1px solid var(--rcl-light-200);
}

.rcl__btn--tertiary:hover {
    background: var(--rcl-light-100);
    color: var(--rcl-light-700);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .rcl__main {
        grid-template-columns: 1fr 1fr;
    }
    
    .rcl__header-center {
        display: none;
    }
}

@media (max-width: 900px) {
    .rcl__main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .rcl__passage {
        border-right: none;
        border-bottom: 1px solid var(--rcl-light-200);
        max-height: 40vh;
    }
    
    .rcl__passage-header {
        padding: 16px 20px;
    }
    
    .rcl__passage-text {
        padding: 16px 20px;
    }
    
    .rcl__attempt-stats {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .rcl__attempt-stat-value {
        font-size: 1.5rem;
    }
    
    .rcl__attempt-summary {
        padding: 24px 16px;
    }
}

@media (max-width: 600px) {
    .rcl__header {
        padding: 0 16px;
        height: 56px;
    }
    
    .rcl__logo {
        display: none;
    }
    
    .rcl__timer {
        padding: 8px 14px;
        font-size: 1rem;
    }
    
    .rcl__passage-header {
        padding: 16px;
    }
    
    .rcl__title {
        font-size: 1.125rem;
    }
    
    .rcl__meta {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 0.75rem;
    }
    
    .rcl__passage-text {
        padding: 16px;
        font-size: 1rem;
    }
    
    .rcl__quiz-header {
        padding: 16px;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .rcl__dots {
        order: 1;
        width: 100%;
        justify-content: flex-end;
    }
    
    .rcl__question {
        padding: 20px 16px;
    }
    
    .rcl__q-text {
        font-size: 1rem;
    }
    
    .rcl__option {
        padding: 14px;
    }
    
    .rcl__nav {
        padding: 16px;
        gap: 10px;
    }
    
    .rcl__nav-btn {
        padding: 14px;
        font-size: 0.875rem;
    }
    
    .rcl__modal-box {
        padding: 32px 24px;
    }
}
