/* Variabili colori */
:root {
    --azzurro-cielo: #00BFFF;
    --rosa-bubblegum: #FF69B4;
    --verde-lime: #BFFF00;
    --blu-navy: #191970;
    --grigio-chiaro: #E5E5E5;
}

/* Reset e stili base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'VT323', monospace;
    background-color: var(--grigio-chiaro);
    color: var(--blu-navy);
    line-height: 1.6;
    font-size: 24px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--azzurro-cielo), var(--blu-navy));
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    max-width: 100px;
    max-height: 100px;
}

.title {
    font-size: 2.4rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.line {
    width: 30px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.4s;
}

/* Main content */
main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Sezione Agenti */
.agents-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.agent-item a,
.agent-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.agent-item a:hover {
    transform: scale(1.1);
}

.agent-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.agent-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--blu-navy);
}

/* Sezioni AI */
.ai-sections-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.ai-section {
    margin-bottom: 0;
    padding: 1rem;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--blu-navy);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, var(--azzurro-cielo), var(--rosa-bubblegum));
    margin: 0.5rem auto;
    border-radius: 2px;
}

/* Tabelle */
.table-container {
    overflow-x: auto;
}

.ai-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.ai-table th,
.ai-table td {
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.ai-table th {
    background-color: var(--blu-navy);
    color: white;
    font-weight: 600;
    font-size: 1.8rem;
    padding: 1.2rem;
}

/* Stili per le intestazioni ordinabili */
.ai-table th.sortable {
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ai-table th.sortable:hover {
    background-color: rgba(0, 191, 255, 0.8);
}

.ai-table th.sortable::after {
    content: '⇅';
    display: inline-block;
    margin-left: 5px;
    font-size: 0.8em;
    opacity: 0.7;
}

.ai-table th.sorted {
    background-color: rgba(0, 191, 255, 0.9);
}

.ai-table th.sorted::after {
    content: '↓';
    opacity: 1;
}

.ai-table td {
    font-size: 1.5rem;
    padding: 1rem;
}

.ai-table td:first-child {
    text-align: left;
}

/* Stili per le righe delle tabelle in base alla nazionalità */

.usa {
    background-color: rgba(0, 191, 255, 0.1);
}

.china {
    background-color: rgba(255, 105, 180, 0.1);
}

.france {
    background-color: rgba(191, 255, 0, 0.1);
}

.other {
    background-color: rgba(25, 25, 112, 0.05);
}

/* Logo AI */
.ai-logo {
    width: 30px;
    height: 30px;
    margin-right: 0.5rem;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.ai-table td a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-table td a:hover .ai-logo {
    transform: scale(1.1);
}

/* Sezione Vibe Challenge */
.vibe-challenge-section {
    margin-bottom: 3rem;
    padding: 2rem 0;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

/* Footer */
.footer {
    background-color: var(--blu-navy);
    color: white;
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.copyright {
    font-size: 1.1rem;
}

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

.youtube-icon {
    width: 30px;
    height: 30px;
    fill: white;
    transition: transform 0.3s ease;
}

.youtube-link:hover .youtube-icon {
    transform: scale(1.2);
    fill: var(--rosa-bubblegum);
}

/* Stili per la sezione Vibe Challenge */

.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#challenge-search {
    padding: 0.8rem;
    border: 2px solid var(--blu-navy);
    border-radius: 5px 0 0 5px;
    width: 70%;
    font-size: 1rem;
    outline: none;
}

#search-button {
    padding: 0.8rem 1.5rem;
    background-color: var(--blu-navy);
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#search-button:hover {
    background-color: var(--rosa-bubblegum);
}

.challenge-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 2rem;
    margin: 0 auto;
    max-width: 1400px;
}

.challenge-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    width: calc(33.33% - 1.33rem);
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid var(--blu-navy);
    transition: transform 0.3s, box-shadow 0.3s;
}

.challenge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.challenge-header {
    text-align: center;
    margin-bottom: 1rem;
    width: 100%;
}

.challenge-header h3 {
    color: var(--blu-navy);
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
}

.challenge-type {
    color: var(--rosa-bubblegum);
    font-weight: 600;
    margin: 0;
}

.challenge-divider {
    height: 2px;
    background-color: #eaeaea;
    width: 100%;
    margin: 1rem 0;
}

.challenge-prompt {
    width: 100%;
    text-align: center;
}

.prompt-toggle {
    background-color: var(--blu-navy);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.prompt-toggle:hover {
    background-color: var(--rosa-bubblegum);
}

.prompt-content {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 5px;
    text-align: left;
}

.hidden {
    display: none;
}

.challenge-ranking {
    width: 100%;
    text-align: center;
}

.challenge-ranking h4 {
    color: var(--blu-navy);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.ranking-table th,
.ranking-table td {
    padding: 0.6rem;
    text-align: center;
    border-bottom: 1px solid #eaeaea;
}

.ranking-table th {
    background-color: var(--blu-navy);
    color: white;
}

.medal {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-left: 5px;
}

.show-full-ranking {
    background-color: var(--blu-navy);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 1rem 0;
    transition: background-color 0.3s;
}

.show-full-ranking:hover {
    background-color: var(--rosa-bubblegum);
}

.full-ranking {
    margin-top: 1rem;
}

.challenge-footer {
    width: 100%;
    text-align: center;
    margin-top: 1rem;
}

.youtube-button {
    display: inline-flex;
    align-items: center;
    background-color: #FF0000;
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.3s;
}

.youtube-button:hover {
    background-color: #CC0000;
    transform: scale(1.05);
}

.youtube-button .youtube-icon {
    width: 24px;
    height: 24px;
    fill: white;
    margin-right: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
    .title {
        font-size: 2rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        padding: 0.4rem 0.8rem;
    }
}

@media screen and (max-width: 1200px) {
    .ai-sections-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .challenge-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .challenge-card {
        width: calc(50% - 1rem);
    }
}

@media (max-width: 768px) {
    .ai-sections-container {
        grid-template-columns: 1fr;
    }

    .navbar {
        padding: 1rem;
    }

    .logo {
        max-width: 70px;
        max-height: 70px;
    }

    .title {
        font-size: 1.7rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--blu-navy);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: 0.5s;
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger {
        display: flex;
        z-index: 1000;
    }

    .hamburger.active .line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active .line:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .line:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .section-title {
        font-size: 2.4rem;
    }

    .ai-table th {
        padding: 1rem 0.8rem;
        font-size: 1.4rem;
    }

    .ai-table td {
        padding: 0.8rem;
        font-size: 1.3rem;
    }

    .country-header {
        font-size: 1.4rem;
        padding: 0.8rem 1rem;
    }
}

@media (max-width: 480px) {
    .logo {
        max-width: 50px;
        max-height: 50px;
    }

    .title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 2.1rem;
    }

    .ai-section,
    .vibe-challenge-section {
        padding: 1.5rem 1rem;
    }

    .ai-table th {
        padding: 0.8rem 0.6rem;
        font-size: 1.2rem;
    }

    .ai-table td {
        padding: 0.7rem 0.5rem;
        font-size: 1.1rem;
    }

    .country-header {
        font-size: 1.2rem;
        padding: 0.7rem 0.9rem;
    }

    .ai-logo {
        width: 25px;
        height: 25px;
    }

    .footer {
        padding: 1.5rem 1rem;
    }
}