/* CSS Variables for Light and Dark Mode */
:root {
    --bg-color: #ffffff; /* Colori per il tema chiaro */
    --text-color: #1a1a1a;
    /* Use relative path (no leading slash) and separate image var */
    --hero-bg-image: url('../img/backgroundpic.jpg'); /* Corretto il percorso relativo */
    /* no overlay: keep transparent so only the image shows */
    --hero-overlay: transparent;
    --card-bg: #ffffff;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --accent-color: #000000; /* Cambiato da #FF4A0A a nero */
    --footer-bg: #2b2b2b;
    --input-bg: #ffffff;
    --input-border: #d0d0d0;
    color-scheme: light dark;
}
/* Add local font file for Komu */
@font-face {
    font-family: 'Komu';
    src: url('../../fonts/komu_a-webfont.svg#komua') format('svg'),
         url('../../fonts/komu-a.woff2') format('woff2'),
         url('../../fonts/komu-a.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
} 

/* Add local font files */
@font-face {
    font-family: 'Erbaum Black';
    src: url('../../fonts/erbaum-black.woff2') format('woff2'),
         url('../../fonts/erbaum-black.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Add local font files for Winner Sans Comp (regular + bold) */
@font-face {
    font-family: 'Winner Sans Comp';
    src: url('../../fonts/winner-sans-comp.woff2') format('woff2'),
         url('../../fonts/winner-sans-comp.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Winner Sans Comp';
    src: url('../../fonts/winner-sans-comp-bold.woff2') format('woff2'),
         url('../../fonts/winner-sans-comp-bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

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

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Aggiungi un font di fallback per i paragrafi per una migliore leggibilità */
p {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    transition: background 0.3s ease;
}

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

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #000000 !important; /* Mantenuto nero come richiesto */
}

.logo i {
    margin-right: 10px;
    color: var(--accent-color);
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    color: #000000 !important; /* Cambiato da bianco a nero */
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.hamburger {
    display: none !important; /* Nascosto perché non c'è menu */
    background: none;
    border: none;
    color: #000000 !important; /* Cambiato da bianco a nero */
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: 2rem;
}

.nav-menu li:last-child {
    margin-left: 2rem;
}

.nav-menu li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu li a:hover {
    color: var(--accent-color);
}

.nav-instagram {
    color: #000000 !important; /* Cambiato da bianco a nero */
    text-decoration: none;
    font-size: 1.5rem;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.nav-instagram:hover {
    color: var(--accent-color);
}

/* Language Select */
#language-select {
    /*margin-left: 1rem;*/
    background: rgba(255, 255, 255, 0.1) !important; /* Mantenuto trasparente */
    border: 1px solid rgba(255, 255, 255, 0.3) !important; /* Mantenuto trasparente */
    border-radius: 25px;
    color: #000000 !important; /* Cambiato da bianco a nero */
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path d="M6 8L2 4h8z" fill="black"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 30px;
    transition: background 0.3s ease;
    min-width: 60px;
    text-align: right;
    padding-left: 15px; /* Aggiunto per bilanciare */
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    height: 2.2em; /* Aumenta l'altezza in modo proporzionale al font */
    position: relative;
    bottom: 3px; /* Sposta leggermente il testo verso il basso per un centraggio visivo */
}

#language-select:hover {
    background-color: rgba(255, 255, 255, 0.2) !important; /* Cambiato da grigio chiaro a bianco trasparente */
}

#language-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5); /* Cambiato da bianco a nero */
}

/* Hero Section - Modern Design */
.hero {
    min-height: calc(100vh - 80px); /* Tiene conto dell'header fisso */
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 2rem 20px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: -5%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: -5%;
    animation-delay: 2s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 50%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding-top: 4rem; /* Aggiunto spazio in alto per abbassare il contenuto */
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-badge i {
    color: #ffd700;
}

.hero-texts h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    background: linear-gradient(45deg, #fff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-texts p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 500;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cta-button.primary {
    background: linear-gradient(45deg, #ffd700, #ffb347);
    color: #1a1a1a;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-button.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 215, 0, 0.4);
}

.cta-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-button.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-mockup {
    position: relative;
    width: 300px;
    height: 600px;
    background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 8px solid #333;
}

.phone-mockup::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 25px;
    background: #1a1a1a;
    border-radius: 15px;
    z-index: 3;
}

.phone-screen {
    position: absolute;
    top: 50px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
}

.app-interface {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.search-bar {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.search-bar i {
    color: rgba(255, 255, 255, 0.8);
}

.search-bar span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.product-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    border-radius: 10px;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.product-price {
    color: #667eea;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
}

.product-store {
    color: #666;
    font-size: 0.8rem;
}

/* Features Section */
.features {
    padding: 80px 0;
    background: var(--bg-color);
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    z-index: 1;
}

.features .container {
    position: relative;
    z-index: 2;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.feature-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.6;
}

/* How It Works Section */
.how-it-works {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
}

.steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 250px;
}

.step-number {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.step-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.step-content p {
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.6;
}

.step-arrow {
    color: #667eea;
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.search h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
}

.search h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 10px auto;
    border-radius: 2px;
}

.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
    flex-wrap: wrap;
}

#search-input {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--input-border);
    border-radius: 25px;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-color);
    min-width: 200px;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.scan-button {
    padding: 15px 30px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.scan-button:hover {
    background: #333; /* Cambiato da #e55a2b a grigio scuro */
}

#camera-container {
    margin-top: 2rem;
}

#camera {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
}

#capture-btn {
    margin-top: 1rem;
    padding: 10px 20px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#results {
    margin-top: 2rem;
    font-size: 1.2rem;
    color: var(--text-color);
}

/* Autocomplete Styles */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--input-border);
    transition: background 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.autocomplete-content strong {
    display: block;
    color: var(--text-color);
    font-weight: 600;
}

.autocomplete-content small {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Local Product Results Styles */
.product-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.product-header h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.5rem;
}

.product-main-image {
    max-width: 150px;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.product-brands {
    color: var(--text-color);
    opacity: 0.8;
    font-style: italic;
}

.local-results {
    display: grid;
    gap: 1rem;
}

.local-results h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.store-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
}

.store-result:hover {
    transform: translateY(-2px);
}

.store-info h5 {
    margin: 0 0 0.5rem 0;
    color: var(--accent-color);
    font-size: 1.1rem;
}

.store-address {
    color: var(--text-color);
    opacity: 0.8;
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
}

.store-distance {
    color: var(--text-color);
    opacity: 0.6;
    margin: 0;
    font-size: 0.8rem;
}

.product-availability {
    text-align: right;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0 0 0.5rem 0;
}

.stock-status {
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    font-weight: 500;
}

.stock-status.in-stock {
    color: #28a745;
}

.stock-status.low-stock {
    color: #ffc107;
}

.add-to-cart-btn {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .store-result {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .product-availability {
        text-align: center;
    }

    .autocomplete-dropdown {
        max-height: 200px;
    }
}

.location-button {
    padding: 10px 20px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 1rem;
}

.location-button:hover {
    background: #333; /* Cambiato da #e55a2b a grigio scuro */
}

.supermarkets-list {
    margin-top: 2rem;
    text-align: left;
}

.supermarkets-list h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.supermarkets-list ul {
    list-style: none;
    padding: 0;
}

.supermarkets-list li {
    background: var(--card-bg);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.supermarkets-list li strong {
    color: var(--accent-color);
}

/* Sections */
section {
    padding: 60px 0; /* Ridotto da 80px per diminuire spazio tra sezioni */
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 10px auto;
    border-radius: 2px;
}

h3 {
    font-size: 2rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.service-card h3 {
    margin: 2rem 0 0.5rem; /* Riduci margin-bottom per bilanciare con h4 */
}

.service-card h4 {
    margin-bottom: 1rem; /* Mantieni per simmetria con h3 */
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.about-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.about-text h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.about-text p {
    font-size: 1.1rem; /* Aumentato da 1rem a 1.1rem */
    margin-bottom: 1.5rem;
    color: var(--text-color);
    opacity: 0.9;
    text-align: center;
    max-width: 800px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: block;
    line-height: 1.5; /* Aggiunto per migliorare la leggibilità */
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.service-card i {
    color: var(--accent-color);
    font-size: 3rem; /* Aumentato da 2rem a 4rem per renderle almeno il doppio più grandi */
    margin-bottom: 1rem;
}

.service-card p {
    opacity: 0.8; /* Riduce la luminosità del testo senza renderlo grigio */
}

.service-card.full-width {
    grid-column: 1 / -1;
}

/* Kill-switch: niente bordi/outline/overlay su card (anche se è un <a>) */
.service-card,
a.service-card,
.service-card a {
	-webkit-tap-highlight-color: transparent !important;
	border: 0 !important;
	border-color: transparent !important;
	outline: 0 !important;
	text-decoration: none !important;
}

/* Stati interattivi: niente ring/overlay in Safari */
.service-card:hover,
.service-card:focus,
.service-card:focus-visible,
.service-card:focus-within,
.service-card:active,
a.service-card:hover,
a.service-card:focus,
a.service-card:focus-visible,
a.service-card:active {
	border: 0 !important;
	border-color: transparent !important;
	outline: 0 !important;
	background: inherit !important;
	background-image: none !important;
	box-shadow: 0 15px 40px rgba(0,0,0,0.4) !important; /* Aumentato da var(--card-shadow) per effetto hover più visibile */
}

/* Rimuovi eventuali pseudo-elementi usati come overlay di hover */
.service-card::before,
.service-card::after {
	content: none !important;
	display: none !important;
}

.service-card.main-message h3 {
    font-size: 1.5rem;
}

/* Gallery Section */
#gallery {
    padding-top: 10px; /* Ridotto da 60px */
    padding-bottom: 10px; /* Ridotto da 60px */
}

#gallery h2 {
    margin-bottom: 1.5rem; /* Ridotto da 3rem */
}

.carousel {
    width: min(90vw, 100%);
    position: relative;
    margin: 0 auto;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image {
    position: relative;
    margin-bottom: 2rem;
    border-radius: 0; /* Rimuovi border-radius per evitare effetto tagliato */
    overflow: hidden;
    box-shadow: none; /* Rimuovi ombra */
    background: transparent; /* Rimuovi sfondo */
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#main-img {
    width: 100%;
    height: 80vh; /* Imposta altezza fissa per mantenere dimensioni costanti */
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
    background: transparent; /* Rimuovi background grigio per evitare bande */
}

.carousel-control {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.carousel-control.prev {
    left: 1.5rem;
}

.carousel-control.next {
    right: 1.5rem;
}

.carousel-control i {
    font-size: 1.25rem;
}

.carousel-control:hover,
.carousel-control:focus-visible {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.05);
}

.carousel-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-top: 5px;
    flex-shrink: 0;
}

.info-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    margin-left: 0; /* Remove extra indent for better alignment */
}

.info-item p {
    color: var(--text-color);
    opacity: 0.8;
    text-align: left; /* Ensure left alignment */
    margin: 0;
}

.info-item a {
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.8;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.info-item a:hover {
    color: var(--accent-color);
    opacity: 1;
}

.contact-form {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 1rem;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--input-bg);
    color: var(--text-color);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.contact-form button {
    width: 100%;
    padding: 15px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.contact-form button:hover {
    background: #333; /* Cambiato da #e55a2b a grigio scuro */
}

.contact-map {
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.contact-map iframe {
    width: 100%;
    height: 450px;
    border: none;
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: #fff;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.footer-section p {
    color: #ccc;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: #ccc;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #555;
    color: #ccc;
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #5a67d8, #6b46c1);
}

/* Enhanced Focus States */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

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

/* Enhanced Button Styles */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-button::before {
    content: '';
    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;
}

.cta-button:hover::before {
    left: 100%;
}

/* Glassmorphism Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Shadows */
.shadow-soft {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.shadow-medium {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.shadow-strong {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Apply animations on scroll */
.hero-badge {
    animation: fadeInUp 0.8s ease-out;
}

.hero-texts h1 {
    animation: fadeInLeft 0.8s ease-out 0.2s both;
}

.hero-texts p {
    animation: fadeInLeft 0.8s ease-out 0.4s both;
}

.hero-stats {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-actions {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.hero-visual {
    animation: fadeInRight 0.8s ease-out 0.4s both;
}

.section-header {
    animation: fadeInUp 0.8s ease-out;
}

.feature-card {
    animation: fadeInUp 0.8s ease-out;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

.step {
    animation: fadeInUp 0.8s ease-out;
}

.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.3s; }
.step:nth-child(3) { animation-delay: 0.5s; }

/* Hero Responsive */
@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: 6rem 20px 2rem; /* Aumentato padding-top per compensare la navbar trasparente */
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
        padding-top: 2rem; /* Ridotto su mobile */
    }

    .hero-texts h1 {
        font-size: 2.5rem;
    }

    .hero-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .cta-button.primary,
    .cta-button.secondary {
        width: 100%;
        justify-content: center;
    }

    .phone-mockup {
        width: 250px;
        height: 500px;
    }

    .steps-container {
        flex-direction: column;
        gap: 1rem;
    }

    .step-arrow {
        transform: rotate(90deg);
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-texts h1 {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .phone-mockup {
        width: 200px;
        height: 400px;
    }

    .section-header h2 {
        font-size: 2.2rem;
    }

    .hero {
        padding: 5rem 20px 2rem; /* Leggermente ridotto su schermi molto piccoli */
    }
}

/* Modal Styles */
.modal {
    display: none !important;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

#privacy-toggle:checked ~ #privacy-modal {
    display: block !important;
}

.modal-content {
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 5% auto;
    padding: 50px 20px 20px 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 60%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: var(--card-shadow);
    position: relative;
}

.close {
    color: var(--text-color);
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    float: none;
}

.close:hover,
.close:focus {
    color: var(--accent-color);
}

#privacy-link {
    cursor: pointer;
    text-decoration: underline;
    color: #ccc;
    transition: color 0.3s ease;
}

#privacy-link:hover {
    color: var(--accent-color);
}

#manage-cookies-link {
    cursor: pointer;
    text-decoration: underline;
    color: #ccc;
    transition: color 0.3s ease;
}

#manage-cookies-link:hover {
    color: var(--accent-color);
}

/* Cookie Consent Banner Styles */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--footer-bg);
    color: #fff;
    padding: 20px;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    display: none; /* Hidden by default, shown via JS */
}

.cookie-consent-content p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.cookie-consent-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.btn-accept {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn-accept:hover { background: #333; } /* Cambiato da #e55a2b a grigio scuro */

.btn-reject {
    background: #666;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-reject:hover { background: #555; }

.btn-customize {
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-customize:hover {
    background: #fff;
    color: var(--footer-bg);
}

h1, h2, h3, h4, h5, h6, 
.nav-menu li a,
.cta-button {
    font-family: 'Roboto', sans-serif;
    letter-spacing: 0px;
    /* headings should use normal weight */
    font-weight: 400;
}

.line-break-text {
    white-space: pre-line !important;
    display: block !important;
    text-align: center !important;
}

/* Global: force Roboto everywhere and remove uppercase
   Keep existing font-size rules intact (we do NOT change any font-size). */
html, body,
h1, h2, h3, h4, h5, h6,
p, a, span, li, label, small, strong, em,
input, textarea, button, select, option,
.nav-menu li a, .cta-button, .service-card, .footer-section, .cookie-consent-content,
.hero-subtitle, .info-item, .contact-form, .footer-bottom {
    font-family: 'Roboto', sans-serif !important;
    text-transform: none !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure form placeholders and select/options are normal case */
input::placeholder,
textarea::placeholder {
    text-transform: none !important;
    font-family: 'Roboto', sans-serif !important;
}

select, option {
    font-family: 'Roboto', sans-serif !important;
    text-transform: none !important;
}

/* Buttons (including cookie banner buttons) */
button, .cta-button {
    font-family: 'Roboto', sans-serif !important;
    text-transform: none !important;
}

/* Keep hero content readable: don't change sizes or spacing here (only normal case) */
#home.hero .hero-content,
.hero h1,
.hero-subtitle {
    /* sizes preserved; only enforce font + normal case */
    font-family: 'Roboto', sans-serif !important;
    text-transform: none !important;
}

/* Make hero texts responsive and allow wrapping (prevent cutting on mobile) */
#home.hero .hero-texts {
    max-width: 92vw;               /* limit width to viewport */
    width: min(900px, 92%);        /* keep reasonable max on large screens */
    overflow: visible !important;  /* avoid being clipped when absolutely positioned */
    white-space: normal !important;/* allow wrapping */
    word-break: break-word;        /* break long words if needed */
    hyphens: auto;                 /* allow hyphenation for better wrap */
    padding: 0 1rem;               /* breathing room on edges */
}

/* Allow headings/subtitle to wrap and scale on small screens */
#home.hero .hero-texts h1,
#home.hero .hero-texts .hero-subtitle,
.hero h1,
.hero-subtitle {
    white-space: normal !important;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.15;
}

/* Cart Indicator */
.cart-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: var(--accent-color);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 1rem;
    position: relative;
}

.cart-indicator:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cart-indicator i {
    font-size: 1.1rem;
}

.cart-count {
    background: #fff;
    color: var(--accent-color);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    position: absolute;
    top: -8px;
    right: -8px;
    border: 2px solid var(--bg-color);
}

/* Cart Animation */
.cart-animation-ball {
    position: fixed;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    z-index: 3000;
    pointer-events: none;
    animation: flyToCart 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes flyToCart {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: translate(calc(var(--delta-x) * 0.3), calc(var(--delta-y) * 0.3 - 40px)) scale(1.1) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translate(calc(var(--delta-x) * 0.6), calc(var(--delta-y) * 0.6 - 30px)) scale(0.9) rotate(180deg);
        opacity: 0.9;
    }
    75% {
        transform: translate(calc(var(--delta-x) * 0.85), calc(var(--delta-y) * 0.85 - 10px)) scale(0.7) rotate(270deg);
        opacity: 0.6;
    }
    100% {
        transform: translate(var(--delta-x), var(--delta-y)) scale(0) rotate(360deg);
        opacity: 0;
    }
}

/* Cart Notification */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Cart Modal */
.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.cart-modal {
    background: var(--bg-color);
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--input-border);
    background: var(--card-bg);
}

.cart-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.5rem;
}

.close-cart {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-cart:hover {
    background: rgba(0, 0, 0, 0.1);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    max-height: 400px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--input-border);
    transition: background 0.2s ease;
}

.cart-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.cart-item-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-color);
    font-size: 1rem;
}

.cart-item-store {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.85rem;
    margin: 0 0 0.25rem 0;
}

.cart-item-price {
    color: var(--accent-color);
    font-weight: 600;
    margin: 0;
    font-size: 0.9rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quantity-btn {
    background: var(--accent-color);
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #333;
    transform: scale(1.1);
}

.quantity {
    font-weight: bold;
    min-width: 30px;
    text-align: center;
    color: var(--text-color);
}

.remove-btn {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.remove-btn:hover {
    background: #c82333;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--input-border);
    background: var(--card-bg);
}

.cart-total {
    text-align: center;
    margin-bottom: 1rem;
}

.cart-total strong {
    font-size: 1.3rem;
    color: var(--accent-color);
}

.cart-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.clear-cart-btn {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.clear-cart-btn:hover {
    background: #5a6268;
}

.checkout-btn {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Settings Button */
.settings-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    color: #667eea !important;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    position: relative;
}

.settings-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: #667eea;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.settings-btn:active {
    transform: scale(0.95) rotate(90deg);
}

/* Settings Modal */
.settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.settings-modal {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 25px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    box-shadow: 0 25px 60px rgba(102, 126, 234, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.2);
    animation: slideUp 0.4s ease;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.settings-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.settings-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.settings-header h2::before {
    content: '⚙';
    font-size: 1.5rem;
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.close-settings {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.close-settings:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.settings-content {
    padding: 1.5rem;
    flex: 1;
    background: #ffffff;
    overflow-y: auto;
    max-height: calc(85vh - 180px);
}

.settings-content::-webkit-scrollbar {
    width: 6px;
}

.settings-content::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
}

.settings-content::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 10px;
}

.settings-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #5a67d8, #6b46c1);
}

.setting-group {
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.setting-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.6rem;
    font-size: 1rem;
}

.setting-group label::before {
    content: '●';
    font-size: 0.5rem;
    color: #764ba2;
}

.setting-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    font-size: 0.95rem;
    background: #ffffff;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.setting-group select:hover {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.setting-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.setting-description {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-top: 0.6rem;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(102, 126, 234, 0.3);
}

.settings-footer {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-shrink: 0;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.save-settings-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    padding: 12px 35px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.save-settings-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.save-settings-btn:hover::before {
    left: 100%;
}

.save-settings-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.save-settings-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* Responsive settings modal */
@media (max-width: 768px) {
    .settings-modal {
        width: 95%;
        margin: 20px;
    }

    .settings-content {
        padding: 1rem;
    }

    .settings-header,
    .settings-footer {
        padding: 1rem;
    }
}

/* Settings input field for radius */
.setting-group input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    font-size: 0.95rem;
    background: #ffffff;
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.setting-group input[type="number"]:hover {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.setting-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Custom select styling */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.custom-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.custom-select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    font-size: 0.8rem;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.custom-select-wrapper:focus-within .custom-select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Chains container and toggle switches */
.chains-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.chain-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chain-toggle:hover {
    border-color: #667eea;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.chain-toggle.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
}

.chain-name {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chain-name::before {
    content: '🏪';
    font-size: 1rem;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    border-radius: 24px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.toggle-switch.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(20px);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.4);
}