/* Posizione: /assets/css/public.css */

:root {
    --primary-color: #e63946;
    --secondary-color: #457b9d;
    --accent-color: #06d6a0;
    --dark: #1d3557;
    --light: #f1faee;
    --gray: #6c757d;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
}

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

/* Navbar */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--primary-color);
}
.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    gap: 20px;
}
.navbar-logo img { max-height: 55px; width: auto; }
.navbar-logo h1 { font-size: 22px; color: var(--primary-color); }
.navbar-controls { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }

.year-selector select {
    padding: 8px 12px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    background: white;
    color: var(--dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.year-selector select:hover { background: var(--primary-color); color: white; }

.live-selector { display: flex; gap: 8px; flex-wrap: wrap; }

.live-btn {
    padding: 6px 14px;
    border: 2px solid var(--secondary-color);
    border-radius: 6px;
    background: white;
    color: var(--dark);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 65px;
}
.live-btn span { font-size: 10px; color: var(--gray); margin-top: 2px; }
.live-btn:hover, .live-btn.active { background: var(--secondary-color); color: white; }
.live-btn.active span { color: white; }

/* Main */
.main-content { padding: 30px 20px; }

/* Two column */
.two-column-grid { display: grid; grid-template-columns: 1fr; gap: 25px; margin-bottom: 25px; }
@media (min-width: 1024px) { .two-column-grid { grid-template-columns: 1fr 1fr; } }

/* Hero */
.hero-section {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    overflow: hidden;
}
.hero-content { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 768px) { .hero-content { grid-template-columns: 1fr 400px; } }
.hero-text { padding: 25px; }
.hero-text h1 { font-size: 26px; color: var(--primary-color); margin-bottom: 10px; }
.event-date { font-size: 15px; color: var(--secondary-color); margin-bottom: 12px; font-weight: 600; }
.event-description { font-size: 13px; color: var(--gray); line-height: 1.6; }
.hero-image {
    position: relative; min-height: 200px; background: var(--light);
    display: flex; align-items: center; justify-content: center;
}
.hero-image img.event-img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: opacity 0.3s; }
.hero-image img.event-img:hover { opacity: 0.95; }

/* Sections */
section { margin-bottom: 25px; }
section h2 {
    font-size: 18px; color: var(--dark); margin-bottom: 18px;
    padding-bottom: 8px; border-bottom: 3px solid var(--primary-color); position: relative;
}
section h2::after {
    content: ''; position: absolute; bottom: -3px; left: 0;
    width: 50px; height: 3px; background: var(--accent-color);
}

/* Streaming */
.streaming-section { background: white; padding: 22px; border-radius: 12px; box-shadow: var(--shadow); }
.streaming-links { display: flex; flex-direction: column; gap: 10px; }

.streaming-link-wrapper {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s;
}
.streaming-link-wrapper:hover { transform: translateX(5px); box-shadow: var(--shadow-lg); }

.streaming-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    flex: 1;
}
.streaming-link .platform-icon { font-size: 24px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.streaming-link .platform-name { font-size: 14px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.1); }

.streaming-link-actions {
    display: flex;
    gap: 6px;
    padding: 0 10px;
    align-items: center;
}

.copy-link-btn, .embed-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    padding: 5px 9px;
    transition: background 0.2s;
    white-space: nowrap;
}
.copy-link-btn:hover, .embed-btn:hover { background: rgba(255,255,255,0.2); }
.copy-link-btn.copied { background: rgba(6,214,160,0.4); }

/* Altimetria */
.altimetria-section { background: white; padding: 22px; border-radius: 12px; box-shadow: var(--shadow); }
.altimetria-img { width: 100%; height: auto; border-radius: 8px; box-shadow: var(--shadow); cursor: zoom-in; }

/* Modal immagine */
.modal {
    display: none; position: fixed; z-index: 10000; inset: 0;
    background: rgba(0,0,0,.95); align-items: center; justify-content: center;
}
.modal-content { max-width: 95%; max-height: 95%; object-fit: contain; border-radius: 8px; }
.modal-close {
    position: absolute; top: 20px; right: 35px;
    color: white; font-size: 40px; font-weight: bold; cursor: pointer;
}
.modal-close:hover { color: var(--accent-color); }

/* Modal embed */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 10001;
    background: rgba(0,0,0,.7); align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: white; border-radius: 12px; padding: 28px;
    max-width: 540px; width: 95%; position: relative;
}
.modal-box h3 { margin-bottom: 16px; font-size: 18px; color: var(--dark); }
.modal-close-btn {
    position: absolute; top: 14px; right: 18px;
    background: none; border: none; font-size: 24px; cursor: pointer; color: #666;
}
.dim-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dim-row label { width: 80px; font-weight: 500; }
.dim-row input { width: 100px; padding: 6px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.iframe-code-box {
    background: #f4f4f4; border-radius: 6px; padding: 12px;
    font-family: monospace; font-size: 12px; word-break: break-all; margin-top: 12px;
}
.copy-code-btn {
    display: block; margin-top: 10px; padding: 8px 18px;
    background: var(--primary-color); color: white; border: none;
    border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.copy-code-btn:hover { background: #d62839; }

/* Calendario */
.calendar-section { background: white; padding: 16px 22px; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 25px; }
.calendar-section h2 { margin-bottom: 14px; }
.calendar-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.cal-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 7px; text-decoration: none;
    font-size: 13px; font-weight: 600; color: white;
    transition: all 0.2s; cursor: pointer; border: none;
}
.cal-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.cal-btn.google  { background: #4285F4; }
.cal-btn.apple   { background: #555; }
.cal-btn.outlook { background: #0078D4; }

/* Brochures */
.brochures-section { background: white; padding: 22px; border-radius: 12px; box-shadow: var(--shadow); }
.brochures-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
@media (min-width: 769px) {
    .brochures-grid { grid-template-columns: repeat(2, 1fr); }
    .brochures-grid.has-1-items { grid-template-columns: 1fr; }
    .brochures-grid.has-3-items { grid-template-columns: repeat(3, 1fr); }
}
.brochure-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 16px; background: var(--light); border: 2px solid var(--secondary-color);
    border-radius: 8px; text-decoration: none; color: var(--dark);
    transition: all 0.3s; font-size: 12px; text-align: center;
}
.brochure-card:hover { background: var(--secondary-color); color: white; transform: translateY(-3px); }
.pdf-icon { font-size: 30px; }

/* Links */
.links-section { background: white; padding: 22px; border-radius: 12px; box-shadow: var(--shadow); }
.organization-list { list-style: none; }
.organization-list li { border-bottom: 1px solid var(--light); padding: 12px 0; }
.organization-list li:last-child { border-bottom: none; }
.organization-list a {
    color: var(--accent-color); text-decoration: none; font-weight: 500;
    font-size: 14px; display: flex; align-items: center; transition: all 0.3s;
}
.organization-list a::before { content: '→'; margin-right: 10px; transition: transform 0.3s; }
.organization-list a:hover { color: var(--primary-color); padding-left: 5px; }
.organization-list a:hover::before { transform: translateX(5px); }

/* Sponsors */
.sponsors-section { background: white; padding: 22px; border-radius: 12px; box-shadow: var(--shadow); }
.sponsors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 15px; align-items: center; }
@media (min-width: 769px) {
    .sponsors-grid { grid-template-columns: repeat(4, 1fr); }
    .sponsors-grid.has-1-items { grid-template-columns: repeat(1, 1fr); max-width: 200px; }
    .sponsors-grid.has-2-items { grid-template-columns: repeat(2, 1fr); }
    .sponsors-grid.has-3-items { grid-template-columns: repeat(3, 1fr); }
    .sponsors-grid.has-5-items { grid-template-columns: repeat(5, 1fr); }
    .sponsors-grid.has-6-items { grid-template-columns: repeat(3, 1fr); }
}
.sponsor-card {
    display: flex; align-items: center; justify-content: center;
    padding: 14px; background: white; border: 2px solid var(--light);
    border-radius: 8px; transition: all 0.3s; text-decoration: none;
    color: var(--dark); min-height: 90px;
}
.sponsor-card:hover { border-color: var(--primary-color); transform: scale(1.05); box-shadow: var(--shadow); }
.sponsor-card img { max-width: 100%; max-height: 65px; object-fit: contain; }
.sponsor-card-clickable { cursor: zoom-in; }
/* Sottosezioni sponsor */
.sponsors-subsection-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.9px;
    color: #999; font-weight: 700; margin: 22px 0 10px;
    padding-bottom: 6px; border-bottom: 1px solid #f0f0f0;
}
.sponsors-section h2 + .sponsors-subsection-title,
.sponsors-section h2 + .sponsors-subsection-spacer + .sponsors-grid,
.sponsors-section h2 + .sponsors-grid { margin-top: 0; }
.sponsors-subsection-spacer { margin-top: 10px; }

/* Share */
.share-section { background: white; padding: 22px; border-radius: 12px; box-shadow: var(--shadow); text-align: center; }
.share-buttons { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.share-btn {
    padding: 9px 18px; border-radius: 7px; text-decoration: none;
    color: white; font-weight: 600; transition: all 0.3s; font-size: 12px;
}
.share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.share-btn.facebook { background: #1877f2; }
.share-btn.twitter  { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.telegram { background: #0088cc; }
.share-btn.email    { background: var(--gray); }

/* Footer */
.footer { background: var(--dark); color: white; padding: 25px 20px; margin-top: 40px; font-size: 13px; }

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
    justify-content: space-between;
}
.footer-col { flex: 1; min-width: 200px; }
.footer-copy { margin: 0 0 6px; }
.footer-links { margin: 0; }
.footer-links a,
.footer-links a:visited { color: #06d6a0; text-decoration: underline; cursor: pointer; }
.footer-upcoming { flex: 1.4; min-width: 240px; }
.footer-upcoming-title {
    font-weight: 700;
    margin: 0 0 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #06d6a0;
}
.footer-upcoming-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.footer-upcoming-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    transition: color .15s;
}
.footer-upcoming-list a:hover { color: #06d6a0; }
.footer-live-date { white-space: nowrap; font-size: 12px; opacity: .65; }

/* Disclaimer */
.disclaimer-container { margin-top: 30px; margin-bottom: 10px; }
.disclaimer-area {
    width: 100%;
    height: 110px;
    font-size: 11px;
    line-height: 1.55;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 14px;
    resize: none;
    overflow-y: scroll;
    font-family: inherit;
    display: block;
}

/* Cookie Banner */
#cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 99999;
    background: #1d3557;
    color: #f1faee;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 -4px 20px rgba(0,0,0,.25);
    font-size: 13px;
    line-height: 1.5;
}
#cookie-banner p { margin: 0; flex: 1; min-width: 220px; }
#cookie-banner a { color: #06d6a0; text-decoration: underline; cursor: pointer; }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }
.cookie-btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity .2s;
    white-space: nowrap;
}
.cookie-btn:hover { opacity: .85; }
.cookie-btn-accept { background: #06d6a0; color: #1d3557; }
.cookie-btn-reject { background: transparent; color: #f1faee; border: 1px solid rgba(255,255,255,.4); }

/* Privacy Modal */
#privacy-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,.75);
    align-items: center;
    justify-content: center;
}
#privacy-modal.open { display: flex; }
.privacy-box {
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.privacy-header { padding: 22px 28px 16px; border-bottom: 1px solid #e9ecef; flex-shrink: 0; }
.privacy-header h2 { font-size: 20px; color: #1d3557; margin: 0; }
.privacy-body {
    padding: 20px 28px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.7;
    color: #495057;
    flex: 1;
}
.privacy-body h3 { font-size: 15px; color: #1d3557; margin: 20px 0 6px; }
.privacy-body h3:first-child { margin-top: 0; }
.privacy-footer { padding: 14px 28px; border-top: 1px solid #e9ecef; text-align: right; flex-shrink: 0; }
.privacy-close-x {
    position: absolute;
    top: 16px; right: 20px;
    background: none; border: none;
    font-size: 24px; cursor: pointer; color: #6c757d;
}
.privacy-close-btn {
    padding: 8px 22px;
    background: #1d3557;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.privacy-close-btn:hover { background: #e63946; }

/* Responsive */
@media (max-width: 768px) {
    .navbar-content { flex-direction: column; align-items: stretch; }
    .navbar-logo { text-align: center; margin-bottom: 12px; }
    .navbar-controls { flex-direction: column; width: 100%; }
    .year-selector, .live-selector { width: 100%; justify-content: center; }
    .hero-content { grid-template-columns: 1fr !important; }
    .hero-text { padding: 20px; }
    .hero-text h1 { font-size: 22px; }
    .hero-image { min-height: 250px; }
    .sponsors-grid, .brochures-grid { grid-template-columns: 1fr !important; }
    .share-buttons { flex-direction: column; }
    .share-btn { width: 100%; }
    .streaming-link-actions { padding: 0 6px; gap: 4px; }
    .copy-link-btn, .embed-btn { font-size: 11px; padding: 4px 6px; }
    .calendar-buttons { flex-direction: column; }
    .cal-btn { justify-content: center; }
    .modal-close { top: 10px; right: 20px; font-size: 35px; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .main-content { padding: 20px 12px; }
    .streaming-section, .altimetria-section, .brochures-section,
    .links-section, .sponsors-section, .share-section, .calendar-section { padding: 18px 15px; }
}
