/* 
 * Codice Amico - Stile principale
 * Autore: Codice Amico Team
 * Versione: 1.0
 * Data: 2025-05-19
 */

/* ===== VARIABILI E IMPOSTAZIONI GENERALI ===== */
:root {
    --primary-color: #0c1a42;
    --bs-link-color: #0c1a42;
    --secondary-color: #6c757d;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #2d3748;
    --body-color: #f8f9fa;
    --text-color: #333;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    background-color: var(--body-color);
    line-height: 1.6;
}

/* ===== UTILITÀ ===== */
.z-index-1 {
    z-index: 1;
}

.object-fit-cover {
    object-fit: cover;
}

/* Rimuove la sottolineatura e imposta colore specifico solo su <a> */
a.text-decoration-none {
    text-decoration: none !important;
    color: #0c1a42 !important;
}

a.text-decoration-none:hover {
    text-decoration: none !important;
    color: #0d6efd !important;
}

/* ===== HEADER ===== */
.navbar {
    padding: 0.75rem 0;
}

.navbar-brand img {
    max-height: 40px;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

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

/* ===== HERO SECTION ===== */
.hero-section {
    background-image: url('../img/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    padding: 5rem 0;
    position: relative;
}

/* Forza testo bianco nella hero, anche per titoli, sottotitoli, badge e bottoni */
.hero-section,
.hero-section .text-white,
.hero-section .display-5,
.hero-section .lead,
.hero-section .fw-bold,
.hero-section .badge,
.hero-section .btn,
.hero-section #hero-promo-content {
    color: #fff !important;
}
.hero-section .badge {
    background-color: rgba(0,0,0,0.25) !important;
    color: #fff !important;
}
.hero-section .btn-outline-light {
    color: #fff !important;
    border-color: #fff !important;
}
.hero-section .btn-outline-light:hover {
    background-color: #fff !important;
    color: #0a58ca !important;
}


.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

/* ===== CARDS ===== */
.card {
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

/* ===== CATEGORY CARDS ===== */
.category-card .card {
    transition: var(--transition);
}

.category-card:hover .card {
    border-color: var(--primary-color);
}

.category-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border-radius: 50%;
    background-color: rgba(78, 115, 223, 0.1);
}

/* ===== STEP ICONS ===== */
.step-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* ===== BADGES ===== */
.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    border-radius: 50rem;
}

/* ===== BUTTONS ===== */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #3a5ccc;
    border-color: #3a5ccc;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ===== BACK TO TOP BUTTON ===== */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* ===== NEWSLETTER SECTION ===== */
.newsletter-section {
    background-color: var(--primary-color);
}

/* ===== FOOTER ===== */
footer {
    background-color: var(--dark-color);
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--primary-color);
}

/* ===== PROMOZIONE SINGOLA ===== */
.promo-header {
    background-color: var(--light-color);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.promo-content {
    margin-bottom: 2rem;
}

.promo-sidebar {
    position: sticky;
    top: 100px;
}

.code-box {
    background-color: var(--light-color);
    border: 1px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.code-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    letter-spacing: 1px;
    user-select: all;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    margin-bottom: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2rem;
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 767.98px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .card-img-top {
        height: 150px;
    }
    /* Nasconde solo l'immagine principale della promozione su mobile */
    .promotion-detail-page .card-body img.me-3 {
        display: none !important;
    }
    /* Migliora i bottoni della hero su mobile */
    .hero-section #hero-buttons .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    .hero-section #hero-buttons .btn + .btn {
        margin-left: 0;
    }
}


/* ===== ANIMAZIONI ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --body-color: #1a202c;
        --text-color: #f8f9fa;
        --light-color: #2d3748;
    }
    
    .card, .navbar {
        background-color: #2d3748 !important;
        color: #f8f9fa;
    }
    
    .card-body, .card-footer {
        background-color: #2d3748 !important;
        color: #f8f9fa;
    }
    
    .text-dark {
        color: #f8f9fa !important;
    }
    
    .bg-white, .bg-light {
        background-color: #2d3748 !important;
    }
    
    .text-white-50 {
        color: rgba(248, 249, 250, 0.5) !important;
    }
    
    .nav-link {
        color: #f8f9fa;
    }
    
    .form-control {
        background-color: #4a5568;
        border-color: #4a5568;
        color: #f8f9fa;
    }
    
    .form-control::placeholder {
        color: #cbd5e0;
    }
}

/* ===== OTTIMIZZAZIONI SEO ===== */
/* Nasconde il testo per i lettori di schermo ma lo mantiene per i motori di ricerca */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== ACCESSIBILITÀ ===== */
:focus {
    outline: 3px solid rgba(78, 115, 223, 0.5);
    outline-offset: 2px;
}

/* Stile per l'indice dei contenuti */
.toc {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.toc-title {
    margin-bottom: 1rem;
    font-weight: 700;
}

.toc-list {
    list-style-type: none;
    padding-left: 0;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list a {
    color: var(--primary-color);
    text-decoration: none;
}

.toc-list a:hover {
    text-decoration: underline;
}

/* Stile per i tag */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50rem;
    background-color: var(--light-color);
    color: var(--text-color);
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--transition);
}

.tag:hover {
    background-color: var(--primary-color);
    color: white;
}
