/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-image: url('Italian_background.webp');
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    background-color: #f8f9fa;
    overflow-x: hidden;
    /* Optimize for CLS */
    font-display: swap;
}

/* Fallback for browsers that don't support WebP */
@supports not (background-image: url('data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=')) {
    body {
        background-image: url('Italian_background.jpg');
    }
}

/* Ensure images don't cause layout shift */
img {
    height: auto;
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    --logo-zoom: 4;
    background: #0a0a0a;
    color: white;
    padding: 0.8rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    overflow: hidden;
    height: 70px;
    /* Optimize paint */
    will-change: transform;
    transform: translateZ(0);
}

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

.logo-img {
    height: 45px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    filter: brightness(1.1) contrast(1.05);
    transition: transform 0.3s cubic-bezier(.4,2,.6,1);
    transform: scale(var(--logo-zoom));
    will-change: transform;
    display: block;
    margin: 0 auto;
}

/* Hero Section */
.hero {
    background: rgba(255, 231, 231, 0.1);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 10vh;
    padding: 80px 0 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(97, 92, 92, 0.3);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-bottom: 0;
    margin-bottom: 0;
}

.hero-headline {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.hero-headline .highlight {
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Dynamic Viewer Count */
.viewer-count-video {
    text-align: center;
    font-size: 1rem;
    color: #111;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 500;
    width: 100%;
    max-width: 100%;
    display: block;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.viewer-count-video .live-indicator {
    display: inline-block;
    margin-right: 4px;
    animation: pulse 2s infinite;
}

.viewer-count-video #viewer-number {
    font-weight: 700;
    color: #ffd700;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

/* VSL Section */
.vsl-section {
    padding: 20px 0 30px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.vsl-container-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    width: 100%;
    max-width: 800px;
    height: 0;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    cursor: pointer;
}

/* Lazy Loading Video Styles */
.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.video-placeholder:hover {
    transform: scale(1.02);
}

.play-button {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.play-button:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

/* Video Note Section - Discrete text below video */
.video-note-section {
    padding: 10px 0 20px;
    background: transparent;
}

.video-note {
    text-align: right;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.prefer-text-link {
    display: inline-block;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.prefer-text-link:hover {
    color: #333;
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.vsl-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    border: none;
}

/* Brand Proof Section */
.brand-proof {
    padding: 40px 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    text-align: center;
}

/* TSL Content Section Styles */
.tsl-section {
    padding: 40px 0;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.tsl-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    line-height: 1.8;
}

.tsl-content h2,
.tsl-content h3,
.tsl-content h4 {
    font-family: 'Playfair Display', serif;
    color: #333;
}

.tsl-content p {
    margin-bottom: 1.5rem;
    color: #444;
    font-size: 1.1rem;
}

.tsl-content ul {
    margin-left: 1rem;
    margin-bottom: 1.5rem;
}

.tsl-content li {
    margin-bottom: 0.5rem;
    color: #444;
}

.brand-proof h2 {
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    color: #333;
    margin-bottom: 3rem;
    font-weight: 600;
}

.brand-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.brand-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border-radius: 15px;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-height: 120px;
}

.tv-logo {
    max-width: 100%;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* CTA Section */
.cta {
    padding: 100px 0;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-align: center;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
    pointer-events: none;
}

.cta.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cta.hide {
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
}

/* TSL Page - Always show CTA */
.tsl-page .cta {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 2;
}

.cta-content h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.cta-content p {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    margin-bottom: 3rem;
    opacity: 0.9;
}

.pricing {
    margin: 2rem 0 3rem;
}

.price-old {
    font-size: 1.2rem;
    text-decoration: line-through;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.price-new {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 0.5rem;
}

.price-installments {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 2rem;
}

/* Buy Button */
.btn-buy {
    display: inline-block;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 1.2rem 3rem;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin: 2rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    /* Optimize for interaction */
    will-change: transform;
}

.btn-buy:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.btn-buy:active {
    transform: translateY(-1px);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-buy:hover .btn-shine {
    left: 100%;
}

.guarantee {
    margin-top: 2rem;
    font-size: 1.1rem;
}

.guarantee span {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    display: inline-block;
}

.security {
    margin-top: 1rem;
}

.security span {
    opacity: 0.8;
    font-size: 1rem;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 1rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
}

.hero > .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 180px;
    height: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
        background-position: center center;
        background-size: cover;
    }
    
    .brand-icons {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .brand-icon {
        padding: 1.5rem;
        min-height: 100px;
    }
    
    .viewer-count-video {
        font-size: 0.9rem;
        margin-bottom: 12px;
        padding: 0 10px;
    }
    
    .btn-buy {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
    
    .video-note {
        text-align: center;
        padding: 0 15px;
    }
    
    .prefer-text-link {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    .tsl-content {
        padding: 20px;
        margin: 0 10px;
    }
    
    .tsl-content h2 {
        font-size: 1.8rem !important;
    }
    
    .tsl-content h3 {
        font-size: 1.5rem !important;
    }
    
    .tsl-content p {
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    body {
        background-attachment: scroll;
        background-size: 120% auto;
        background-position: center top;
    }
    
    .logo-img {
        height: 35px;
        max-width: 220px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 75px 0 10px;
    }
    
    .hero > .container {
        min-height: auto;
        height: auto;
    }
    
    .viewer-count-video {
        font-size: 0.8rem;
        margin-bottom: 10px;
        padding: 0 5px;
    }
    
    .vsl-section {
        padding: 15px 0 60px;
    }
    
    .brand-proof {
        padding: 40px 0 60px;
    }
    
    .brand-proof h2 {
        margin-bottom: 1.5rem;
    }
    
    .cta {
        padding: 60px 0;
    }
    
    .brand-icons {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .btn-buy {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        width: 90%;
    }
    
    .header {
        height: 55px;
    }
    
    .tsl-content {
        padding: 15px;
        margin: 0 5px;
    }
    
    .tsl-content h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .tsl-content h3 {
        font-size: 1.3rem !important;
        margin: 1.5rem 0 0.8rem 0 !important;
    }
    
    .tsl-content p {
        font-size: 0.95rem !important;
        margin-bottom: 1.2rem !important;
    }
}

@media (max-width: 320px) {
    body {
        background-size: 140% auto;
        background-position: center top;
    }
}

/* Animation Utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content,
.vsl-container-center,
.brand-proof,
.cta-content {
    animation: fadeInUp 0.8s ease;
}

.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-animate.active {
    opacity: 1;
    transform: translateY(0);
}

/* Accessibility and Performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch devices optimization */
@media (hover: none) and (pointer: coarse) {
    .video-placeholder:hover,
    .play-button:hover,
    .btn-buy:hover {
        transform: none;
        box-shadow: initial;
    }
    
    /* Optimize touch targets */
    .btn-buy {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Print styles */
@media print {
    .header,
    .footer,
    .btn-buy {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero::before {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .cta::before {
        background: rgba(0, 0, 0, 0.9);
    }
} 