/* ============================================
   CBT Fullscreen — Neo-Brutalist Stylesheet
   ============================================ */

/* === CSS Variables === */
:root {
    --blue-primary: #2563EB;
    --blue-dark: #1d4ed8;
    --blue-light: #3b82f6;
    --yellow-accent: #FACD00;
    --yellow-hover: #f5c000;
    --navy-dark: #0B1221;
    --navy-mid: #111827;
    
    --white: #FFFFFF;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-900: #111827;
    
    --border-color: #000000;
    --border-width: 2.5px;
    --shadow-brutal: 4px 4px 0px 0px rgba(0, 0, 0, 1);
    --shadow-brutal-sm: 3px 3px 0px 0px rgba(0, 0, 0, 1);
    --shadow-brutal-hover: 6px 6px 0px 0px rgba(0, 0, 0, 1);
    --shadow-pressed: 1px 1px 0px 0px rgba(0, 0, 0, 1);
    
    --radius: 14px;
    --radius-sm: 10px;
    --radius-pill: 100px;
    
    --font: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    --transition: 0.15s ease;
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--blue-primary);
    color: var(--gray-900);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Pages === */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* === Dot Grid Background === */
.bg-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
}

/* === Container === */
.container {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* === Digital Clock === */
.digital-clock-wrapper {
    margin-bottom: 1.5rem;
}

.digital-clock {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    background: var(--white);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-brutal-sm);
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: 0.05em;
}

.clock-separator {
    animation: blink 1s step-end infinite;
    color: var(--blue-primary);
}

.clock-date {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.03em;
}

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

/* === Hero === */
.hero {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    background: var(--yellow-accent);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-brutal-sm);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.logo-badge svg {
    width: 20px;
    height: 20px;
}

.hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    line-height: 1.15;
}

.hero h1 .highlight {
    background: var(--yellow-accent);
    color: var(--gray-900);
    padding: 0.05em 0.25em;
    border: var(--border-width) solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-brutal-sm);
    display: inline-block;
}

.subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    max-width: 420px;
    margin: 0 auto;
    font-weight: 500;
}

/* === Features Grid === */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
}

.feature-card {
    background: var(--white);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-brutal);
    transition: var(--transition);
}

.feature-card:hover {
    box-shadow: var(--shadow-brutal-hover);
    transform: translate(-2px, -2px);
}

.feature-card:active {
    box-shadow: var(--shadow-pressed);
    transform: translate(2px, 2px);
}

.feature-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.feature-card h3 {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    color: var(--gray-900);
}

.feature-card p {
    font-size: 0.72rem;
    color: var(--gray-500);
    line-height: 1.4;
    font-weight: 500;
}

/* === URL Form === */
.url-form {
    width: 100%;
    max-width: 520px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.input-group {
    position: relative;
    margin-bottom: 1rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    z-index: 2;
    transition: var(--transition);
}

.input-group:focus-within .input-icon {
    color: var(--blue-primary);
}

#exam-url {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    font-family: var(--font);
    font-weight: 600;
    color: var(--gray-900);
    background: var(--white);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-brutal);
    outline: none;
    transition: var(--transition);
}

#exam-url::placeholder {
    color: var(--gray-400);
    font-weight: 500;
}

#exam-url:focus {
    box-shadow: var(--shadow-brutal-hover);
    transform: translate(-1px, -1px);
}

.error-message {
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #fef2f2;
    border-radius: var(--radius-sm);
    border: var(--border-width) solid #dc2626;
    box-shadow: var(--shadow-brutal-sm);
}

/* === Buttons === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 800;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--yellow-accent);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-brutal);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-primary:hover {
    box-shadow: var(--shadow-brutal-hover);
    transform: translate(-2px, -2px);
    background: var(--yellow-hover);
}

.btn-primary:active {
    box-shadow: var(--shadow-pressed);
    transform: translate(2px, 2px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.85rem 2rem;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font);
    color: var(--gray-600);
    background: var(--white);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-brutal-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.75rem;
}

.btn-secondary:hover {
    box-shadow: var(--shadow-brutal);
    transform: translate(-1px, -1px);
    color: var(--gray-900);
}

.btn-secondary:active {
    box-shadow: var(--shadow-pressed);
    transform: translate(1px, 1px);
}

.btn-small {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
}

.btn-icon {
    font-size: 1.1rem;
}

/* === Info Note === */
.info-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--white);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-brutal-sm);
    width: 100%;
    max-width: 520px;
}

.info-note .info-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.info-note p {
    font-size: 0.8rem;
    color: var(--gray-600);
    line-height: 1.5;
    font-weight: 500;
}

/* === Modals === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--white);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 8px 8px 0px 0px rgba(0, 0, 0, 1);
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: var(--border-width) solid var(--border-color);
    background: var(--gray-100);
    border-radius: 8px;
    color: var(--gray-900);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 1);
}

.modal-close:hover {
    background: #fef2f2;
    box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 1);
    transform: translate(-1px, -1px);
}

.modal-close:active {
    box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 1);
    transform: translate(1px, 1px);
}

.modal-body p {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-weight: 500;
}

.modal-body ol {
    list-style: none;
    counter-reset: steps;
    margin-bottom: 1.5rem;
}

.modal-body ol li {
    counter-increment: steps;
    position: relative;
    padding: 0.75rem 0.75rem 0.75rem 3rem;
    margin-bottom: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-brutal-sm);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
}

.modal-body ol li::before {
    content: counter(steps);
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: var(--blue-primary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
}

/* === Modal URL Preview === */
.modal-url-preview {
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-brutal-sm);
    font-size: 0.82rem;
    color: var(--blue-primary);
    word-break: break-all;
    margin-bottom: 1.25rem;
    font-family: var(--font-mono);
    font-weight: 600;
}

/* === Exam Page (Iframe) === */
.exam-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border: none;
    z-index: 10;
    background: var(--white);
}

/* === Floating Action Button === */
.fab-exit {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: var(--yellow-accent);
    color: var(--gray-900);
    border: var(--border-width) solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-brutal);
    cursor: pointer;
    z-index: 20;
    transition: var(--transition);
}
.fab-exit:hover {
    transform: translate(-3px, -3px) scale(1.05);
    background: var(--yellow-hover);
    box-shadow: var(--shadow-brutal-hover);
}
.fab-exit:active {
    transform: translate(2px, 2px) scale(0.95);
    box-shadow: var(--shadow-pressed);
}

.fab-exit svg {
    width: 24px;
    height: 24px;
}

/* === Fullscreen Warning Overlay === */
.fullscreen-warning {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(11, 18, 33, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.warning-content {
    background: var(--white);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    max-width: 420px;
    box-shadow: 8px 8px 0px 0px rgba(0, 0, 0, 1);
}

.warning-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.warning-content h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 0.75rem;
}

.warning-content p {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* === Footer === */
.footer {
    position: relative;
    z-index: 1;
    background: var(--navy-dark);
    text-align: center;
    padding: 1.5rem;
    border-top: var(--border-width) solid var(--border-color);
}

.footer p {
    color: var(--gray-400);
    font-size: 0.82rem;
    font-weight: 600;
}

.footer .creator {
    color: var(--yellow-accent);
    font-weight: 800;
}

.footer .year {
    color: var(--white);
    font-weight: 700;
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* === Responsive === */
@media (max-width: 640px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .features-grid {
        display: none;
    }
    
    .feature-icon {
        font-size: 1.5rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .feature-card h3 {
        font-size: 0.9rem;
        margin-bottom: 0.1rem;
    }
    
    .container {
        padding: 1.5rem 1rem;
    }
    
    .digital-clock {
        font-size: 1.2rem;
        padding: 0.5rem 1.1rem;
    }
}

@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.7rem;
    }
    
    .btn-primary {
        padding: 0.85rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--blue-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
