/* ===================================
   RESET E VARIABILI
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #0096c7;
    --primary-cyan: #00f5ff;
    --primary-purple: #8338ec;
    --primary-pink: #ff006e;
    --accent-green: #06ffa5;
    --accent-yellow: #ffea00;
    --dark-bg: #0a0a0f;
    --darker-bg: #050508;
    --card-bg: #1a1a2e;
    --text-light: #ffffff;
    --text-gray: #a0a0a0;
}

body {
    font-family: 'Inter', sans-serif;
    background: transparent;
    color: var(--text-light);
    overflow-x: hidden;
    min-height: 100vh;
    padding: 20px 0;
    position: relative;
}

/* Canvas effetto acqua DISABILITATO */
#waterEffectCanvas {
    display: none !important;
}

/* ===================================
   ANIMAZIONE BACKGROUND (Nascosta)
   =================================== */
.background-animation {
    display: none;
}

/* ===================================
   CONTAINER PRINCIPALE
   =================================== */
.catalog-container {
    background: #87ceeb;
    border: 3px solid #1e3a5f;
    border-radius: 24px;
    padding: 32px 24px;
    max-width: 845px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 
        0 10px 40px rgba(30, 58, 95, 0.2),
        0 5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.catalog-container::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, var(--primary-cyan), var(--primary-purple), var(--primary-pink));
    border-radius: 32px;
    z-index: -1;
    opacity: 0.2;
    filter: blur(15px);
}

/* ===================================
   HEADER
   =================================== */
.catalog-header {
    text-align: center;
    margin-bottom: 30px;
}

.neon-title h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: #1e3a5f;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.08);
    letter-spacing: 0.1em;
    margin-bottom: 15px;
}

.subtitle {
    font-size: 1.1rem;
    color: #2c5f7f;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

@keyframes neonGlow {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.9; filter: brightness(1.2); }
}

/* ===================================
   LUCI DECORATIVE
   =================================== */
.decorative-lights {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: lightPulse 2s infinite;
}

.light:nth-child(1) { background: var(--primary-cyan); box-shadow: 0 0 15px var(--primary-cyan); animation-delay: 0s; }
.light:nth-child(2) { background: var(--primary-purple); box-shadow: 0 0 15px var(--primary-purple); animation-delay: 0.4s; }
.light:nth-child(3) { background: var(--primary-pink); box-shadow: 0 0 15px var(--primary-pink); animation-delay: 0.8s; }
.light:nth-child(4) { background: var(--accent-green); box-shadow: 0 0 15px var(--accent-green); animation-delay: 1.2s; }
.light:nth-child(5) { background: var(--accent-yellow); box-shadow: 0 0 15px var(--accent-yellow); animation-delay: 1.6s; }

@keyframes lightPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* ===================================
   FILTRI
   =================================== */
.filters-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 25px;
    padding: 15px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    border: 1px solid rgba(0, 245, 255, 0.2);
    overflow-x: auto;
}

.filter-btn {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(240, 248, 255, 0.9));
    border: 2px solid #1e3a5f;
    border-radius: 20px;
    padding: 8px 16px;
    color: #1e3a5f;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(30, 58, 95, 0.3);
    border-color: #2c5f7f;
    background: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(230, 240, 255, 1));
}

.filter-btn.active {
    background: linear-gradient(145deg, #1e3a5f, #2c5f7f);
    color: white;
    box-shadow: 0 5px 25px rgba(30, 58, 95, 0.4);
    transform: scale(1.05);
}

/* ===================================
   DISPLAY INFORMATIVO
   =================================== */
.info-display {
    background: #000;
    border: 2px solid var(--primary-purple);
    border-radius: 10px;
    padding: 15px 25px;
    margin-bottom: 30px;
    box-shadow: inset 0 0 20px rgba(131, 56, 236, 0.3);
}

.display-text {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    color: #f5f5dc;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    white-space: pre-line;
    line-height: 1.6;
}

.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ===================================
   GRID CORSI
   =================================== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.course-item {
    background: linear-gradient(145deg, var(--card-bg), rgba(10, 10, 15, 0.9));
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.course-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.course-item:hover::before {
    opacity: 0.1;
}

.course-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-cyan);
    box-shadow: 
        0 15px 40px rgba(0, 245, 255, 0.3),
        0 0 30px rgba(131, 56, 236, 0.2);
}

.course-item-content {
    position: relative;
    z-index: 1;
}

.course-item-icon {
    font-size: 2.4rem;
    margin-bottom: 12px;
    display: block;
    text-align: center;
    filter: drop-shadow(0 0 10px rgba(0, 245, 255, 0.5));
}

.course-item-number {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 245, 255, 0.2);
    color: var(--primary-cyan);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 20px;
    z-index: 2;
}

.course-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f5f5dc;
    margin-bottom: 8px;
    min-height: 40px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.course-item-provider {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 12px;
}

.course-item-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.course-item-pricing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

/* Level styles removed - not used anymore */

.course-item-price {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--primary-cyan);
    text-shadow: 0 0 10px var(--primary-cyan);
}

.course-item-price-label {
    font-size: 0.7rem;
    color: var(--accent-green);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 8px var(--accent-green);
}

/* ===================================
   POPUP CORSO
   =================================== */
.popup-overlay,
.secondary-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: none;
}

.popup-overlay.active,
.secondary-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.course-popup {
    position: relative;
    animation: slideUp 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-height: 90vh;
    overflow-y: auto;
}

.details-box {
    position: relative;
    animation: slideUp 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-height: none;
    overflow-y: visible;
}

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

.course-card {
    background: linear-gradient(135deg, var(--card-bg), var(--darker-bg));
    border: 3px solid var(--primary-cyan);
    border-radius: 20px;
    width: 336px;
    max-width: 90vw;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 50px rgba(0, 245, 255, 0.3);
    overflow: hidden;
    position: relative;
}

.card-header {
    padding: 32px 24px;
    text-align: center;
    position: relative;
}

.course-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 20px rgba(0, 245, 255, 0.6));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Course badge removed - not used anymore */

.card-content {
    padding: 24px;
    padding-top: 16px;
}

.course-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-light);
    margin-bottom: 8px;
    text-align: center;
}

.course-provider {
    text-align: center;
    color: var(--text-gray);
    font-size: 1rem;
    margin-bottom: 25px;
}

.course-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-icon {
    font-size: 1.04rem;
    display: block;
    margin-bottom: 4px;
}

.stat.price {
    background: linear-gradient(145deg, rgba(0, 150, 199, 0.2), rgba(131, 56, 236, 0.2));
    border-color: var(--primary-cyan);
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--primary-cyan);
    text-shadow: 0 0 15px var(--primary-cyan);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.price-label {
    font-size: 0.7rem;
    color: var(--text-gray);
    font-weight: 600;
    text-transform: uppercase;
    text-shadow: none;
}

.course-description {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: center;
}

.central-cta {
    width: 100%;
    background: linear-gradient(145deg, var(--primary-cyan), var(--primary-purple));
    border: 3px solid var(--primary-cyan);
    border-radius: 15px;
    padding: 20px;
    color: var(--text-light);
    font-size: 1.3rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 245, 255, 0.4);
    transition: all 0.3s ease;
}

.central-cta:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 245, 255, 0.6);
}

.cta-icon {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: var(--primary-pink);
    border: 3px solid var(--text-light);
    border-radius: 50%;
    color: var(--text-light);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px var(--primary-pink);
    transition: all 0.3s ease;
    z-index: 100;
}

.close-btn:hover {
    transform: rotate(90deg) scale(1.2);
    background: var(--primary-cyan);
    box-shadow: 0 0 30px var(--primary-cyan);
}

/* ===================================
   BOX DETTAGLI
   =================================== */
.details-box {
    background: linear-gradient(135deg, var(--card-bg), var(--darker-bg));
    border: 3px solid var(--primary-purple);
    border-radius: 20px;
    padding: 12px;
    max-width: 460px;
    width: 90%;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 
        0 0 60px rgba(131, 56, 236, 0.5),
        inset 0 0 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.details-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--primary-cyan);
    text-align: center;
    margin-bottom: 8px;
    margin-top: 0;
    text-shadow: 0 0 20px var(--primary-cyan);
}

/* Descrizione Dettagliata */
.detailed-description-section {
    margin-bottom: 10px;
}

.detailed-description-section h3 {
    color: var(--accent-green);
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.detailed-description-text {
    color: var(--text-light);
    line-height: 1.3;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--primary-cyan);
    padding: 6px;
    border-radius: 8px;
}

/* Materiali Corso */
.materials-section {
    margin-bottom: 10px;
}

.materials-section h3 {
    color: var(--accent-yellow);
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.material-btn {
    background: linear-gradient(145deg, rgba(0, 150, 199, 0.3), rgba(131, 56, 236, 0.3));
    border: 2px solid var(--primary-purple);
    border-radius: 8px;
    padding: 6px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
}

.material-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(131, 56, 236, 0.5);
    border-color: var(--accent-yellow);
}

.material-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 10px rgba(255, 234, 0, 0.6));
}

.skills-section {
    margin-bottom: 10px;
}

.skills-section h3 {
    color: var(--accent-green);
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.skill-tag {
    background: linear-gradient(145deg, rgba(6, 255, 165, 0.2), rgba(0, 245, 255, 0.2));
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.info-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px;
    text-align: center;
}

.info-label {
    font-size: 0.6rem;
    color: var(--text-gray);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-cyan);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.action-btn {
    background: linear-gradient(145deg, rgba(0, 150, 199, 0.3), rgba(131, 56, 236, 0.3));
    border: 2px solid var(--primary-cyan);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.action-btn.primary {
    background: linear-gradient(145deg, var(--primary-cyan), var(--primary-purple));
    box-shadow: 0 5px 20px rgba(0, 245, 255, 0.3);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 245, 255, 0.5);
}

.action-btn span {
    font-size: 1.4rem;
}

/* ===================================
   MEDIA VIEWER (PDF/INFOGRAFICA)
   =================================== */
.media-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: none;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.media-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.media-viewer {
    position: relative;
    background: var(--card-bg);
    border: 3px solid var(--primary-cyan);
    border-radius: 20px;
    max-width: fit-content;
    max-height: 95vh;
    width: auto;
    height: auto;
    box-shadow: 
        0 0 60px rgba(0, 245, 255, 0.5),
        inset 0 0 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.media-content {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 60px 20px 20px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Stili base per contenuto media */
.media-content {
    display: block;
    margin: 0 auto;
}

/* Stili specifici per PDF e Immagini */
/* Stili uniformi per PDF e Immagini - TUTTI I DISPOSITIVI */
.media-content iframe {
    width: 80vw;
    max-width: 1000px;
    height: 85vh;
    display: block;
    margin: 0 auto;
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.media-content img {
    max-width: 85vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ===================================
   RESPONSIVE MEDIA VIEWER
   =================================== */
@media (max-width: 768px) {
    /* PDF e Immagini - stessi stili, dimensioni adattate */
    .media-content iframe {
        width: 90vw;
        max-width: 90vw;
        height: 70vh;
    }
    
    .media-content img {
        max-width: 90vw;
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    /* PDF e Immagini - stessi stili, dimensioni per smartphone */
    .media-content iframe {
        width: 95vw;
        max-width: 95vw;
        height: 70vh;
    }
    
    .media-content img {
        max-width: 95vw;
        max-height: 70vh;
    }
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
    .neon-title h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .filters-bar {
        gap: 8px;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 8px 15px;
    }
    
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .course-item {
        padding: 15px;
    }
    
    .course-item-icon {
        font-size: 2.5rem;
    }
    
    .course-item-title {
        font-size: 0.95rem;
        min-height: auto;
    }
    
    .course-card {
        width: 95vw;
    }
    
    .course-title {
        font-size: 1.5rem;
    }
    
    .course-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .details-box {
        padding: 30px 20px;
    }
    
    .details-content h2 {
        font-size: 1.6rem;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .materials-grid {
        grid-template-columns: 1fr;
    }
    
    .course-stats {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar personalizzata */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-cyan), var(--primary-purple));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-purple), var(--primary-pink));
}
