@charset "UTF-8";

/* --- Core Config --- */
:root {
    --transition-speed: 0.5s;
    --transition-ease: cubic-bezier(0.25, 1, 0.5, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* --- SCROLL CONTAINER --- */
#main-scroll {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scroll-behavior: smooth;
    /* padding-bottom set dynamically by JS */
    padding-bottom: 180px;
}

/* --- OVERLAY LAYER --- */
#overlay-layer {
    position: absolute;
    top: 0; left: 0; width: 100%;
    pointer-events: none;
    z-index: 50;
}

/* --- UI STAGE --- */
#ui-view {
    display: block;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

/* Blur background in intro steps */
body[data-step="0"] #ui-view,
body[data-step="1"] #ui-view {
    filter: blur(8px) grayscale(100%);
    opacity: 0.3;
    transform: scale(0.98);
    pointer-events: none;
}

#app-stage {
    background: white;
    transition: all var(--transition-speed) var(--transition-ease);
}

/* =========================================
   STEP TRANSFORMATIONS
   ========================================= */

/* --- STEP 2: STRUCTURE & SPACING (Wireframe) --- */
body[data-step="2"] #app-stage {
    background-color: #f8fafc;
    box-shadow: none;
    border: none;
}

body[data-step="2"] .wf-element {
    font-family: 'Kalam', cursive !important;
    border: 2px solid #cbd5e1 !important;
    background-color: white !important;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px !important;
    color: #64748b !important;
    box-shadow: none !important;
}

/* Skeleton Bars for non-essential text */
body[data-step="2"] .skeleton-text {
    color: transparent !important;
    background-color: #e2e8f0;
    border-radius: 4px;
}

/* Hide visuals in wireframe */
body[data-step="2"] .hide-in-wireframe { opacity: 0 !important; pointer-events: none; }

/* Cramped Spacing (Problem State) */
body[data-step="2"].cramped .space-sensitive {
    gap: 2px !important;
    padding: 4px !important;
    margin-bottom: 4px !important;
}

/* --- STEP 3: MULTILINGUAL STRESS TEST --- */
body[data-step="3"] .wf-element {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 4px !important;
    color: #334155;
    font-family: 'Inter', 'Noto Sans JP', sans-serif !important;
}
body[data-step="3"] .hide-in-wireframe { opacity: 0 !important; }

/* Broken Button Simulation */
.btn-break-sim {
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    background-color: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #991b1b !important;
}

/* --- STEP 4: TYPOGRAPHY & CONSISTENCY --- */
body:not([data-step="4"]):not([data-step="5"]):not([data-step="6"]):not([data-step="7"]) .type-sensitive {
    font-weight: 400 !important;
}

/* Step 4+ Clean up */
body[data-step="4"] .wf-element,
body[data-step="5"] .wf-element,
body[data-step="6"] .wf-element,
body[data-step="7"] .wf-element {
    background-color: transparent;
    border: none;
    color: inherit;
    border-radius: 0;
    font-family: inherit;
}

/* --- STEP 5: VISUAL HIERARCHY --- */
body:not([data-step="5"]):not([data-step="6"]):not([data-step="7"]) .icon-element {
    display: none !important;
}

/* Primary Button Style */
body[data-step="5"] #primary-action,
body[data-step="6"] #primary-action,
body[data-step="7"] #primary-action {
    background-color: #0f172a !important;
    color: white !important;
}

/* =========================================
   COACHMARKS & TOOLTIPS
   ========================================= */
.coachmark {
    position: fixed;
    z-index: 100;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    background-color: #0f172a;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 25px -3px rgba(0,0,0,0.2);
    max-width: 260px;
    line-height: 1.5;
}
.coachmark.visible { opacity: 1; transform: scale(1); }

/* Dynamic arrow placement based on data-side */
.coachmark::after { content: ''; position: absolute; width: 10px; height: 10px; background-color: #0f172a; transform: rotate(45deg); }
.coachmark[data-side="top"]::after { bottom: -5px; left: 50%; margin-left: -5px; }
.coachmark[data-side="bottom"]::after { top: -5px; left: 50%; margin-left: -5px; }
.coachmark[data-side="left"]::after { right: -5px; top: 50%; margin-top: -5px; }
.coachmark[data-side="right"]::after { left: -5px; top: 50%; margin-top: -5px; }

.hotspot-ring {
    position: absolute; border: 2px solid #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    border-radius: 6px; pointer-events: none;
    transition: all 0.5s ease; opacity: 0; z-index: 40;
}
.hotspot-ring.active { opacity: 1; }

/* Tour highlight ring */
.tour-highlight {
    outline: 3px solid rgba(99, 102, 241, 0.5);
    outline-offset: 4px;
    border-radius: 6px;
    transition: outline 0.3s;
}

/* =========================================
   UTILITIES
   ========================================= */

/* Japanese Font Tweaks */
.font-jp {
    font-family: 'Noto Sans JP', sans-serif !important;
    line-height: 1.6;
}
.font-jp .text-xs { font-size: 0.8rem; }
.font-jp .text-sm { font-size: 0.925rem; }

.progress-fill { transition: width 0.5s ease; }

.data-value { transition: color 0.3s; }
.data-value.updating { color: transparent; }

/* Modal Fixes for overflow */
.modal-card {
    max-height: 85vh;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 8rem;
}
.modal-card::-webkit-scrollbar { display: none; }

/* =========================================
   CONTROL BAR - MOBILE FIXES
   ========================================= */

/* Hide control bar during modal steps (0 and 1) */
.controls-minimized {
    transform: translateY(calc(100% + 20px)) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform 0.4s ease, opacity 0.3s ease !important;
}

/* Gradient fade above control bar on mobile */
.control-bar-fade {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(248, 250, 252, 0.85) 50%, rgba(248, 250, 252, 1) 100%);
    pointer-events: none;
    z-index: 79;
    transition: opacity 0.4s ease;
}
.control-bar-fade.fade-hidden {
    opacity: 0;
}

/* Progress bar gradient */
#progress-bar {
    background: linear-gradient(90deg, #0f172a, #4f46e5);
}

