/* ===========================================
   Mindergy VR — Demo Stylesheet (standalone)
   =========================================== */

:root {
    --primary-bg: #313326;
    --secondary-bg: #BDC4A1;
    --surface-bg: rgba(229, 227, 216, 0.9);
    --text-primary: #313326;
    --text-light: #E5E3D8;
    --muted-text: #70665C;
    --success-color: #4CAF50;
    --error-color: #F44336;
    --accent-color: #70665C;
    --border-color: rgba(49, 51, 38, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: var(--text-primary);
}

/* ----- Screens ----- */
.screen { display: none; min-height: 100vh; padding-top: 80px; }
.screen.active { display: block; }

#main-screen {
    background: url('../images/bg_main.jpg') center/cover no-repeat fixed,
                linear-gradient(135deg, #5a6048, #313326);
    min-height: 100vh;
}

#lobby-screen {
    background: url('../images/bg_lobby.jpg') center/cover no-repeat fixed,
                linear-gradient(135deg, #46423c, #313326);
    min-height: 100vh;
}

/* ----- Header ----- */
.header {
    background: linear-gradient(135deg, rgba(49, 51, 38, 0.95) 0%, rgba(70, 66, 60, 0.92) 50%, rgba(49, 51, 38, 0.95) 100%);
    color: var(--text-light);
    padding: 5px 25px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(189, 196, 161, 0.2);
    backdrop-filter: blur(8px);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: 80px;
}

.header-left { display: flex; align-items: center; gap: 15px; }
.header-actions { display: flex; align-items: center; gap: 15px; justify-self: end; }

.logo { display: flex; justify-content: center; align-items: center; grid-column: 2; }
.logo-image { height: 60px; width: auto; object-fit: contain; }

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    transition: all 0.3s ease;
    margin: 0 15px 0 0;
}

.icon-btn:hover { transform: translateY(-2px); }

.icon-btn::before {
    content: attr(data-hover-text);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    color: #2a2a2a;
    background: rgba(240,240,240,0.92);
    padding: 2px 6px;
    border-radius: 3px;
    transition: opacity 0.2s ease;
}

.icon-btn:hover::before { opacity: 1; }

.nav-icon {
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
    filter: brightness(0) saturate(0) invert(42%) sepia(8%) saturate(1168%) hue-rotate(68deg) brightness(95%) contrast(90%);
}

.icon-btn:hover .nav-icon { transform: scale(1.1); }

/* ----- Main Content ----- */
.main-content {
    padding: 5px 40px 40px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ----- Filters (visual only, not interactive) ----- */
.filters-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    margin: 0;
    flex-wrap: wrap;
    pointer-events: none;
}

.filter-group {
    background: var(--surface-bg);
    border-radius: 30px;
    padding: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    text-align: center;
    min-width: 512px;
}

.filter-group-title {
    font-size: 13px;
    font-weight: bold;
    color: var(--text-primary);
    padding: 0 0 5px 0;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.filter-btn {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    background: white;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    width: 80px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.filter-btn.active {
    background: #696D55;
    color: white;
    border-color: #696D55;
}

/* ----- App Tiles ----- */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.app-tile {
    background: var(--surface-bg);
    border-radius: 30px;
    cursor: default;
    transition: all 0.2s ease;
    height: 320px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    padding: 12px 8px 8px 8px;
    position: relative;
}

/* Only tutorial tile responds to hover/click */
.app-tile.tile-clickable {
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.6);
    z-index: 10;
}

.app-tile.tile-clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(76, 175, 80, 0.9);
}

.app-image {
    width: 100%;
    aspect-ratio: 1;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.app-info {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-title {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2;
    margin: 0 0 6px 0;
    min-height: 18px;
}

.app-categories-container {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.app-category {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-category-breath {
    background: rgba(76, 175, 80, 0.15);
    color: #2E7D32;
    border: 1px solid rgba(76, 175, 80, 0.3);
}
.app-category-dist {
    background: rgba(156, 39, 176, 0.15);
    color: #6A1B9A;
    border: 1px solid rgba(156, 39, 176, 0.3);
}
.app-category-games {
    background: rgba(255, 152, 0, 0.15);
    color: #E65100;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

/* ----- Tutorial Arrow ----- */
.tutorial-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    color: #FFD600;
    font-size: 18px;
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.95),
        -1px -1px 3px rgba(0, 0, 0, 0.8);
    animation: arrow-bounce 0.6s infinite alternate ease-in-out;
    pointer-events: none;
    z-index: 50;
}

.tutorial-arrow .tutorial-arrow-icon {
    margin-top: -10px;
}

.tutorial-arrow .tutorial-arrow-text {
    margin-bottom: 0;
}

.tutorial-arrow-icon {
    font-size: 180px;
    line-height: 1;
}

.tutorial-arrow-text {
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 18px;
    white-space: nowrap;
    border: 2px solid #FFD600;
}

@keyframes arrow-bounce {
    from { transform: translate(-50%, -50%); }
    to   { transform: translate(-50%, calc(-50% + 20px)); }
}

/* Back-button arrow variant (vertical, below header button) */
.header-back-wrapper { position: relative; display: inline-flex; align-items: center; }
.tutorial-arrow-back {
    top: 60px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    flex-direction: column;
    animation: arrow-bounce-vertical 1s infinite alternate ease-in-out;
}
.tutorial-arrow-back .tutorial-arrow-icon { font-size: 32px; }

@keyframes arrow-bounce-vertical {
    from { transform: translateX(-50%) translateY(0); }
    to   { transform: translateX(-50%) translateY(8px); }
}

/* ----- Lobby ----- */
.lobby-content-section {
    background: var(--surface-bg);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(5px);
    margin-bottom: 20px;
}

.lobby-top {
    display: flex;
    gap: 30px;
}

.lobby-image {
    width: 300px;
    height: 300px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    flex-shrink: 0;
}

.lobby-details { flex: 1; }

.lobby-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 15px;
    min-height: 44px;
}

.lobby-description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--muted-text);
    margin-bottom: 20px;
    min-height: 60px;
}

.lobby-info-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.info-card {
    background: rgba(206, 211, 181, 0.7);
    padding: 15px 20px;
    border-radius: 12px;
    text-align: center;
    min-width: 110px;
}

.info-label {
    font-size: 12px;
    color: var(--muted-text);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.info-value {
    font-size: 20px;
    font-weight: bold;
    min-height: 24px;
}

/* ----- Headset Selection ----- */
.lobby-headsets-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.headset-section {
    background: var(--surface-bg);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.in-use-section { width: 320px; flex-shrink: 0; }
.available-section { flex: 1; }

.section-heading {
    font-size: 18px;
    color: var(--accent-color);
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.section-heading-controls {
    justify-content: center;
    gap: 10px;
}

.headsets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

.in-use-grid { grid-template-columns: repeat(3, 1fr); }

.headset-tile {
    background: rgba(229, 227, 216, 0.7);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 2px solid transparent;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: default;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease;
}

#avail-headset-a {
    cursor: pointer;
}

#avail-headset-a.selected {
    background: rgba(76, 175, 80, 0.45);
    border-color: var(--success-color);
}

.headset-tile.ready { border-color: var(--success-color); }
.headset-tile.placeholder-tile { background: rgba(76, 175, 80, 0.25); border-color: var(--success-color); }

.headset-letter {
    width: 96px;
    height: 60px;
    background: url('../images/Headset.png') center/contain no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    color: #ffffff;
    text-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.9),
        -1px -1px 2px rgba(0, 0, 0, 0.9),
        1px -1px 2px rgba(0, 0, 0, 0.9),
        -1px 1px 2px rgba(0, 0, 0, 0.9),
        0 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

.headset-status {
    font-size: 11px;
    color: var(--muted-text);
    margin-top: 4px;
}

/* ----- Buttons ----- */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.btn-primary { background: var(--success-color); color: white; }
.btn-primary:disabled { background: #9e9e9e; cursor: not-allowed; opacity: 0.75; }
.btn-secondary { background: var(--accent-color); color: var(--text-light); }
.btn-danger { background: var(--error-color); color: white; font-size: 12px; padding: 6px 12px; }
.btn-small { font-size: 14px; padding: 10px 15px; }

/* ----- Tutorial pointer (down-pointing, for lobby) ----- */
.start-btn-wrapper {
    position: relative;
    display: inline-block;
}

.tutorial-pointer {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #FFD600;
    font-weight: bold;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.85);
    pointer-events: none;
    z-index: 200;
}

.tutorial-pointer-down {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    animation: pointer-bounce-down 1s infinite alternate ease-in-out;
}

.tutorial-pointer-text {
    background: rgba(0, 0, 0, 0.55);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
}

.tutorial-pointer-icon {
    width: 60px;
    height: 80px;
    display: block;
    color: #FFD600;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.85));
    margin-top: -4px;
}

@keyframes pointer-bounce-down {
    from { transform: translateX(-50%) translateY(0); }
    to   { transform: translateX(-50%) translateY(10px); }
}

/* ----- Splash / start screen ----- */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: linear-gradient(135deg, #313326 0%, #46423c 60%, #313326 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    transition: opacity 500ms ease;
}

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

.splash-logo {
    width: 280px;
    height: auto;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.5));
}

.splash-loading {
    color: var(--text-light);
    font-size: 18px;
    letter-spacing: 2px;
    opacity: 0.8;
    animation: splash-pulse 1.2s infinite alternate ease-in-out;
}

@keyframes splash-pulse {
    from { opacity: 0.4; }
    to   { opacity: 1; }
}

.splash-start-btn {
    padding: 18px 48px;
    border: none;
    border-radius: 14px;
    font-size: 20px;
    font-weight: bold;
    background: var(--success-color);
    color: white;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 1px;
}

.splash-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ----- Experience overlay (dim + sliding video + black fadeout) ----- */
.experience-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 300ms ease, background 300ms ease;
    overflow: hidden;
}

.experience-overlay.active {
    opacity: 1;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.7);
}

.experience-video {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(60vw, 800px);
    aspect-ratio: 16 / 9;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, 120vh);
    transition: transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.experience-overlay.video-up .experience-video {
    transform: translate(-50%, -50%);
}

.experience-video-placeholder {
    color: #444;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#experience-video-player {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    background: #000;
    display: block;
}

.experience-fadeout {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    transition: opacity 500ms ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.experience-overlay.fadeout .experience-fadeout {
    opacity: 1;
}

.thankyou-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    opacity: 0;
    transition: opacity 600ms ease 200ms;
}

.experience-overlay.fadeout .thankyou-card {
    opacity: 1;
}

.thankyou-logo {
    width: 220px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.thankyou-text {
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    text-align: center;
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
    .filter-group { min-width: 0; width: 100%; }
    .lobby-top { flex-direction: column; }
    .lobby-image { width: 100%; }
    .lobby-headsets-container { flex-direction: column; }
    .in-use-section { width: 100%; }
    .tutorial-arrow { right: -90px; }
}
