/* ============================================
   SCHOOL APP - PREMIUM GLASS DESIGN
   ============================================
   📱 MOBILE-FIRST | 🌈 AURORA WAVE | 🪟 GLASS
   ============================================ */

:root {
    /* Glass System */
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --glass-blur: 20px;

    /* Colors */
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --accent-color: #6c5ce7;

    /* Animations */
    --shimmer-speed: 2.5s;

    /* Spacing & Layout */
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --radius-lg: 24px;

    /* Typography */
    --font-family: 'Inter', sans-serif;

    /* Safe Areas */
    --safe-top: env(safe-area-inset-top, 20px);
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

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

/* ============================================
   LOADING STATES
   ============================================ */
.btn-login:disabled,
.btn-secondary:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-login.is-loading,
.btn-secondary.is-loading {
    cursor: progress;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    min-height: 100%;
    min-height: 100dvh;
    background-color: #550000;
    background-image: linear-gradient(-45deg,
            #550000,
            #801515,
            #400a0a,
            #6b1a1a);
    background-size: 400% 400%;
    animation: auroraWave 45s ease infinite;
}

/* ============================================
   SPLASH SCREEN
   ============================================ */

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background-color: #550000;
    background-image: linear-gradient(-45deg, #550000, #801515, #400a0a, #6b1a1a);
    background-size: 400% 400%;
    animation: auroraWave 45s ease infinite;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Skip Mode - Button at bottom during video */
.tap-button.skip-mode {
    position: absolute;
    bottom: 60px;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    z-index: 10;
}

/* Tap Overlay */
.tap-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    padding: 2rem;
}

.tap-overlay.hidden {
    display: none;
}

.splash-logo {
    width: 200px;
    max-width: 80%;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.2));
    animation: logoFloat 3s ease-in-out infinite;
}

.tap-text {
    font-family: var(--font-family);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

/* Tap Button - Gradient Style */
.tap-button {
    width: fit-content;
    display: flex;
    align-items: center;
    padding: 1.2em 1.5rem;
    cursor: pointer;
    gap: 0.5rem;
    font-weight: bold;
    font-size: 1.1rem;
    font-family: var(--font-family);
    border-radius: 30px;
    text-shadow: 2px 2px 3px rgb(136 0 136 / 50%);
    background: linear-gradient(15deg, #880088, #aa2068, #cc3f47, #de6f3d, #f09f33, #de6f3d, #cc3f47, #aa2068, #880088) no-repeat;
    background-size: 300%;
    color: #fff;
    border: none;
    background-position: left center;
    box-shadow: 0 30px 10px -20px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease, transform 0.2s ease;
    animation: buttonPulse 2s ease-in-out infinite;
}

.tap-button:active {
    transform: scale(0.95);
    background-size: 320%;
    background-position: right center;
}

.tap-button svg {
    width: 23px;
    fill: #f09f33;
    transition: fill 0.3s ease;
}

.tap-button:active svg {
    fill: #fff;
}

/* Animated Ring (fallback) */
.tap-ring {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: ringPulse 2s ease-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes buttonPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 30px 10px -20px rgba(0, 0, 0, 0.2);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 35px 15px -20px rgba(0, 0, 0, 0.25);
    }
}

@keyframes ringPulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Welcome Video */
.welcome-video {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* Fade In Animation for Portal */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 🌈 Aurora Wave Background */
body {
    font-family: var(--font-family);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #550000;
    background-image: linear-gradient(-45deg,
            #550000,
            #801515,
            #400a0a,
            #6b1a1a);
    background-size: 400% 400%;
    animation: auroraWave 45s ease infinite;
    position: relative;
    overflow-x: hidden;
}

/* Overlay for softer look - Safari compatible */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(85, 0, 0, 0.15);
    pointer-events: none;
    z-index: -1;
}

@keyframes auroraWave {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Portal Screen - hidden by default, shown via JS */
#portal-screen {
    display: none;
}

/* Layout Container */
.landing-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
    padding-top: calc(var(--spacing-lg) + var(--safe-top));
    padding-bottom: calc(var(--spacing-lg) + var(--safe-bottom));
}

/* App Logo */
.app-logo {
    width: 180px;
    max-width: 70%;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }
}

.portal-title {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    text-align: center;
    margin-bottom: 3rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.5px;
}

/* Cards Container */
.portal-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 340px;
    z-index: 1;
    /* Above background */
}

/* 🪟 Premium Glass Card */
.portal-card {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    overflow: hidden;
    /* For shimmer effect */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    transform: translateZ(0);
    /* Hardware Acceleration */
}

/* ✨ Shimmer / Pantulan Bergerak Effect */
.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    transform: skewX(-25deg);
    animation: shimmer var(--shimmer-speed) infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        left: -150%;
    }

    100% {
        left: 150%;
    }
}

/* Card Interaction */
.portal-card:active {
    transform: scale(0.98);
}

.portal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.portal-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.portal-description {
    font-size: 0.95rem;
    color: #ffffff;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-weight: 500;
}

/* 🔘 Glass Button style */
.login-btn {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #2d3436;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.login-btn:active {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(2px);
}

/* Tablet & Desktop Layout */
@media (min-width: 768px) {
    .portal-cards {
        flex-direction: row;
        max-width: 800px;
        gap: 2rem;
    }

    .portal-card {
        flex: 1;
        padding: 2.5rem;
    }

    .portal-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    }

    .login-btn:hover {
        background: rgba(255, 255, 255, 0.5);
        border-color: #fff;
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
    }
}

/* ============================================
   ADD TO HOME SCREEN PROMPT
   ============================================ */

.a2hs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 24, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.a2hs-overlay.active {
    opacity: 1;
    visibility: visible;
}

.a2hs-card {
    width: min(680px, 94vw);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.a2hs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.a2hs-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.a2hs-eyebrow {
    margin: 0 0 4px;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
}

.a2hs-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1.2;
}

.a2hs-close {
    border: none;
    background: rgba(148, 163, 184, 0.2);
    color: #334155;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    flex-shrink: 0;
}

.a2hs-close:hover {
    background: rgba(148, 163, 184, 0.35);
}

.a2hs-subtitle {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}

.a2hs-grid {
    display: grid;
    gap: 12px;
}

.a2hs-platform {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    padding: 16px;
}

.a2hs-platform h4 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
}

.a2hs-platform ol {
    margin: 0;
    padding: 0;
    list-style: none;
    color: #334155;
    font-size: 0.95rem;
    font-weight: 500;
}

.a2hs-platform li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.a2hs-icon {
    width: 20px;
    height: 20px;
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.1);
    padding: 2px;
    border-radius: 6px;
    flex-shrink: 0;
}

.a2hs-platform li:last-child {
    margin-bottom: 0;
}

.a2hs-note {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
}

.a2hs-actions {
    display: flex;
    justify-content: flex-end;
}

.a2hs-btn {
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.a2hs-btn.secondary {
    background: rgba(148, 163, 184, 0.2);
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.5);
}

@media (min-width: 720px) {
    .a2hs-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   LANDING FOOTER
   ============================================ */

.landing-footer {
    margin-top: 3rem;
    text-align: center;
}

.privacy-link {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
}

.privacy-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ========================================
   REPORT PREVIEW MODAL
   ======================================== */
.report-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.report-preview-modal {
    background: white;
    border-radius: 16px;
    width: 95%;
    max-width: 900px;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.report-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.report-preview-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.report-preview-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.report-preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.report-preview-body {
    flex: 1;
    overflow: hidden;
    background: #f8fafc;
}

.report-preview-footer {
    padding: 14px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.report-preview-print {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.report-preview-print:hover {
    transform: translateY(-2px);
}

.report-preview-close-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.report-preview-close-btn:hover {
    background: #e2e8f0;
}
