/* ============================================
   LASTSITE - Main Stylesheet
   ============================================ */

:root {
    --bg-dark:       #0a0a0a;
    --accent-red:    #ff2d2d;
    --accent-glow:   rgba(255,45,45,0.4);
    --accent-blue:   #2d8fff;
    --accent-blue-g: rgba(45,143,255,0.4);
    --text-primary:  #ffffff;
    --text-secondary:#888888;
    --border:        #2a2a2a;
}

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

html {
    scroll-snap-type: y mandatory;
}

body {
    font-family: 'Space Mono', monospace;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 100px;
}

/* ---- HEADER ---- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 2rem;
    background: linear-gradient(to bottom, rgba(10,10,10,0.95), transparent);
    backdrop-filter: blur(8px);
}

.logo { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; letter-spacing: 0.1em; }
.logo-last { color: var(--text-primary); }
.logo-site { color: var(--accent-red); }

/* ---- LANGUAGE SWITCHER ---- */
.lang-switcher {
  display: flex;
    gap: 0.3rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.lang-btn {
    background: transparent;
    border: 1px solid #333;
    color: var(--text-secondary);
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s;
}
.lang-btn:hover { border-color: #666; color: #fff; }
.lang-btn.active {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* RTL support for Arabic */
[dir="rtl"] .site-header { flex-direction: row-reverse; }
[dir="rtl"] .bottom-bar  { flex-direction: row-reverse; }
[dir="rtl"] .pair-meta   { flex-direction: row-reverse; }
[dir="rtl"] .video-progress { flex-direction: row-reverse; }

/* ---- RECORD BUTTON — bottom center, fixed over scroll container ---- */
.record-btn-wrap {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    pointer-events: auto;
}

.record-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.8rem;
    background: transparent;
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 2px;
}
.record-btn:hover, .record-btn:active {
    background: var(--accent-red);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--accent-glow);
}
.record-icon {
    width: 10px; height: 10px;
    background: var(--accent-red);
    border-radius: 50%;
}
.record-btn:hover .record-icon,
.record-btn:active .record-icon { background: var(--bg-dark); }

/* ---- RECORDING OVERLAY ---- */
.record-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #000;
}
.record-overlay.hidden { display: none; }

/* Raw camera preview — full screen */
.camera-full {
    position: absolute;
    inset: 0;
}
.camera-full video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.camera-label {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.7);
    z-index: 2;
    pointer-events: none;
    background: rgba(0,0,0,0.4);
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
}

/* Screen blackout — covers camera when screen is "off" */
.screen-blackout {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 350;
    pointer-events: none; /* let touches pass through to controls below */
}
.screen-blackout.hidden { display: none; }

/* Floating close */
.floating-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 400;
}
.close-btn {
    background: rgba(0,0,0,0.6);
    border: 1px solid #666;
    color: #ccc;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    border-radius: 4px;
}
.close-btn:hover { border-color: var(--accent-red); color: var(--accent-red); }

/* ---- BOTTOM BAR — black boxes + slider ---- */
.bottom-bar {
    position: absolute;
    bottom: 2.5rem;
    left: 0; right: 0;
    z-index: 400;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.75rem;
    padding: 0 1rem;
    touch-action: none;
}

/* Black boxes — screen toggle regions */
.black-box {
    width: 72px;
    height: 80px;
    background: #000;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    flex-shrink: 0;
    cursor: pointer;
    touch-action: none;
}

/* ---- SLIDER ---- */
.slider-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    width: min(160px, 38vw);
}

.slider-label {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.65);
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    white-space: nowrap;
    text-align: center;
}

.slider-track {
    position: relative;
    width: 100%;
    height: 80px;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem;
    backdrop-filter: blur(6px);
    touch-action: none;
    user-select: none;
    overflow: visible;
}

.slider-zone-left,
.slider-zone-right {
    font-size: 0.52rem;
    letter-spacing: 0.08em;
    pointer-events: none;
    z-index: 1;
}
.slider-zone-left  { color: rgba(45,143,255,0.55); }
.slider-zone-right { color: rgba(255,45,45,0.55); }

.slider-thumb {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 3px solid rgba(255,255,255,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    z-index: 10;
    touch-action: none;
    animation: thumbPulse 2.5s ease-in-out infinite;
}
@keyframes thumbPulse {
    0%, 100% { box-shadow: 0 0 0 0    rgba(255,255,255,0.25); }
    50%       { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
}
.slider-thumb:active { cursor: grabbing; animation: none; }

.slider-thumb-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(255,255,255,0.7);
    display: block;
}

.slider-thumb.recording {
    background: var(--accent-red);
    border-color: var(--accent-red);
    box-shadow: 0 0 24px var(--accent-glow);
    animation: recordPulse 1s ease-in-out infinite;
}
@keyframes recordPulse {
    0%, 100% { box-shadow: 0 0 16px var(--accent-glow); }
    50%       { box-shadow: 0 0 32px var(--accent-glow); }
}
.slider-thumb.recording .slider-thumb-icon { background: #fff; }

.slider-thumb.switching {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 24px var(--accent-blue-g);
    animation: none;
}
.slider-thumb.switching .slider-thumb-icon { background: #fff; }

.status-msg {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.8);
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    text-align: center;
    letter-spacing: 0.04em;
    max-width: 180px;
}
.status-msg.hidden { display: none; }

/* ---- MAIN VIDEO GRID ---- */
.video-grid {
    margin-top: 80px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.video-pair {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 2rem 6rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border);
    gap: 0.75rem;
}
.pair-meta {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.meta-sep { color: #444; }
.meta-localtime { color: #aaa; font-style: italic; }
.meta-location {
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px dotted #555;
    transition: color 0.2s, border-color 0.2s;
}
.meta-location:hover { color: #fff; border-color: #fff; }

.pair-videos { display: flex; }

.video-wrap {
    position: relative;
    width: 100%;
}

.pair-video {
    width: 100%;
    max-height: 70vh;
    object-fit: cover;
    background: #111;
    border: 1px solid var(--border);
    border-radius: 4px 4px 0 0;
    display: block;
}

.video-progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.5rem;
    background: #0f0f0f;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.video-time {
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    white-space: nowrap;
    min-width: 80px;
}

.video-bar {
    flex: 1;
    height: 3px;
    background: #2a2a2a;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.video-bar:hover { height: 5px; }

.video-bar-fill {
    height: 100%;
    background: var(--accent-red);
    border-radius: 2px;
    width: 0%;
    transition: width 0.25s linear;
    pointer-events: none;
}

/* ---- EMPTY STATE ---- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 2rem;
    gap: 1rem;
    min-height: 60vh;
}
.empty-icon {
    font-size: 4rem;
    color: var(--accent-red);
    opacity: 0.4;
    line-height: 1;
}
.empty-state h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}
.empty-state p { color: var(--text-secondary); font-size: 0.85rem; }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
    .video-grid { padding: 1rem; margin-top: 70px; }
    .black-box  { width: 60px; }
}
