/* styles.css - Stile Salentino per Salentix */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One:wght@400&family=Open+Sans:wght@300;400;600;700&display=swap');

:root {
    --salento-rosso: #d32f2f;
    --salento-giallo: #ffc107;
    --salento-blu: #1976d2;
    --salento-verde: #388e3c;
    --salento-arancio: #ff8f00;
    --salento-crema: #fff8e1;
    --salento-terra: #8d6e63;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, var(--salento-crema) 0%, #ffffff 50%, var(--salento-blu) 100%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
}

/* Header con stile barocco salentino */
header {
    background: linear-gradient(45deg, var(--salento-rosso), var(--salento-arancio), var(--salento-giallo));
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    color: white;
    padding: 50px 20px 70px;
    text-align: center;
    position: relative;
    z-index: 10;
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "nav logo"
        "title title"
        "subtitle subtitle";
    align-items: center;
    column-gap: 24px;
    row-gap: 18px;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="70" cy="70" r="2.5" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    animation: sparkle 15s linear infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes sparkle {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-100px) translateY(-100px); }
}

header h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 4rem;
    font-weight: 400;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
    grid-area: title;
}

header p {
    font-size: 1.4rem;
    font-weight: 300;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
    grid-area: subtitle;
}

/* Immagine hero con effetti salentini */
.hero-img {
    max-width: 220px;
    height: auto;
    border-radius: 50%;
    border: 8px solid var(--salento-giallo);
    box-shadow: 0 0 30px rgba(255, 193, 7, 0.6), 0 0 60px rgba(211, 47, 47, 0.4);
    animation: float 4s ease-in-out infinite, glow 3s ease-in-out infinite alternate;
    position: relative;
    z-index: 2;
    grid-area: logo;
    justify-self: end;
}

@keyframes float {
    0%, 100% { transform: translatey(0px) rotate(0deg); }
    25% { transform: translatey(-15px) rotate(1deg); }
    50% { transform: translatey(-10px) rotate(0deg); }
    75% { transform: translatey(-20px) rotate(-1deg); }
}

@keyframes glow {
    from { box-shadow: 0 0 30px rgba(255, 193, 7, 0.6), 0 0 60px rgba(211, 47, 47, 0.4); }
    to { box-shadow: 0 0 40px rgba(255, 193, 7, 0.8), 0 0 80px rgba(211, 47, 47, 0.6); }
}

/* Sezioni con stile mediterraneo */
section {
    padding: 80px 20px;
    position: relative;
}

section h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: var(--salento-rosso);
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
}

.creator-info {
    font-style: italic;
    color: var(--salento-blu);
    font-size: 1rem;
    margin-top: 15px;
    text-align: center;
    padding: 8px 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Card delle storie con decorazioni barocche */
.stories {
    background: linear-gradient(135deg, #ffffff 0%, var(--salento-crema) 100%);
    border-radius: 25px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.07);
    border: 3px solid var(--salento-giallo);
    position: relative;
    overflow: hidden;
}

.stories::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,193,7,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stories h2,
.stories p,
.stories button {
    position: relative;
    z-index: 2;
}

/* Bottone con stile salentino */
.btn-salentino {
    background: linear-gradient(45deg, var(--salento-rosso), var(--salento-arancio));
    border: none;
    color: white;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-salentino:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(211, 47, 47, 0.4);
    background: linear-gradient(45deg, var(--salento-arancio), var(--salento-giallo));
}

.btn-salentino::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;
}

.btn-salentino:hover::before {
    left: 100%;
}

/* Footer con motivi tradizionali */
footer {
    background: linear-gradient(135deg, var(--salento-rosso) 0%, var(--salento-terra) 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: repeating-linear-gradient(
        90deg,
        var(--salento-giallo) 0px,
        var(--salento-giallo) 20px,
        var(--salento-rosso) 20px,
        var(--salento-rosso) 40px
    );
}

footer p {
    font-size: 1rem;
    margin: 0;
    position: relative;
    z-index: 2;
}

/* Decorazioni aggiuntive */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Stile per la navigazione principale */
.main-nav {
    margin-top: 0;
    position: relative;
    z-index: 20;
    grid-area: nav;
    justify-self: start;
    align-self: start;
}

.main-nav ul {
    display: flex;
    justify-content: flex-start;
    list-style: none;
    padding: 0;
    gap: 20px;
    flex-wrap: wrap;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
    background-color: rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.main-nav a:hover, .main-nav a.active {
    background-color: var(--salento-giallo);
    color: var(--salento-rosso);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.main-nav a.active {
    font-weight: 700;
    position: relative;
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background-color: var(--salento-rosso);
    border-radius: 50%;
}

.main-nav .dropdown {
    position: relative;
    display: inline-block;
}

.main-nav .dropdown-toggle {
    cursor: pointer;
    white-space: nowrap;
}

.main-nav .arrow {
    font-size: 0.8em;
    margin-left: 6px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.main-nav .dropdown-menu {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 10px);
    min-width: 240px;
    padding: 12px;
    border-radius: 16px;
    z-index: 4000;
    background: linear-gradient(135deg, #ffffff 0%, var(--salento-crema) 100%);
    border: 2px solid var(--salento-giallo);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.main-nav .dropdown:hover .dropdown-menu,
.main-nav .dropdown:focus-within .dropdown-menu,
.main-nav .dropdown.open .dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.main-nav .dropdown:hover .arrow,
.main-nav .dropdown:focus-within .arrow,
.main-nav .dropdown.open .arrow {
    transform: rotate(180deg);
}

.main-nav .dropdown-item {
    color: #333;
    background-color: rgba(0, 0, 0, 0.04);
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.main-nav .dropdown-item:hover,
.main-nav .dropdown-item:focus {
    background-color: var(--salento-giallo);
    color: var(--salento-rosso);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    outline: none;
}

/* Responsive design */
/* Tablet: 2 colonne per il menu */
@media (min-width: 481px) and (max-width: 1023px) {
    .main-nav ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .main-nav a {
        font-size: 1rem;
        padding: 10px 15px;
        text-align: center;
    }

    .main-nav .dropdown-menu {
        position: static;
        transform: none;
        left: auto;
        top: auto;
        min-width: 100%;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    header p {
        font-size: 1.1rem;
    }
    
    .hero-img {
        max-width: 200px;
    }

    header {
        grid-template-columns: 1fr;
        grid-template-areas:
            "logo"
            "title"
            "subtitle"
            "nav";
    }

    .hero-img {
        justify-self: center;
    }

    .main-nav {
        justify-self: center;
        align-self: center;
        margin-top: 12px;
    }
    
    .main-nav ul {
        justify-content: center;
    }
    
    section {
        padding: 50px 15px;
    }
    
    section h2 {
        font-size: 2rem;
    }
    
    .stories {
        padding: 30px 20px;
        border-radius: 15px;
    }
}

/* Smartphone: 2 colonne per il menu */
@media (max-width: 480px) {
    header {
        padding: 60px 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .hero-img {
        max-width: 150px;
    }
    
    .btn-salentino {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .main-nav ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .main-nav a {
        font-size: 0.9rem;
        padding: 8px 10px;
        text-align: center;
    }

    .main-nav .dropdown-menu {
        position: static;
        transform: none;
        left: auto;
        top: auto;
        min-width: 100%;
        margin-top: 10px;
    }
}

.sx-cookie {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 2000;
}

.sx-cookie[hidden] {
    display: none !important;
}

.sx-cookie__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 248, 225, 0.95) 100%);
    border: 2px solid var(--salento-giallo);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.sx-cookie__text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #222;
    font-size: 0.98rem;
    line-height: 1.4;
}

.sx-cookie__links {
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sx-cookie__links a {
    color: var(--salento-rosso);
    font-weight: 700;
    text-decoration: none;
}

.sx-cookie__links a:hover {
    text-decoration: underline;
}

.sx-cookie__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sx-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.sx-btn:focus {
    outline: 3px solid rgba(255, 193, 7, 0.6);
    outline-offset: 2px;
}

.sx-btn--primary {
    background: var(--salento-rosso);
    color: white;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.sx-btn--ghost {
    background: rgba(0, 0, 0, 0.06);
    color: #222;
}

.sx-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.sx-cookie-open {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1999;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
    background: var(--salento-giallo);
    color: var(--salento-rosso);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.sx-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
}

.sx-cookie-modal--open {
    display: block;
}

.sx-cookie-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.sx-cookie-modal__panel {
    position: relative;
    max-width: 720px;
    margin: 6vh auto;
    background: white;
    border-radius: 18px;
    border: 3px solid var(--salento-giallo);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.sx-cookie-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, var(--salento-rosso), var(--salento-giallo));
    color: white;
}

.sx-cookie-modal__header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.sx-cookie-modal__close {
    border: 0;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.sx-cookie-modal__body {
    padding: 16px;
    color: #222;
}

.sx-cookie-option {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.sx-cookie-option__label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 520px;
}

.sx-switch {
    display: inline-flex;
    align-items: center;
}

.sx-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.sx-switch__slider {
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.15);
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sx-switch__slider::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.sx-switch input:checked + .sx-switch__slider {
    background: var(--salento-rosso);
}

.sx-switch input:checked + .sx-switch__slider::after {
    transform: translateX(20px);
}

.sx-cookie-modal__footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}

.sx-cookie-modal__links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.sx-cookie-modal__links a {
    color: var(--salento-rosso);
    font-weight: 800;
    text-decoration: none;
}

.sx-cookie-modal__links a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .sx-cookie__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .sx-cookie__actions {
        justify-content: stretch;
    }

    .sx-cookie__actions .sx-btn {
        width: 100%;
    }

    .sx-cookie-modal__panel {
        margin: 4vh 14px;
    }
}

.sx-kicker {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    color: var(--salento-rosso);
    font-weight: 800;
    letter-spacing: 0.4px;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.sx-section {
    background: rgba(255, 255, 255, 0.65);
    border-radius: 24px;
    padding: 40px 24px;
    border: 2px solid rgba(255, 193, 7, 0.35);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.sx-section + .sx-section {
    margin-top: 22px;
}

.sx-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.sx-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sx-card {
    background: white;
    border-radius: 20px;
    padding: 22px;
    border: 2px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.sx-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
}

.sx-card__title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    color: var(--salento-rosso);
    margin-bottom: 10px;
}

.sx-card__text {
    color: #555;
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
}

.sx-card__actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.sx-link-btn {
    display: inline-block;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 800;
    background: linear-gradient(45deg, var(--salento-rosso), var(--salento-arancio));
    color: white;
    box-shadow: 0 8px 20px rgba(211, 47, 47, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sx-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(211, 47, 47, 0.32);
}

.sx-link-plain {
    color: var(--salento-rosso);
    font-weight: 800;
    text-decoration: none;
}

.sx-link-plain:hover {
    text-decoration: underline;
}

.sx-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.sx-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 193, 7, 0.2);
    color: #222;
    font-weight: 800;
    border: 1px solid rgba(255, 193, 7, 0.35);
}

.sx-list {
    max-width: 860px;
    margin: 18px auto 0 auto;
    padding-left: 22px;
    color: #555;
    font-size: 1.05rem;
    line-height: 1.8;
}

.sx-friends-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.sx-friend {
    background: white;
    border-radius: 18px;
    padding: 16px;
    border: 2px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.sx-friend a {
    color: var(--salento-rosso);
    font-weight: 900;
    text-decoration: none;
    word-break: break-word;
}

.sx-friend a:hover {
    text-decoration: underline;
}

.sx-friend p {
    margin: 10px 0 0 0;
    font-size: 0.98rem;
    color: #555;
}

@media (max-width: 1023px) {
    .sx-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sx-friends-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .sx-grid,
    .sx-grid--two,
    .sx-friends-grid {
        grid-template-columns: 1fr;
    }

    .sx-section {
        padding: 28px 16px;
        border-radius: 18px;
    }
}
