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

:root {
    --primary-color: rgb(78, 88, 185);
    --primary-gradient: linear-gradient(180deg, rgb(192, 178, 220) 0%, rgb(78, 88, 185) 100%);
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --background: #f5f5f7;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    /* App Store gradient background - colori Magic Diary */
    --app-store-gradient: radial-gradient(
    ellipse 80% 50% at 50% 120%,
    rgba(192, 178, 220, 1.0),
    hsla(0, 0%, 100%, 0)
    ),
    radial-gradient(
    ellipse 80% 70% at 90% 120%,
    rgba(120, 130, 200, 1.0),
    hsla(0, 0%, 100%, 0)
    ),
    radial-gradient(
    ellipse 100% 60% at -10% 100%,
    rgba(78, 88, 185, 1.0),
    hsla(0, 0%, 100%, 0)
    );
}

@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f5f5f7;
        --text-secondary: #a1a1a6;
        --background: #000000;
        --glass-bg: rgba(30, 30, 30, 0.7);
        --glass-border: rgba(255, 255, 255, 0.1);
        --app-store-gradient: radial-gradient(
        ellipse 80% 50% at 50% -20%,
        rgba(192, 178, 220, 0.2),
        hsla(0, 0%, 0%, 0)
        ),
        radial-gradient(
        ellipse 80% 70% at 90% 0%,
        rgba(120, 130, 200, 0.1),
        hsla(0, 0%, 0%, 0)
        ),
        radial-gradient(
        ellipse 100% 60% at -10% 0%,
        rgba(78, 88, 185, 0.15),
        hsla(0, 0%, 0%, 0)
        );
        .requirements {
                color: #86868b;
            }
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background: var(--background);
    background-image: var(--app-store-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}


/* Main Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
}

.app-icon-link {
    display: inline-flex;       /* mette icona e testo su una riga */
    align-items: center;        /* centra verticalmente */
    gap: 0.75rem;               /* spazio tra icona e nome */
    text-decoration: none;      /* rimuove sottolineatura */
    color: var(--text-primary);             /* colore del testo */
    font-weight: 600;           /* se vuoi più evidenza */
    font-size: 1rem;            /* dimensione testo */
}

.app-icon-link:hover {
    transform: scale(1.05);
}

.nav-app-icon {
    width: 40px;                /* dimensione icona */
    height: 40px;
    border-radius: 10px;        /* arrotondamento */
    object-fit: cover;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.privacy-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 15px;
    transition: opacity 0.2s ease;
}

.privacy-link:hover {
    opacity: 0.7;
}

.language-switcher {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 16px;
}

@media (prefers-color-scheme: dark) {
    .language-switcher {
        background: rgba(255, 255, 255, 0.05);
    }
    .app-icon-link {
        color: white;
    }
}

.lang-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(77, 89, 191, 0.1);
}

.lang-btn.active {
    background: var(--primary-gradient);
    color: white;
}

/* Content visibility */
.content {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.content.hidden {
    display: none;
    opacity: 0;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 100px 20px 40px;
    text-align: center;
}

.hero-content {
    margin-bottom: 60px;
}

.title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-secondary);
    font-weight: 300;
}

/* iPhone 17 Pro Max Mockup */
.phone-mockup {
    max-width: min(90vw, 360px);
    width: 100%;
    margin: 0 auto;
    perspective: 1000px;
}

@media (min-width: 768px) {
    .phone-mockup {
        max-width: 380px;
    }
}

@media (min-width: 1200px) {
    .phone-mockup {
        max-width: 400px;
    }
}

.phone-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 430 / 932;
    background: #000;
    border-radius: 50px;
    overflow: hidden;
    box-shadow:
    0 0 0 3px #1a1a1d,
    0 0 0 4px rgba(255, 255, 255, 0.1),
    0 30px 60px rgba(0, 0, 0, 0.5),
    0 15px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.phone-frame:hover {
    transform: translateY(-8px);
}

.phone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

.demo-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nav-app-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Description Section */
.description {
    margin-bottom: 80px;
}

.description p:first-of-type {
    font-style: italic;
    color: var(--text-primary);
}

.description h2 {
    font-size: 2.5rem;
    margin-bottom: 24px;
    font-weight: 700;
}

.description p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.highlight {
    color: var(--text-primary) !important;
    font-weight: 500;
}

/* Features Grid */
.features {
    margin-bottom: 80px;
}

.feature-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 40px 20px 60px;
    margin: 0 -20px;
}

.feature-grid::-webkit-scrollbar {
    display: none;
}

@media (min-width: 1024px) {
    .feature-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        overflow-x: visible;
        padding: 20px 0;
        margin: 0;
    }
}

.feature-card {
    min-width: 280px;
    flex-shrink: 0;
    scroll-snap-align: center;
    text-align: center;
    padding: 32px 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Liquid Glass effect */
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

@media (prefers-color-scheme: dark) {
    .feature-card {
        background: rgba(30, 30, 30, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

@media (min-width: 1024px) {
    .feature-card {
        min-width: auto;
    }
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow:
    0 16px 48px rgba(78, 88, 185, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

@media (prefers-color-scheme: dark) {
    .feature-card:hover {
        box-shadow:
        0 16px 48px rgba(78, 88, 185, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Example Section */
.example {
    margin-bottom: 80px;
}

.example-card {
    padding: 48px;
}

.example h2 {
    font-size: 2rem;
    margin-bottom: 24px;
    font-weight: 700;
}

.example-intro {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.story-text {
    max-width: 100%;
}

.story-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.input-label {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.description-preview-box {
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 16px;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.7;
}

.description-full-content {
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 16px;
    font-style: italic;
    color: var(--text-secondary);
}

.description-full-content p {
    margin-bottom: 16px;
    font-size: 1rem;
    line-height: 1.7;
}

.description-full-content p:last-child {
    margin-bottom: 0;
}

.description-collapsible {
    margin-bottom: 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.description-collapsible.show {
    max-height: 1000px;
    transition: max-height 0.6s ease-in;
}

.description-content {
    padding: 24px;
    background: rgba(78, 88, 185, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 8px;
    font-style: italic;
    color: var(--text-secondary);
}

.description-content p {
    margin-bottom: 16px;
    font-size: 1rem;
    line-height: 1.7;
}

.description-content p:last-child {
    margin-bottom: 0;
}

.story-intro {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1rem;
}

.description-preview {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.description-full {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

.expand-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin-bottom: 24px;
}

.expand-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 88, 185, 0.3);
}

.expand-btn.expanded {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.hidden {
    display: none;
}

.story-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 0;
    position: relative;
}

.story-divider::before,
.story-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(
    to right,
    transparent,
    var(--primary-color),
    transparent
    );
}

.magic-icon {
    font-size: 2rem;
    margin: 0 20px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.story-generated-intro {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 24px;
}

.story-generated {
    padding: 32px;
    background: rgba(78, 88, 185, 0.08);
    border-left: 4px solid var(--primary-color);
    border-radius: 12px;
    font-size: 1.05rem;
    line-height: 1.9;
}

/* CTA Section */
.cta {
    text-align: center;
    margin-bottom: 80px;
}

.app-store-button {
    display: inline-block;
    padding: 20px;
    border-radius: 28px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

.app-store-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 48px rgba(77, 89, 191, 0.3);
}

.app-store-badge {
    height: 72px;     /* grande e autorevole */
    width: auto;
    display: block;
}

.price {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
}

.requirements {
    font-size: 0.9rem;
    color: #6e6e73;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        padding: 12px 16px;
    }
    
    .nav-app-icon {
        width: 36px;
        height: 36px;
    }
    
    .nav-right {
        gap: 16px;
    }
    
    .privacy-link {
        font-size: 14px;
    }
    
    .phone-frame {
        box-shadow:
        0 0 0 3px #1a1a1d,
        0 0 0 4px rgba(255, 255, 255, 0.1);
        /* rimosso le ombre grandi */
    }
    
    .glass-card {
        padding: 24px;
    }
    
    .example-card {
        padding: 32px 24px;
    }
    .feature-card {
        min-width: auto; /* rimuove min-width fisso */
        width: 90%;      /* occupa il 90% del viewport */
        flex-shrink: 0;
        padding: 20px;   /* meno padding su mobile */
        margin: 0 auto;  /* centra la card */
        box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.08), /* ombra ridotta */
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
    
    .feature-grid {
        gap: 16px;
        padding: 30px 20px 50px; /* aumentato padding verticale */
        overflow-x: auto;
        display: flex;
        scroll-snap-type: x mandatory;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Loading optimization */
.demo-video {
    background: var(--glass-bg);
}

/* Privacy Page Styles */
.privacy-page {
    min-height: 100vh;
    padding-top: 80px;
}

.privacy-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
}

.privacy-card {
    padding: 60px 48px;
}

.privacy-card h1 {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 32px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.privacy-icon {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 32px;
}

.privacy-intro {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 48px;
    font-weight: 500;
}

.privacy-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}

.privacy-feature {
    text-align: center;
}

.privacy-feature .feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.privacy-feature h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.privacy-feature p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.privacy-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--glass-border);
}

.privacy-footer p {
    margin-bottom: 16px;
    line-height: 1.7;
}

.contact-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.contact-info a:hover {
    text-decoration: underline;
}

.last-updated {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.privacy-footer-nav {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: opacity 0.2s ease;
}

.back-link:hover {
    opacity: 0.7;
}

.privacy-link.active {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .privacy-card {
        padding: 40px 24px;
    }
    
    .privacy-card h1 {
        font-size: 2rem;
    }
    
    .privacy-intro {
        font-size: 1.1rem;
    }
    
    .privacy-features {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    /* Hero section: ridurre padding e dimensioni su mobile */
    .hero {
        padding: 80px 16px 40px;
    }
    
    .hero-content {
        margin-bottom: 40px;
    }
    
    .title {
        font-size: clamp(2.2rem, 8vw, 3.5rem);
    }
    
    .subtitle {
        font-size: clamp(1rem, 3vw, 1.4rem);
    }
    
    .phone-screen {
        /* ... */
        overflow: hidden; /* maschera il video col border-radius */
    }
    
    /* Example & Story */
    .example-card {
        padding: 24px;
    }
    
    .story-generated {
        padding: 24px;
    }
    
    .description-preview-box,
    .description-full-content {
        padding: 16px;
    }
    
    /* CTA Section: bottone più compatto */
    .app-store-button {
        padding: 16px;
    }
    
    .app-store-badge {
        height: 60px;
    }
    
    /* Footer */
    footer {
        padding: 32px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 1024px) {
    .feature-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 20px;
        gap: 16px;
    }
    
    .feature-card {
        min-width: 250px;
        padding: 24px;
    }
}
