/* -----------------------------------------------------------------
 * Style System for FamilyBot
 * Theme: Warm Modern, Cyber-Home (Deep Slate, Sunset Orange, Coral, Gold)
 * ----------------------------------------------------------------- */

:root {
    --bg-dark: #090b0f;
    --bg-card: rgba(22, 27, 38, 0.7);
    --bg-card-hover: rgba(30, 37, 51, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary: #ff6f3c; /* Sunset Orange */
    --primary-glow: rgba(255, 111, 60, 0.4);
    
    --coral: #ff4a5a;
    --gold: #ffb400;
    --gold-glow: rgba(255, 180, 0, 0.3);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Globals */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #1f2937;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Background Ambient Canvas & Glowing Orbs */
#ambient-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 6rem 0;
    position: relative;
}

/* Navigation Header */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

#main-header.scrolled {
    background-color: rgba(9, 11, 15, 0.85);
    backdrop-filter: blur(12px);
    border-color: var(--border-color);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.75rem;
}

.logo-img {
    height: 40px;
    width: 40px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.logo-text .highlight {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.btn-github {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-github:hover {
    background: var(--text-primary);
    color: var(--bg-dark);
    border-color: var(--text-primary);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.mobile-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Hero Section */
.hero-section {
    padding-top: 10rem;
    padding-bottom: 6rem;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.badge {
    background: rgba(255, 111, 60, 0.1);
    border: 1px solid rgba(255, 111, 60, 0.3);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--coral) 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 550px;
}

.hero-buttons {
    display: flex;
    gap: 1.25rem;
}

.btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--coral) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(255, 111, 60, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 111, 60, 0.5);
}

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

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

.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-main-img {
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
}

.glow-under-image {
    position: absolute;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: 1;
    filter: blur(40px);
}

/* Sections Shared Headers */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.sub-title {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.75rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.section-desc {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* Time Slider Card */
.slider-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    backdrop-filter: blur(10px);
    max-width: 850px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.slider-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.slider-header h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.slider-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.slider-container {
    margin-bottom: 2rem;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.year-label {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

.pct-label {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 0 15px var(--gold-glow);
}

/* Range Input Styling */
#time-range-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: #1f2937;
    outline: none;
    margin-bottom: 1rem;
}

#time-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 15px var(--primary-glow);
    transition: transform 0.1s;
}

#time-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.timeline-ticks {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.slider-explanation {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

/* Features Use Cases Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-8px);
    border-color: rgba(255, 111, 60, 0.2);
    box-shadow: 0 15px 35px rgba(255, 111, 60, 0.08);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.school-icon {
    background: rgba(255, 111, 60, 0.1);
    color: var(--primary);
}

.insurance-icon {
    background: rgba(255, 74, 90, 0.1);
    color: var(--coral);
}

.bills-icon {
    background: rgba(255, 180, 0, 0.1);
    color: var(--gold);
}

.chat-icon {
    background: rgba(255, 111, 60, 0.1);
    color: var(--primary);
}

.video-icon {
    background: rgba(255, 74, 90, 0.1);
    color: var(--coral);
}

.vault-icon {
    background: rgba(255, 180, 0, 0.1);
    color: var(--gold);
}

.domotica-icon {
    background: rgba(255, 111, 60, 0.1);
    color: var(--primary);
}

.viaggi-icon {
    background: rgba(255, 74, 90, 0.1);
    color: var(--coral);
}


.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-list {
    list-style: none;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.card-list li {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-list li::before {
    content: "✓";
    color: var(--primary);
    font-weight: bold;
}

/* Dashboard Mockup */
.dashboard-mockup {
    background: #0d0f14;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    max-width: 950px;
    margin: 0 auto;
}

.dash-topbar {
    background: #141822;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.dash-circles {
    display: flex;
    gap: 8px;
}

.dash-circles span {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dash-circles span:nth-child(1) { background: #ff5f56; }
.dash-circles span:nth-child(2) { background: #ffbd2e; }
.dash-circles span:nth-child(3) { background: #27c93f; }

.dash-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

.dash-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

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

.status-indicator-dot.online {
    background: #27c93f;
    box-shadow: 0 0 8px #27c93f;
}

.dash-body {
    display: grid;
    grid-template-columns: 200px 1fr;
    height: 420px;
}

.dash-sidebar {
    background: #0f121a;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-item:hover, .sidebar-item.active {
    background: rgba(255, 111, 60, 0.08);
    color: var(--primary);
}

.dash-content {
    padding: 1.5rem 2rem;
    overflow-y: auto;
}

.dash-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
}

.color-gold {
    color: var(--gold);
}

.stat-lbl {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-list-container h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    transition: var(--transition);
}

.task-item-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.task-bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.task-bullet.completed { background: #27c93f; }
.task-bullet.running { background: var(--gold); animation: pulse 1.5s infinite; }
.task-bullet.pending { background: var(--text-muted); }

.task-info h5 {
    font-size: 0.85rem;
    font-weight: 600;
}

.task-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.task-status-tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.task-status-tag.completed {
    background: rgba(39, 201, 63, 0.15);
    color: #27c93f;
}

.task-status-tag.running {
    background: rgba(255, 180, 0, 0.15);
    color: var(--gold);
}

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

/* Chat Section */
.chat-wrapper {
    max-width: 750px;
    margin: 0 auto;
}

.chat-suggestions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn-suggest {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-suggest:hover {
    background: rgba(255, 111, 60, 0.08);
    border-color: var(--primary);
    color: var(--text-primary);
}

.chat-window {
    background: #0d0f14;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    height: 480px;
}

.chat-header {
    background: #141822;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.chat-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: contain;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.chat-info h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
}

.chat-status {
    font-size: 0.75rem;
    color: #27c93f;
}

.chat-messages {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    max-width: 80%;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
}

.msg-bubble {
    padding: 0.9rem 1.2rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.message.bot .msg-bubble {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-top-left-radius: 4px;
}

.message.user .msg-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, var(--coral) 100%);
    color: white;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(255, 111, 60, 0.2);
}

.chat-input-area {
    padding: 1rem 1.5rem;
    background: #141822;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.chat-input-area input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
}

.chat-input-area button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Download Section (CTA) */
.download-section {
    padding-bottom: 8rem;
}

.download-card {
    background: linear-gradient(135deg, rgba(30, 37, 51, 0.9) 0%, rgba(22, 27, 38, 0.9) 100%);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 4rem 3rem;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.download-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, var(--primary-glow) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.download-card h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.download-card p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
    font-size: 1.05rem;
    position: relative;
    z-index: 2;
}

.download-buttons {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.btn-large {
    padding: 1.1rem 2.5rem;
    font-size: 1.1rem;
}

/* Footer styling */
footer {
    background: #06070a;
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.footer-logo img {
    height: 25px;
    width: 25px;
}

.footer-logo span {
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: 0.5px;
    font-size: 1rem;
}

.footer-left p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-right {
    text-align: right;
}

.footer-right p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

/* Media Queries (Responsive Styling) */
@media (max-width: 968px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-content {
        align-items: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .dash-body {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .dash-sidebar {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        overflow-x: auto;
        padding: 0.8rem;
    }
    
    .sidebar-item {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none; /* Mobile navigation toggle state handles this */
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--bg-dark);
        border-bottom: 1px solid var(--border-color);
        padding: 2rem;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .nav-menu.open {
        display: flex;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .hero-content h1 {
        font-size: 2.6rem;
    }
    
    .slider-card {
        padding: 2rem 1.5rem;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-right {
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}
