/**
 * ============================================================================
 * MAGIYE Main Styles
 * ============================================================================
 * 
 * Styles for the main application window (Launcher, Auth, etc.).
 * 
 * @module css/main
 */

:root {
    --bg-primary: #0a0a0a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    --accent-blue: #3b82f6;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-tertiary: rgba(255, 255, 255, 0.4);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Grid background */
.grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Container for all views */
.container {
    text-align: center;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.logo {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -2px;
    background: linear-gradient(180deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 60px rgba(255, 255, 255, 0.2);
}

/* Glass button base */
.btn-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 16px 48px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    font-family: inherit;
}

.btn-glass:hover {
    background: var(--glass-border-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.btn-glass:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Small button variant */
.btn-small {
    padding: 10px 24px;
    font-size: 13px;
}

/* Primary button accent */
.btn-primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.hint {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kbd {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* ================================================
   AUTH VIEW - Login/Signup Form
================================================ */
.auth-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 360px;
}

.auth-box {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
}

.auth-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.auth-input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.auth-input::placeholder {
    color: var(--text-tertiary);
}

.auth-submit {
    width: 100%;
    margin-top: 8px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--text-tertiary);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.auth-switch {
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-switch a {
    color: var(--accent-blue);
    text-decoration: none;
    cursor: pointer;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-error {
    color: var(--accent-red);
    font-size: 13px;
    margin-top: 12px;
    display: none;
}

.auth-error.visible {
    display: block;
}

/* ================================================
   LAUNCHER VIEW - Authenticated User
================================================ */
.launcher-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.user-email {
    color: var(--text-secondary);
    font-size: 13px;
}

.user-credits {
    color: var(--accent-green);
    font-size: 12px;
    font-weight: 500;
}

.launcher-actions {
    display: flex;
    gap: 12px;
}

.btn-logout {
    color: var(--text-secondary);
    border-color: transparent;
    background: transparent;
}

.btn-logout:hover {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
    border-color: transparent;
}

/* ================================================
   VIEW VISIBILITY
================================================ */
.hidden {
    display: none !important;
}

/* Loading spinner */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ================================================
   VIDEO MODAL
================================================ */
.video-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out);
    backdrop-filter: blur(10px);
}

.video-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.video-container {
    width: 90%;
    max-width: 1000px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    position: relative;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 101;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}