/* ========================================
   GABCAVERNA ORARI - Style Cyberpunk Dark
   ======================================== */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colori principali */
    --primary-cyan: #00fff7;
    --primary-blue: #0066ff;
    --primary-purple: #9d00ff;
    --accent-green: #00ff88;
    --accent-red: #ff0055;
    
    /* Background */
    --bg-dark: #0a0a0f;
    --bg-darker: #050508;
    --bg-card: rgba(15, 15, 25, 0.8);
    --bg-glass: rgba(20, 20, 35, 0.6);
    
    /* Testo */
    --text-primary: #ffffff;
    --text-secondary: #b8b8d1;
    --text-muted: #6b6b8f;
    
    /* Effetti */
    --shadow-neon: 0 0 20px var(--primary-cyan);
    --shadow-glow: 0 0 40px rgba(0, 255, 247, 0.3);
}

body {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* === BACKGROUND ANIMATO === */
.cyber-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.grid-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 247, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 247, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

.neon-glow {
    position: absolute;
    width: 300%;
    height: 300%;
    background: radial-gradient(
        circle at center,
        rgba(0, 255, 247, 0.1) 0%,
        rgba(157, 0, 255, 0.05) 50%,
        transparent 70%
    );
    animation: glowPulse 8s ease-in-out infinite;
    left: -100%;
    top: -100%;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* === LED STRIPS === */
.led-strip {
    position: fixed;
    z-index: 100;
    pointer-events: none;
}

.led-top, .led-bottom {
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--primary-cyan) 0%,
        var(--primary-blue) 25%,
        var(--primary-purple) 50%,
        var(--primary-blue) 75%,
        var(--primary-cyan) 100%
    );
    background-size: 200% 100%;
    animation: ledFlow 3s linear infinite;
    box-shadow: 0 0 20px var(--primary-cyan);
}

.led-top { top: 0; }
.led-bottom { bottom: 0; }

.led-left, .led-right {
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(
        180deg,
        var(--primary-cyan) 0%,
        var(--primary-purple) 50%,
        var(--primary-cyan) 100%
    );
    background-size: 100% 200%;
    animation: ledFlow 3s linear infinite;
    box-shadow: 0 0 20px var(--primary-cyan);
}

.led-left { left: 0; }
.led-right { right: 0; }

@keyframes ledFlow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* === CONTAINER === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* === HEADER === */
.main-header {
    text-align: center;
    margin-bottom: 60px;
    padding-top: 40px;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.logo-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 4px solid var(--primary-cyan);
    object-fit: cover;
    position: relative;
    z-index: 2;
    box-shadow: 
        0 0 30px var(--primary-cyan),
        0 0 60px rgba(0, 255, 247, 0.4),
        inset 0 0 20px rgba(0, 255, 247, 0.2);
    animation: logoPulse 3s ease-in-out infinite;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--primary-cyan) 0%, transparent 70%);
    opacity: 0.3;
    animation: logoGlowPulse 3s ease-in-out infinite;
    z-index: 1;
}

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

@keyframes logoGlowPulse {
    0%, 100% { opacity: 0.2; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.2); }
}

.main-header h1 {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 8px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-blue), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 0 30px rgba(0, 255, 247, 0.5),
        0 0 60px rgba(0, 255, 247, 0.3);
}

/* Glitch effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-red);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--primary-cyan);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(20px, 9999px, 65px, 0); }
    25% { clip: rect(90px, 9999px, 120px, 0); }
    50% { clip: rect(40px, 9999px, 80px, 0); }
    75% { clip: rect(10px, 9999px, 50px, 0); }
    100% { clip: rect(70px, 9999px, 100px, 0); }
}

.subtitle {
    font-size: 1.2rem;
    letter-spacing: 6px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* === STATUS SECTION === */
.status-section {
    text-align: center;
    margin-bottom: 60px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 20px 40px;
    background: var(--bg-glass);
    border: 2px solid var(--primary-cyan);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-glow);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.status-badge.open {
    border-color: var(--accent-green);
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.4);
}

.status-badge.closed {
    border-color: var(--accent-red);
    box-shadow: 0 0 40px rgba(255, 0, 85, 0.4);
}

.status-badge.loading {
    border-color: var(--text-muted);
    box-shadow: none;
}

.status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.open .status-icon {
    background: var(--accent-green);
    box-shadow: 0 0 20px var(--accent-green);
}

.status-badge.closed .status-icon {
    background: var(--accent-red);
    box-shadow: 0 0 20px var(--accent-red);
}

.status-badge.loading .status-icon {
    background: var(--text-muted);
}

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

.status-details {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.status-details p {
    margin: 5px 0;
}

/* === SECTIONS === */
.section-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    letter-spacing: 4px;
}

.neon-text {
    color: var(--primary-cyan);
    text-shadow: 
        0 0 10px var(--primary-cyan),
        0 0 20px var(--primary-cyan),
        0 0 30px var(--primary-cyan);
}

/* === TODAY SCHEDULE === */
.today-section {
    margin-bottom: 60px;
}

.schedule-card {
    background: var(--bg-card);
    border: 2px solid var(--primary-blue);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 102, 255, 0.2);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.schedule-card h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary-cyan);
}

.schedule-time {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 15px 0;
    background: linear-gradient(90deg, var(--primary-cyan), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.schedule-note {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 10px;
}

/* === WEEK SCHEDULE === */
.week-section {
    margin-bottom: 60px;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.day-card {
    background: var(--bg-card);
    border: 2px solid rgba(0, 255, 247, 0.3);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: left;
    width: 100%;
    color: inherit;
}

.day-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 255, 247, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

.day-card:hover::before {
    left: 100%;
}

.day-card:hover {
    border-color: var(--primary-cyan);
    box-shadow: 0 8px 32px rgba(0, 255, 247, 0.3);
    transform: translateY(-5px);
}

.day-card.clickable {
    cursor: pointer;
}

.day-card:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.day-card.today {
    border-color: var(--accent-green);
    box-shadow: 0 8px 32px rgba(0, 255, 136, 0.3);
}

.day-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.day-card.today .day-name {
    color: var(--accent-green);
}

.day-hours {
    font-size: 1.5rem;
    margin: 10px 0;
    color: var(--text-primary);
}

.day-date {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.day-hours.closed {
    color: var(--accent-red);
}

.day-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
    font-style: italic;
}

.booking-hint {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.availability-line {
    margin-top: 12px;
    color: var(--accent-green);
    font-weight: 600;
}

.pending-line {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.participants-label {
    margin-top: 12px;
    color: var(--primary-cyan);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.participants-list {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.participant-chip {
    font-size: 0.78rem;
    color: var(--text-primary);
    border: 1px solid rgba(0, 255, 247, 0.35);
    border-radius: 999px;
    padding: 3px 10px;
    background: rgba(0, 255, 247, 0.08);
}

.participants-empty {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.day-card.today-missing {
    border-style: dashed;
    border-color: rgba(255, 0, 85, 0.6);
    background: rgba(35, 8, 18, 0.55);
}

.book-cta {
    margin-top: 14px;
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--primary-cyan);
    border-radius: 999px;
    color: var(--primary-cyan);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.book-cta.disabled {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.today-marker {
    margin-left: 8px;
    font-size: 0.8rem;
    color: var(--accent-green);
}

.inline-error {
    color: var(--accent-red);
    text-align: center;
    padding: 20px;
}

/* Modal pubblico */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--primary-cyan);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(0, 255, 247, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
}

.modal-form {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-cyan);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: rgba(10, 10, 20, 0.7);
    border: 1px solid rgba(0, 255, 247, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 700;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
    color: var(--bg-dark);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
}

.global-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2200;
    padding: 14px 18px;
    border-radius: 10px;
    display: none;
    font-weight: 600;
}

.global-alert.show {
    display: block;
}

.global-alert.success {
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.global-alert.error {
    background: rgba(255, 0, 85, 0.15);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

/* === LOADING === */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 255, 247, 0.1);
    border-top: 4px solid var(--primary-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === FOOTER === */
.main-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 2px solid rgba(0, 255, 247, 0.2);
    color: var(--text-secondary);
}

.footer-links {
    margin-top: 20px;
}

.admin-link {
    color: var(--primary-cyan);
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid var(--primary-cyan);
    border-radius: 20px;
    transition: all 0.3s ease;
    display: inline-block;
}

.admin-link:hover {
    background: var(--primary-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--primary-cyan);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .main-header h1 {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }
    
    .logo-img {
        width: 120px;
        height: 120px;
    }
    
    .status-badge {
        font-size: 1.2rem;
        padding: 15px 25px;
    }
    
    .week-grid {
        grid-template-columns: 1fr;
    }
    
    .schedule-time {
        font-size: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
