/* ============================================
   InstaWatch — CSS Design System
   ============================================ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-surface: #1a1a25;
    --bg-surface-hover: #22222f;
    --text-primary: #e8e8ed;
    --text-secondary: #8888a0;
    --text-muted: #555568;
    --accent: #a855f7;
    --accent-glow: rgba(168, 85, 247, 0.3);
    --accent-hover: #c084fc;
    --border: rgba(255, 255, 255, 0.06);
    --radius: 12px;
    --radius-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Landing Page
   ============================================ */

.landing {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.08) 0%, transparent 60%),
        var(--bg-primary);
}

.landing-container {
    width: 100%;
    max-width: 560px;
    padding: 2rem;
    text-align: center;
}

/* Logo */
.logo-area {
    margin-bottom: 2.5rem;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 0 40px var(--accent-glow);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 30px var(--accent-glow); }
    50% { box-shadow: 0 0 50px var(--accent-glow), 0 0 80px rgba(168, 85, 247, 0.15); }
}

.logo-area h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
    margin-top: 0.5rem;
}

/* URL Form */
.url-form {
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    gap: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group:focus-within {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.input-group input {
    flex: 1;
    padding: 0.9rem 1.1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.4rem;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: white;
    border: none;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.input-group button:hover {
    opacity: 0.9;
}

.btn-icon {
    font-size: 0.8rem;
}

/* Hint */
.hint {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.hint code {
    background: var(--bg-surface);
    padding: 0.2em 0.5em;
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* ============================================
   Player Page
   ============================================ */

.player-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.player-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-container video {
    max-width: 100%;
    max-height: 100vh;
    outline: none;
}

/* Back link */
.back-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
    z-index: 100;
    opacity: 0.6;
}

.back-link:hover {
    color: var(--text-primary);
    background: rgba(10, 10, 15, 0.9);
    opacity: 1;
}

.back-icon {
    font-size: 1rem;
}

/* Error state */
.error-state {
    text-align: center;
    padding: 2rem;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.error-state h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.error-state p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.retry-link {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.retry-link:hover {
    opacity: 0.9;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 600px) {
    .landing-container {
        padding: 1.5rem;
    }

    .logo-area h1 {
        font-size: 1.6rem;
    }

    .input-group {
        flex-direction: column;
        border-radius: var(--radius);
    }

    .input-group button {
        justify-content: center;
        border-top: 1px solid var(--border);
    }
}
