/* SeeSync Stylesheet - Premium Dark Glassmorphism */

:root {
    --bg-dark: #070a13;
    --bg-card: rgba(13, 20, 38, 0.55);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    /* Accents */
    --accent-indigo: #6366f1;
    --accent-purple: #a855f7;
    --accent-success: #10b981;
    --accent-danger: #f43f5e;
    
    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Gradients */
    --grad-primary: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-purple) 100%);
    --grad-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --grad-danger: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
    --grad-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    
    /* Fonts */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Glow Blobs */
.bg-glow-1, .bg-glow-2 {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(130px);
    z-index: -1;
    opacity: 0.45;
    pointer-events: none;
}

.bg-glow-1 {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.1) 70%);
    top: -10%;
    left: -10%;
    animation: floating-glow 25s infinite ease-in-out alternate;
}

.bg-glow-2 {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, rgba(99, 102, 241, 0.05) 70%);
    bottom: -10%;
    right: -10%;
    animation: floating-glow-reverse 20s infinite ease-in-out alternate;
}

@keyframes floating-glow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 80px) scale(1.1); }
}

@keyframes floating-glow-reverse {
    0% { transform: translate(0, 0) scale(1.1); }
    100% { transform: translate(-120px, -60px) scale(0.9); }
}

/* App Structure */
.app-container {
    width: 100%;
    max-width: 1100px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    z-index: 10;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    background: var(--grad-primary);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.logo-icon i {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

.logo-text span {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.green {
    background-color: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
}

.status-dot.red {
    background-color: var(--accent-danger);
    box-shadow: 0 0 8px var(--accent-danger);
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .4; transform: scale(1.15); }
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.35);
    transition: border-color var(--transition-normal);
}

.glass-card:hover {
    border-color: var(--border-hover);
}

/* Views Management */
.view {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* HOME CARD Layout */
.home-card {
    padding: 4rem 3rem;
    text-align: center;
    margin: auto 0;
}

.card-hero h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-hero .subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    line-height: 1.6;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
    max-width: 850px;
    margin: 0 auto;
}

.action-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
}

.panel-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.panel-divider {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-divider::before, .panel-divider::after {
    content: '';
    position: absolute;
    width: 1px;
    height: 40%;
    background: var(--border-color);
}

.panel-divider::before { top: 0; }
.panel-divider::after { bottom: 0; }

.join-input-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.input-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Buttons styling */
.btn {
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-normal);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5), 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--grad-danger);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.45);
}

/* Input Fields */
input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-family: var(--font-mono);
    text-align: center;
    letter-spacing: 0.15em;
    transition: all var(--transition-normal);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-indigo);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2), 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* SESSION CARD View Layout */
.session-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.session-info-left {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.session-code-display {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.session-code-display .label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.code-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#session-code-text {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    cursor: pointer;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.icon-btn i {
    width: 1rem;
    height: 1rem;
}

/* Pills Bar */
.session-meta-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pill-live {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.pill-timer {
    color: var(--accent-purple);
}

.pill-viewers {
    color: var(--accent-indigo);
}

.pill i {
    width: 0.9rem;
    height: 0.9rem;
}

/* Session Controls */
.session-controls {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

#view-session.is-creator .session-controls.creator-only {
    display: flex;
}

#view-session.is-viewer .session-controls.viewer-only {
    display: flex;
}

/* Toggle Switch Styles */
.toggle-wrapper {
    margin-right: 0.75rem;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.switch-label input {
    display: none;
}

.switch-slider {
    position: relative;
    display: inline-block;
    width: 2.25rem;
    height: 1.25rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    transition: background-color var(--transition-fast);
}

.switch-slider::before {
    content: "";
    position: absolute;
    height: 0.95rem;
    width: 0.95rem;
    left: 0.15rem;
    bottom: 0.15rem;
    background-color: var(--text-primary);
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.switch-label input:checked + .switch-slider {
    background-color: var(--accent-indigo);
}

.switch-label input:checked + .switch-slider::before {
    transform: translateX(1rem);
}

/* Viewer Collab Badge */
.collab-status-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0.5rem;
}

.collab-status-badge.editable {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.collab-status-badge i {
    width: 1rem;
    height: 1rem;
}

/* Shared Editor Section */
.editor-wrapper {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: border-color var(--transition-normal);
}

.editor-wrapper:focus-within {
    border-color: var(--accent-indigo);
}

textarea#shared-editor {
    width: 100%;
    min-height: 450px;
    background: transparent;
    border: none;
    resize: vertical;
    padding: 1.5rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1.6;
    outline: none;
}

textarea#shared-editor:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

#sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    color: var(--accent-success);
}

#sync-indicator i {
    width: 0.95rem;
    height: 0.95rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 100;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast.success {
    border-left: 4px solid var(--accent-success);
}

.toast.success i {
    color: var(--accent-success);
}

.toast.error {
    border-left: 4px solid var(--accent-danger);
}

.toast.error i {
    color: var(--accent-danger);
}

.toast.info {
    border-left: 4px solid var(--accent-indigo);
}

.toast.info i {
    color: var(--accent-indigo);
}

@keyframes slide-in {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Modal Overlay & Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 10, 19, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(15, 23, 42, 0.9);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    border-radius: 1.5rem;
}

.modal-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(244, 63, 94, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-danger);
}

.modal-icon i {
    width: 1.75rem;
    height: 1.75rem;
}

.modal-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Animations */
.animate-zoom {
    animation: zoom-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes zoom-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive Layout */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .app-header {
        margin-bottom: 1.5rem;
    }
    
    .home-card {
        padding: 2.5rem 1.5rem;
    }
    
    .card-hero h2 {
        font-size: 1.75rem;
    }
    
    .card-hero .subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .panel-divider {
        height: auto;
        padding: 0.5rem 0;
    }
    
    .panel-divider::before, .panel-divider::after {
        width: 40%;
        height: 1px;
    }
    
    .panel-divider::before { left: 0; top: 50%; }
    .panel-divider::after { right: 0; bottom: 50%; }
    
    .session-card {
        padding: 1.25rem;
        gap: 1.25rem;
    }
    
    .session-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .session-controls {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
    
    textarea#shared-editor {
        min-height: 350px;
        padding: 1rem;
    }
    
    .editor-footer {
    }
}

/* Light Theme Variables & Overrides */
body.light-theme {
    --bg-dark: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.7);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.15);
    
    /* Accents adapted for better light contrast */
    --accent-indigo: #4f46e5;
    --accent-purple: #9333ea;
    
    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --grad-glow: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
}

body.light-theme .bg-glow-1,
body.light-theme .bg-glow-2 {
    opacity: 0.25;
}

body.light-theme .card-hero h2 {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

body.light-theme .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--border-hover);
}

body.light-theme .status-badge {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
}

body.light-theme .pill {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .pill-live {
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-success);
}

body.light-theme .switch-slider {
    background-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .collab-status-badge {
    background: rgba(0, 0, 0, 0.04);
}

body.light-theme .collab-status-badge.editable {
    background: rgba(16, 185, 129, 0.08);
}

body.light-theme input[type="text"] {
    background: rgba(0, 0, 0, 0.02);
}

body.light-theme input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.1), 0 0 0 3px rgba(79, 70, 229, 0.15);
}

body.light-theme textarea#shared-editor {
    color: var(--text-primary);
}

body.light-theme .modal-content {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

