/* ── RESET & BASE ─ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-main: #05070A;
    --bg-card: rgba(10, 15, 25, 0.65);
    --border-blue: rgba(108, 166, 255, 0.3);
    --text-primary: #FFFFFF;
    --text-secondary: #8FA3C4;
    --accent-blue: #6CA6FF;
    --accent-cyan: #00E5FF;
    --green-start: #00D98B;
    --green-end: #009B61;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { font-size: 16px; }
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* ── BACKGROUND EFFECTS ─ */
.bg-sphere-top-right {
    position: fixed;
    top: -20%;
    right: -15%;
    width: 60vw;
    height: 60vw;
    max-width: 800px;
    max-height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(0, 110, 255, 0.15) 0%, transparent 60%);
    box-shadow: inset -20px -20px 100px rgba(0, 229, 255, 0.1);
    pointer-events: none;
    z-index: -1;
}

.bg-sphere-bottom-left {
    position: fixed;
    bottom: -20%;
    left: -15%;
    width: 50vw;
    height: 50vw;
    max-width: 700px;
    max-height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(0, 57, 199, 0.12) 0%, transparent 60%);
    box-shadow: inset 20px 20px 80px rgba(0, 229, 255, 0.08);
    pointer-events: none;
    z-index: -1;
}

.bg-grid {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50vh;
    background-image:
        linear-gradient(rgba(108, 166, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(108, 166, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg) translateY(100px) scale(2);
    pointer-events: none;
    z-index: -1;
    -webkit-mask-image: linear-gradient(to top, black 0%, transparent 80%);
            mask-image: linear-gradient(to top, black 0%, transparent 80%);
}

/* ── CONTAINER ─ */
.home-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 40px);
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 4vh, 40px);
    /* ✅ VISIBLE IMMEDIATELY — no opacity:0, no fade-in delay */
}

/* ── BRANDING ─ */
.brand-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.skyline-s-logo {
    width: clamp(50px, 8vw, 72px);
    height: clamp(50px, 8vw, 72px);
    flex-shrink: 0;
    display: block;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}
.brand-subtitle {
    font-size: clamp(11px, 1.5vw, 14px);
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: clamp(2px, 0.5vw, 3px);
    margin-top: 4px;
}

/* ── HERO SECTION ─ */
.hero-section { text-align: center; margin-top: 16px; }
.main-heading {
    font-size: clamp(28px, 5vw, 56px);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 12px;
}
.supporting-desc {
    font-size: clamp(14px, 2vw, 20px);
    color: var(--text-secondary);
    font-weight: 400;
}

/* ── SEARCH CARD ─ */
.search-card {
    background: var(--bg-card);
    border: 1px solid var(--border-blue);
    border-radius: 24px;
    padding: clamp(20px, 3vw, 32px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 0 40px rgba(0, 110, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card-heading { font-size: clamp(18px, 2.5vw, 24px); font-weight: 700; color: var(--text-primary); }

.textarea-wrapper { position: relative; }

#searchInput {
    width: 100%;
    min-height: 120px;
    background: rgba(5, 7, 10, 0.4);
    border: 1px solid var(--border-blue);
    border-radius: 16px;
    padding: 16px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 16px;
    resize: vertical;
    outline: none;
}
#searchInput::placeholder { color: var(--text-secondary); opacity: 0.7; }
#searchInput:focus { border-color: var(--accent-cyan); }

.char-counter {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* ── FIND BUTTON ─ */
.find-btn {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, var(--green-start), var(--green-end));
    border: none;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 700;
    color: #050A08;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    font-family: var(--font-main);
}
.find-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 217, 139, 0.3); }

/* ── INFO CARDS (Recent/Saved) ─ */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-blue);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(12px);
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.view-all-link { color: var(--accent-cyan); text-decoration: none; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; }

/* Recent List Items — non-clickable */
.recent-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    text-decoration: none;
    border-bottom: 1px solid rgba(108, 166, 255, 0.1);
    cursor: default;
    pointer-events: none;
    user-select: none;
}
.recent-item:last-child { border-bottom: none; }
.item-icon { width: 36px; height: 36px; background: rgba(108, 166, 255, 0.1); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--accent-blue); flex-shrink: 0; }
.item-query { flex: 1; font-size: 15px; color: var(--text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Saved Section */
.saved-content { display: flex; align-items: center; gap: 20px; }
.saved-icon-box { width: 48px; height: 48px; background: rgba(108, 166, 255, 0.1); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--accent-cyan); flex-shrink: 0; }
.saved-text { flex: 1; }
.saved-desc { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.view-saved-btn {
    padding: 8px 16px;
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}
.view-saved-btn:hover { background: rgba(108, 166, 255, 0.1); }

/* Skeleton Loading */
.skeleton-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    animation: pulse 1.5s infinite ease-in-out;
}
.skeleton-icon { width: 36px; height: 36px; background: rgba(108, 166, 255, 0.1); border-radius: 8px; }
.skeleton-text { flex: 1; height: 16px; background: rgba(108, 166, 255, 0.1); border-radius: 4px; margin-top: 10px; }

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* ── FOOTER ─ */
.page-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.page-footer a { color: var(--text-secondary); text-decoration: none; font-size: 13px; }
.page-footer a:hover { color: var(--accent-cyan); }
.footer-sep { color: var(--accent-blue); opacity: 0.5; }

/* ── BOTTOM NAVIGATION ─ */
.bottom-nav {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: min(90%, 600px);
    height: 72px;
    background: rgba(10, 15, 25, 0.85);
    border: 1px solid var(--border-blue);
    border-radius: 24px;
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    /* ✅ ALWAYS VISIBLE — never hidden by JS */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    gap: 4px;
    flex: 1;
    height: 100%;
    position: relative;
    transition: color 0.2s;
}

.nav-item svg { stroke: currentColor; transition: stroke 0.2s; width: 24px; height: 24px; }
.nav-item span { font-size: 11px; font-weight: 500; }

.nav-item.active { color: var(--accent-cyan); }
.active-indicator {
    width: 16px;
    height: 3px;
    background: var(--accent-cyan);
    border-radius: 2px;
    position: absolute;
    bottom: 8px;
    box-shadow: 0 0 10px var(--accent-cyan);
}

/* ═══════════════════════════════════════════════════
   UNIVERSAL RESPONSIVENESS BREAKPOINTS
   ════════════════════════════════════════════════════ */

@media (max-width: 479px) {
    .saved-content { flex-direction: column; align-items: flex-start; gap: 12px; }
    .view-saved-btn { width: 100%; justify-content: center; }
    .bottom-nav { bottom: 12px; height: 64px; border-radius: 16px; width: 95%; }
    .nav-item svg { width: 20px; height: 20px; }
    .nav-item span { font-size: 10px; }
    .active-indicator { bottom: 6px; width: 12px; }
}

@media (min-width: 480px) and (max-width: 768px) {
    .home-container { padding: 32px 24px calc(110px + env(safe-area-inset-bottom)) 24px; }
}

@media (min-width: 769px) {
    .home-container { padding: 40px 32px calc(120px + env(safe-area-inset-bottom)) 32px; }
}

@media (min-width: 1440px) {
    .home-container { max-width: 1000px; }
    .bg-sphere-top-right { width: 50vw; height: 50vw; }
    .bg-sphere-bottom-left { width: 40vw; height: 40vw; }
    }
