/* Base styles & variables */
:root {
    --white-bg: #ffffff;
    --dark-bg: #1a1a1a;
    --card-bg: #212121;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent-yellow: #ffd60a;
    --accent-pink: #ff758f;
    --accent-green: #4c9e8a;
    --border-radius: 12px;
    --card-padding: 20px;
    --spacing: 10px;
}

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

body {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--white-bg);
    color: var(--text-primary);
    padding: 10px;
    line-height: 1.6;
}

/* Container and Grid Layout */
.container {
    /*max-width: 1300px;*/
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(150px, auto);
    gap: var(--spacing);
    background-color: var(--dark-bg);
    padding: var(--spacing);
    border-radius: calc(var(--border-radius) * 2);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Card Base Styles */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: var(--card-padding);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Logo and Rating Card */
.logo-card {
    grid-column: 1 / 3;
    grid-row: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.logo-svg {
    width: 40px;
    height: 40px;
}

.rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating-number {
    font-size: 24px;
    font-weight: bold;
}

.rating-badge {
    background-color: var(--accent-yellow);
    color: var(--dark-bg);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: bold;
}

/* Headline Card */
.headline-card {
    grid-column: 1 / 3;
    grid-row: 1 / 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    background-color: white;
}

.headline-card h1 {
    font-size: 7rem;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1;
    color: black;
}

.tagline {
    font-size: 1.4rem;
    max-width: 80%;
    color: #333;
}

.emoji {
    font-style: normal;
}

.arrow-down {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: #333;
}

/* Navigation Card */
.nav-card {
    grid-column: 3 / 5;
    grid-row: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.nav-card.sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--dark-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav ul li a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--accent-yellow);
}

.dark-mode-toggle {
    width: 40px;
    height: 24px;
    background-color: #333;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
}

.toggle-circle {
    width: 18px;
    height: 18px;
    background-color: var(--accent-yellow);
    border-radius: 50%;
    position: absolute;
    top: 3px;
    transition: left 0.3s ease;
}

.toggle-circle.active {
    left: 19px;
}

/* Menu fisso per mobile */
.mobile-menu {
    position: fixed;
    top: -50px;
    left: 0;
    width: 100%;
    background-color: var(--dark-bg);
    z-index: 1000;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: top 0.3s;
}

.mobile-menu.visible {
    top: 0;
}

.mobile-menu nav {
    display: flex;
    justify-content: center;
}

.mobile-menu nav ul {
    display: flex;
    gap: 15px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.mobile-menu nav ul li a {
    color: white;
    font-size: 0.7rem;
    text-decoration: none;
    font-weight: 600;
}

body.has-mobile-menu {
    padding-top: 50px;
}

/* Camera Illustration Card */
.mouth-card {
    grid-column: 3 / 5;
    grid-row: 2 / 4;
    background-color: var(--accent-pink);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.camera-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.camera-body {
    width: 200px;
    height: 150px;
    background-color: #FF7F7F;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.camera-lens {
    width: 80px;
    height: 80px;
    background-color: #AA0000;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.lens-inner {
    width: 60px;
    height: 60px;
    background-color: #FF5555;
    border-radius: 50%;
    position: relative;
}

.lens-inner:before {
    content: "";
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: #333;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.lens-inner:after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #000;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.lens-reflection {
    width: 15px;
    height: 15px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 25%;
    left: 25%;
    opacity: 0.7;
}

.camera-flash {
    width: 30px;
    height: 20px;
    background-color: white;
    border-radius: 4px;
    position: absolute;
    top: 15px;
    right: 15px;
}

.camera-button {
    width: 30px;
    height: 10px;
    background-color: #AA0000;
    border-radius: 5px;
    position: absolute;
    top: 5px;
    right: 50px;
}

/* Animazione per il flash */
@keyframes flashAnimation {
    0% { opacity: 0; }
    25% { opacity: 0.9; }
    50% { opacity: 0; }
    100% { opacity: 0; }
}

.camera-flash-light {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid white;
    border-bottom: 30px solid transparent;
    border-top: 30px solid transparent;
    position: absolute;
    top: 10px;
    right: -20px;
    animation: flashAnimation 3s infinite;
}

/* Hire Us Card */
.hire-card {
    grid-column: 3 / 5;
    grid-row: 4;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.hire-card h2 {
    font-size: 2rem;
    font-weight: 700;
}

/* Collaborations Card */
.collab-card {
    grid-column: 3;
    grid-row: 5;
    background-color: var(--accent-yellow);
    color: var(--dark-bg);
    position: relative;
}

.collab-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.collab-dot {
    width: 10px;
    height: 10px;
    background-color: var(--dark-bg);
    border-radius: 50%;
}

.collab-logo {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.arrow-bottom-right {
    position: absolute;
    bottom: 15px;
    right: 15px;
}

/* QR Code Card */
.qr-card {
    grid-column: 4;
    grid-row: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

#qrcode {
    width: 150px;
    height: 150px;
}

.qr-text {
    font-size: 0.8rem;
    font-weight: 600;
}

/* More Cases Card */
.more-cases-card {
    grid-column: 3 / 5;
    grid-row: 6;
    position: relative;
}

.more-cases-card h3 {
    font-size: 1.5rem;
}

/* Sphere Card */
.sphere-card {
    grid-column: 1;
    grid-row: 4 / 6;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.sphere-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fixed-text-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.fixed-text {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: white;
    line-height: 1.3;
}

/* Character Card */
.character-card {
    grid-column: 2;
    grid-row: 4 / 6;
    background-color: var(--accent-green);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.character-header {
    margin-bottom: 15px;
}

.character-header h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.character-illustration {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Live Preview Card */
.preview-card {
    grid-column: 1 / 3;
    grid-row: 6;
    position: relative;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.preview-counter {
    border: 1px solid var(--text-secondary);
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 0.8rem;
}

.preview-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.preview-content {
    margin-bottom: 30px;
}

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

.live-badge {
    background-color: var(--accent-yellow);
    color: var(--dark-bg);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.chat-icon {
    width: 30px;
    height: 30px;
    background-color: var(--accent-yellow);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--dark-bg);
}

/* Responsive design */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
        margin: 0;
        width: 100%;
        max-width: none;
        border-radius: var(--border-radius);
    }
    
    .logo-card, .headline-card, .nav-card, .mouth-card, .hire-card, 
    .more-cases-card, .preview-card {
        grid-column: 1 / 3;
    }
    
    .collab-card, .qr-card, .sphere-card, .character-card {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .mobile-menu.visible {
        display: flex;
    }
    body {
        padding: 0;
    }
    
    .container {
        display: flex;
        flex-direction: column;
        border-radius: 0;
        gap: 12px;
        padding: 12px;
    }
    
    .logo-card, .headline-card, .nav-card, .mouth-card, .hire-card, 
    .collab-card, .qr-card, .more-cases-card, .sphere-card, 
    .character-card, .preview-card {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .headline-card h1 {
        font-size: 4rem;
    }
    
    .nav-card nav ul {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nav-card nav ul li a {
        font-size: 0.7rem;
    }
    
    .tagline {
        font-size: 1.1rem;
    }
    
    .card {
        padding: 15px;
        min-height: 100px;
    }
    .headline-card {
        min-height: 300px;
        display: flex;
    }
    
    .card.nav-card {
        position: sticky;
        top: 0; /* Si blocca quando raggiunge la cima della finestra */
        z-index: 10; /* Assicurati che stia sopra gli altri elementi */
    }
    /* Assicuriamo che ogni card sia completamente visibile */
    .sphere-card, .character-card {
        height: 200px;
    }
    
    .mouth-card {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .headline-card h1 {
        font-size: 3rem;
    }
    
    .tagline {
        font-size: 0.9rem;
        max-width: 100%;
    }
    
    .mouth-illustration svg, 
    .character-illustration svg, 
    .sphere-animation svg {
        width: 80%;
        height: auto;
    }
    
    /* Miglioramenti specifici per telefoni più piccoli */
    .collab-card, .qr-card {
        min-height: 180px;
    }
    
    .preview-card {
        min-height: 250px;
    }
    
    /* Assicuriamo che le immagini siano centrate */
    .mouth-illustration, 
    .character-illustration, 
    .sphere-animation {
        display: flex;
        justify-content: center;
        align-items: center;
    }
}
