/**
 * EduTrack Retro Theme
 * Shared styles for all retro/brutalist public pages.
 */

/* ── Base ── */
.retro-body {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    background-color: #0a0a0a;
    color: #fafafa;
    min-height: 100vh;
}

/* ── Grid Background ── */
.grid-bg {
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ── Scanlines ── */
.scanlines::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.03),
        rgba(0, 0, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 50;
    will-change: transform;
    transform: translateZ(0);
}

/* ── Blink ── */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
.blink {
    animation: blink 1s step-end infinite;
}

/* ── Glitch ── */
@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}
.glitch:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
}
.random-glitch {
    /* Applied dynamically via JS */
}

/* ── Marquee ── */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.marquee {
    animation: marquee 20s linear infinite;
}

/* ── Shake ── */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}
.shake {
    animation: shake 0.3s ease-in-out;
}

/* ── Float ── */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* ── Pulse Glow ── */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.3); }
    50% { box-shadow: 0 0 40px rgba(0, 240, 255, 0.6); }
}
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ── Fade In Up ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

/* ── Retro Inputs ── */
.retro-input {
    width: 100%;
    padding: 11px 14px;
    background: #0a0a0a;
    border: 2px solid #2a2a2a;
    color: #fafafa;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.retro-input:focus {
    border-color: #00f0ff;
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.12);
}
.retro-input.has-icon {
    padding-left: 44px;
}
.retro-input.has-icon-right {
    padding-right: 42px;
}
.retro-input.has-error {
    border-color: #ff006e;
}
.retro-input.has-error:focus {
    box-shadow: 0 0 0 3px rgba(255, 0, 110, 0.15);
}
textarea.retro-input {
    resize: vertical;
}

/* Override browser autofill on dark backgrounds */
input.retro-input:-webkit-autofill,
input.retro-input:-webkit-autofill:hover,
input.retro-input:-webkit-autofill:focus,
input.retro-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #0a0a0a inset !important;
    -webkit-text-fill-color: #fafafa !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ── Retro Labels ── */
.retro-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #00f0ff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.retro-label .req {
    color: #ff006e;
    margin-left: 2px;
}
.retro-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #555;
    margin-top: 4px;
}
.field-error {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #ff006e;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Retro Buttons ── */
.retro-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 3px solid #fafafa;
    background: #0a0a0a;
    color: #fafafa;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.6);
}
.retro-btn:hover {
    background: #00f0ff;
    color: #0a0a0a;
    border-color: #00f0ff;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 0 rgba(0, 0, 0, 0.4);
}
.retro-btn:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 0.8);
}
.retro-btn-primary {
    background: #00f0ff;
    color: #0a0a0a;
    border-color: #00f0ff;
}
.retro-btn-primary:hover {
    background: #fafafa;
    border-color: #fafafa;
}
.retro-btn-magenta {
    background: #ff006e;
    color: #fafafa;
    border-color: #ff006e;
}
.retro-btn-magenta:hover {
    background: #fafafa;
    color: #0a0a0a;
    border-color: #fafafa;
}
.retro-btn-lime {
    background: #8ac926;
    color: #0a0a0a;
    border-color: #8ac926;
}
.retro-btn-lime:hover {
    background: #fafafa;
    border-color: #fafafa;
}
.retro-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Terminal Card ── */
.terminal-card {
    background: #1a1a1a;
    border: 4px solid #fafafa;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
}
.terminal-header {
    background: #fafafa;
    color: #0a0a0a;
    padding: 10px 16px;
    border-bottom: 3px solid #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #0a0a0a;
}
.terminal-dot-red {
    background: #ff006e;
}
.terminal-dot-yellow {
    background: #ffbe0b;
}
.terminal-dot-green {
    background: #8ac926;
}

/* ── Card Hover ── */
.card-hover {
    transition: all 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
}

/* ── Retro Logo Box ── */
.retro-logo-box {
    width: 60px;
    height: 60px;
    background: #00f0ff;
    border: 4px solid #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
}
.retro-logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}

/* ── Auth Page Utilities ── */
.auth-container {
    width: 100%;
    max-width: 400px;
}
.auth-logo-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.auth-logo-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.auth-logo-version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #00f0ff;
}

/* Status banners */
.status-success {
    background: rgba(138, 201, 38, 0.12);
    border: 2px solid #8ac926;
    padding: 12px 14px;
}
.status-error {
    background: rgba(255, 0, 110, 0.12);
    border: 2px solid #ff006e;
    padding: 12px 14px;
}
.status-error-text {
    color: #ff6b9d;
}

/* Form layout */
.retro-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Links */
.retro-link {
    color: #ff006e;
    text-decoration: none;
    font-weight: 700;
    transition: opacity 0.15s;
}
.retro-link:hover {
    text-decoration: underline;
}
.retro-link-cyan {
    color: #00f0ff;
    text-decoration: none;
    font-weight: 700;
    transition: opacity 0.15s;
}
.retro-link-cyan:hover {
    text-decoration: underline;
}
.retro-action-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #00f0ff;
    color: #0a0a0a;
    border: 2px solid #fafafa;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s;
}
.retro-action-link:hover {
    opacity: 0.8;
}
.retro-secondary-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: #0a0a0a;
    color: #fafafa;
    border: 2px solid #2a2a2a;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}
.retro-secondary-link:hover {
    border-color: #8ac926;
    color: #8ac926;
}

/* Dividers */
.retro-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}
.retro-divider-line {
    flex: 1;
    height: 1px;
    background: #2a2a2a;
}
.retro-divider-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #333;
}

/* Footer */
.retro-footer {
    margin-top: 20px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #444;
}
.retro-copyright {
    margin-top: 24px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #333;
}

/* States */
.retro-state-wrapper {
    text-align: center;
    padding: 20px 0;
}
.retro-loading-wrapper {
    text-align: center;
    padding: 28px 0;
}
.retro-state-heading {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fafafa;
}
.retro-state-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #888;
    line-height: 1.6;
}
.retro-state-text-mb {
    margin-bottom: 20px;
}

/* Icon circles */
.retro-icon-circle-success {
    width: 60px;
    height: 60px;
    background: rgba(138, 201, 38, 0.2);
    border: 3px solid #8ac926;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.retro-icon-circle-error {
    width: 60px;
    height: 60px;
    background: rgba(255, 0, 110, 0.2);
    border: 3px solid #ff006e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

/* Form error banner */
.retro-form-error {
    display: none;
    background: rgba(255, 0, 110, 0.12);
    border: 2px solid #ff006e;
    padding: 12px 14px;
    margin-bottom: 20px;
}
.retro-form-error-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #ff006e;
}

/* Password toggle */
.retro-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    padding: 4px;
    transition: color 0.15s;
}
.retro-toggle-btn:hover {
    color: #00f0ff;
}

/* Remember me label */
.retro-remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #888;
    transition: color 0.15s;
}
.retro-remember-label:hover {
    color: #00f0ff;
}

/* Hint text */
.retro-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #444;
    margin-top: 6px;
}

/* 3D button hover variants */
.retro-btn-3d-cyan {
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}
.retro-btn-3d-cyan:hover:not(:disabled) {
    box-shadow: 5px 5px 0 #00f0ff;
    transform: translate(-2px, -2px);
}
.retro-btn-3d-magenta {
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}
.retro-btn-3d-magenta:hover:not(:disabled) {
    box-shadow: 5px 5px 0 #ff006e;
    transform: translate(-2px, -2px);
}
.retro-btn-3d-lime {
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}
.retro-btn-3d-lime:hover:not(:disabled) {
    box-shadow: 5px 5px 0 #8ac926;
    transform: translate(-2px, -2px);
}

/* Spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.retro-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #2a2a2a;
    border-top-color: #00f0ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

/* ── Register Page Utilities ── */
.register-status-bar {
    background: #ffbe0b;
    color: #0a0a0a;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 6px 16px;
    border-bottom: 3px solid #0a0a0a;
}
.register-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}
.register-title-badge {
    display: inline-block;
    background: #2a2a2a;
    border: 2px solid #00f0ff;
    padding: 4px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #00f0ff;
    letter-spacing: 0.1em;
}
.register-card {
    background: #1a1a1a;
    border: 3px solid #fafafa;
    padding: 32px;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
}
.register-step-heading {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.register-step-heading-cyan {
    color: #00f0ff;
}
.register-step-heading-magenta {
    color: #ff006e;
}
.register-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.register-field-group {
    margin-bottom: 20px;
}
.register-field-group-lg {
    margin-bottom: 24px;
}
.register-btn-next {
    padding: 11px 28px;
    background: #00f0ff;
    color: #0a0a0a;
    border: 3px solid #fafafa;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: box-shadow 0.15s, transform 0.1s;
}
.register-btn-next:hover {
    box-shadow: 4px 4px 0 #00f0ff;
    transform: translate(-2px, -2px);
}
.register-btn-back {
    padding: 11px 24px;
    background: #2a2a2a;
    color: #fafafa;
    border: 3px solid #2a2a2a;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: border-color 0.15s;
}
.register-btn-back:hover {
    border-color: #fafafa;
}
.register-btn-submit {
    padding: 11px 28px;
    background: #ff006e;
    color: #fff;
    border: 3px solid #fafafa;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: box-shadow 0.15s, transform 0.1s;
}
.register-btn-submit:hover:not(:disabled) {
    box-shadow: 4px 4px 0 #ff006e;
    transform: translate(-2px, -2px);
}
.register-info-panel {
    margin-top: 24px;
    background: rgba(255, 190, 11, 0.08);
    border: 3px solid #ffbe0b;
    padding: 20px;
}
.register-info-icon-box {
    width: 44px;
    height: 44px;
    background: #ffbe0b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Alpine.js ── */
[x-cloak] {
    display: none !important;
}

/* ── Print Styles (for parent results) ── */
@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    .no-print,
    .blink {
        display: none !important;
    }

    body {
        background: white !important;
        color: #111 !important;
        font-size: 11pt !important;
        line-height: 1.4 !important;
    }

    .scanlines::before,
    .grid-bg {
        background: none !important;
    }

    /* Remove retro borders/shadows for clean print */
    .shadow-brutal,
    .shadow-brutal-sm {
        box-shadow: none !important;
    }

    /* Convert dark cards to light bordered boxes */
    .bg-retro-gray,
    .bg-retro-darkgray {
        background: #f5f5f5 !important;
        border: 1px solid #ccc !important;
        color: #111 !important;
    }

    .border-retro-white,
    .border-retro-gray,
    .border-retro-black {
        border-color: #ccc !important;
    }

    .border-b-4 {
        border-bottom-width: 1px !important;
    }

    .border-t-4 {
        border-top-width: 1px !important;
    }

    /* Text colours */
    .text-retro-white,
    .text-retro-lime,
    .text-retro-cyan,
    .text-retro-yellow,
    .text-gray-400,
    .text-gray-500 {
        color: #111 !important;
    }

    /* Grade badges — keep background but lighter */
    .bg-retro-lime {
        background: #d4edda !important;
        color: #155724 !important;
        border: 1px solid #c3e6cb !important;
    }

    .bg-retro-cyan {
        background: #d1ecf1 !important;
        color: #0c5460 !important;
        border: 1px solid #bee5eb !important;
    }

    .bg-retro-yellow {
        background: #fff3cd !important;
        color: #856404 !important;
        border: 1px solid #ffeeba !important;
    }

    .bg-orange-500 {
        background: #ffe5cc !important;
        color: #7a3e00 !important;
        border: 1px solid #ffd1a3 !important;
    }

    .bg-retro-magenta {
        background: #f8d7da !important;
        color: #721c24 !important;
        border: 1px solid #f5c6cb !important;
    }

    .bg-retro-gray {
        background: #f8f9fa !important;
    }

    /* Ensure tables print well */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    th, td {
        border: 1px solid #999 !important;
        padding: 6px 8px !important;
    }

    thead {
        display: table-header-group !important;
    }

    tr {
        page-break-inside: avoid !important;
    }

    /* Prevent large elements from breaking awkwardly */
    .bg-retro-gray,
    .bg-retro-darkgray {
        page-break-inside: avoid !important;
    }

    /* Links */
    a {
        text-decoration: none !important;
        color: #111 !important;
    }
}
