/* ============================================
   Landing Page - Futuristic Glassmorphic Overhaul
   ============================================ */

/* Hide standard navbar when landing page is active */
body.landing-active .navbar {
    display: none !important;
}

body.landing-active {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--surface);
}

.landing-view {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Ambient Animated Background */
.landing-ambient-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: var(--surface);
}

/* Base grid pattern */
.landing-ambient-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(var(--border-subtle) 1px, transparent 1px),
                      linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
    z-index: 1;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.65;
    animation: orbFloat 25s infinite ease-in-out;
}

.orb-1 {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(88, 76, 244, 0.25) 0%, transparent 70%);
    top: -20%;
    left: -10%;
}

.orb-2 {
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
    bottom: -40%;
    right: -10%;
    animation-delay: -5s;
    animation-duration: 30s;
}

.orb-3 {
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    top: 40%;
    left: 20%;
    animation-delay: -10s;
    animation-duration: 20s;
}

.orb-4 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    top: -10%;
    right: 10%;
    animation-delay: -15s;
    animation-duration: 22s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(calc(var(--mouse-x, 0px) * 0.05), calc(var(--mouse-y, 0px) * 0.05)) scale(1); }
    33% { transform: translate(calc(40px + var(--mouse-x, 0px) * 0.08), calc(-60px + var(--mouse-y, 0px) * 0.08)) scale(1.1); }
    66% { transform: translate(calc(-50px + var(--mouse-x, 0px) * 0.03), calc(30px + var(--mouse-y, 0px) * 0.03)) scale(0.9); }
}

/* Top Bar */
.landing-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--on-surface);
    letter-spacing: -0.02em;
}

.landing-brand i {
    color: var(--primary);
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px var(--primary-light));
}

.landing-theme-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(var(--surface-rgb, 15, 23, 42), 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--on-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.landing-theme-btn:hover {
    background: var(--surface-variant);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--primary-light);
}

/* Container */
.landing-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
}

/* Staggered Animations */
.stagger-1 { animation: fadeInSpring 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s both; }
.stagger-2 { animation: fadeInSpring 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both; }
.stagger-3 { animation: fadeInSpring 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s both; }
.stagger-4 { animation: fadeInSpring 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.4s both; }
.stagger-5 { animation: fadeInSpring 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s both; }

@keyframes fadeInSpring {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Central Command Box */
.command-box {
    width: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2rem;
    padding: 3rem;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Subtle inner glow for command box */
.command-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    opacity: 0.8;
}

.command-box-header {
    margin-bottom: 2.5rem;
}

.command-box-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    background: var(--surface-subtle);
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--glow-primary);
}

.command-box h2.text-gradient {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.75rem;
    background: linear-gradient(135deg, var(--on-surface) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.command-box p {
    font-size: 1.1rem;
    color: var(--on-surface-secondary);
    margin: 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Universal Search Bar */
.landing-search-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.landing-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.5rem;
    padding: 0.75rem 1.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 10px 20px -5px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.landing-search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light), inset 0 2px 4px rgba(0,0,0,0.1);
    background: rgba(15, 23, 42, 0.8);
}

.landing-search-bar i {
    font-size: 1.2rem;
    color: var(--primary);
    margin-right: 1rem;
}

.landing-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--on-surface);
    font-size: 1.1rem;
    outline: none;
}

.landing-search-bar input::placeholder {
    color: var(--on-surface-tertiary);
}

.search-shortcut {
    background: var(--surface-variant);
    border: 1px solid var(--border);
    border-radius: 0.3rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    color: var(--on-surface-secondary);
    font-weight: 600;
}

/* Controls */
.command-box-controls {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    max-width: 600px;
    margin-bottom: 3rem;
}

.control-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--on-surface-tertiary);
    margin-left: 0.5rem;
}

.custom-glass-select {
    background: rgba(15, 23, 42, 0.4) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 1rem !important;
    color: var(--on-surface) !important;
    padding: 0.8rem 1.2rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    transition: var(--transition) !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1) !important;
    cursor: pointer;
    width: 100% !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.custom-glass-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px var(--primary-light) !important;
    outline: none !important;
}

/* Actions */
.command-box-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 9999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.pill-btn i {
    font-size: 1.1rem;
}

.pill-btn.primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-light);
}

.pill-btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--primary-light);
}

.pill-btn.secondary {
    background: var(--surface-elevated);
    color: var(--on-surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.pill-btn.secondary:hover {
    border-color: var(--on-surface-secondary);
    background: var(--surface-variant);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Recent Layers Panel */
.recent-layers-panel {
    width: 100%;
    max-width: 800px;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 1.5rem;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.3);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    color: var(--on-surface-secondary);
}

.badge-count {
    background: var(--surface-variant);
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    color: var(--on-surface);
    border: 1px solid var(--border);
}

.recent-layers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

/* Override existing recent layer card styles to match new aesthetic */
.recent-layer-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.recent-layer-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.2), 0 0 15px var(--primary-light);
}

.recent-layer-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-size: 1.1rem;
    color: var(--primary);
    flex-shrink: 0;
    transition: var(--transition);
}

.recent-layer-card:hover .recent-layer-icon {
    background: var(--primary-light);
    color: var(--primary);
}

.recent-layer-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.recent-layer-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
}

.recent-layer-meta {
    font-size: 0.75rem;
    color: var(--on-surface-tertiary);
    display: flex;
    gap: 0.5rem;
}

.recent-layer-badge {
    padding: 0.1rem 0.4rem;
    background: var(--surface-variant);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--on-surface-secondary);
}

.recent-layer-delete {
    background: none;
    border: none;
    color: var(--on-surface-tertiary);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
}

.recent-layer-delete:hover {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.15);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .command-box { padding: 2rem 1.5rem; }
    .command-box h2 { font-size: 1.8rem; }
    .command-box-controls { flex-direction: column; }
}

/* Light Mode Overrides */
[data-theme="light"] .command-box {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1);
}

[data-theme="light"] .landing-search-bar {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .landing-search-bar:focus-within {
    background: #ffffff;
    border-color: var(--primary);
}

[data-theme="light"] .command-box::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 1), transparent);
}

[data-theme="light"] .custom-glass-select {
    background: rgba(255, 255, 255, 0.5) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: var(--on-surface) !important;
}

[data-theme="light"] .recent-layers-panel {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .recent-layer-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .landing-theme-btn {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
