@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --gold: #d4af37;
    --gold-light: #fef08a;
    --gold-gradient: linear-gradient(135deg, #facc15 0%, #d4af37 50%, #b45309 100%);
    --gold-glow: rgba(212, 175, 55, 0.35);
    
    --bg-dark: #0a0c10;
    --bg-card: rgba(18, 22, 34, 0.78);
    --bg-card-hover: rgba(26, 31, 48, 0.85);
    --border-color: rgba(212, 175, 55, 0.22);
    --border-focus: #d4af37;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --input-bg: rgba(10, 14, 23, 0.75);
    --success: #10b981;
    --error: #ef4444;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1.5rem;
    position: relative;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.08), transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(147, 51, 234, 0.08), transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.6), transparent 70%);
    background-attachment: fixed;
}

/* Partiture e onde decorative animate nello sfondo */
.music-bg-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-note {
    position: absolute;
    color: rgba(212, 175, 55, 0.12);
    font-size: 2.5rem;
    user-select: none;
    animation: floatNote 18s linear infinite;
}

.floating-note:nth-child(1) { top: 8%; left: 8%; font-size: 3rem; animation-duration: 22s; }
.floating-note:nth-child(2) { top: 25%; right: 10%; font-size: 2.2rem; animation-duration: 26s; animation-delay: -5s; }
.floating-note:nth-child(3) { bottom: 18%; left: 12%; font-size: 3.5rem; animation-duration: 20s; animation-delay: -10s; }
.floating-note:nth-child(4) { bottom: 25%; right: 14%; font-size: 2.8rem; animation-duration: 24s; animation-delay: -3s; }
.floating-note:nth-child(5) { top: 60%; left: 5%; font-size: 2rem; animation-duration: 19s; animation-delay: -7s; }

@keyframes floatNote {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.1;
    }
    50% {
        transform: translateY(-40px) rotate(15deg);
        opacity: 0.25;
    }
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.1;
    }
}

/* Header & Logo */
.header-section {
    text-align: center;
    position: relative;
    z-index: 1;
    margin-bottom: 2rem;
}

.logo-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1.2rem;
}

.logo-img {
    height: 120px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.25)) drop-shadow(0 6px 12px rgba(0,0,0,0.8));
    transition: transform 0.4s ease;
}

.logo-img:hover {
    transform: scale(1.04);
}

h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.25));
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 1px;
    max-width: 600px;
    margin: 0 auto;
}

/* Contenitore Principale Glassmorphism */
.main-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 680px;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.8rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(212, 175, 55, 0.05);
    transition: box-shadow 0.3s ease;
}

.main-card:hover {
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8), 0 0 35px rgba(212, 175, 55, 0.08);
}

.wide-card {
    max-width: 1100px;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.col-span-2 {
    grid-column: span 2;
}

.form-group {
    margin-bottom: 1.35rem;
    display: flex;
    flex-direction: column;
}

label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gold-light);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    letter-spacing: 0.5px;
}

label i {
    color: var(--gold);
    font-size: 1.05rem;
}

.input-container {
    position: relative;
}

input[type="text"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.95rem 1.15rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

input[type="date"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    max-width: 100%;
    line-height: normal;
}

textarea {
    resize: vertical;
    min-height: 85px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    background: rgba(14, 18, 30, 0.95);
    box-shadow: 0 0 0 4px var(--gold-glow);
}

input::placeholder,
textarea::placeholder {
    color: #64748b;
    font-weight: 300;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.8;
    cursor: pointer;
    transition: transform 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    transform: scale(1.15);
}

/* Radio Group personalizzato a pillole eleganti */
.radio-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.85rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s ease;
    text-align: center;
}

.radio-content i {
    font-size: 1.25rem;
    color: var(--gold);
}

.radio-card input:checked + .radio-content {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.15);
    color: #fff;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
}

/* Submit Button */
.btn-submit {
    width: 100%;
    margin-top: 1rem;
    padding: 1.1rem 2rem;
    border: none;
    border-radius: 14px;
    background: var(--gold-gradient);
    color: #0c0d12;
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.45);
    filter: brightness(1.08);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Alert Messages */
.alert-box {
    margin-top: 1.5rem;
    padding: 1.1rem 1.4rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    display: none;
    animation: fadeIn 0.3s ease;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    color: #a7f3d0;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--error);
    color: #fca5a5;
}

/* Navigation Links */
.footer-nav {
    margin-top: 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--gold);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.6rem 1.4rem;
    border-radius: 30px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid var(--border-color);
    transition: all 0.25s ease;
}

.nav-link:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
}

/* View page: Statistiche e Toolbar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: rgba(15, 20, 32, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.2rem;
    text-align: center;
}

.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-input-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
}

.search-input-wrapper input {
    padding-left: 2.8rem;
}

/* Grid Card dei Musicisti */
.musicians-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.5rem;
}

.musician-card {
    background: rgba(15, 20, 32, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.musician-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gold-gradient);
    opacity: 0.8;
}

.musician-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.15);
}

.card-header-musician {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.musician-name {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.badge-tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-yes {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-base {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-no {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.info-row i {
    width: 20px;
    color: var(--gold);
    text-align: center;
}

.instrument-box {
    background: rgba(212, 175, 55, 0.08);
    border: 1px dashed rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    margin-top: 0.4rem;
}

.instrument-title {
    font-size: 0.8rem;
    color: var(--gold-light);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.instrument-text {
    font-size: 0.98rem;
    color: #f1f5f9;
    white-space: pre-wrap;
    word-break: break-word;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.75rem;
    margin-top: auto;
}

.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 1rem;
    opacity: 0.6;
}

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

/* Responsive */
@media (max-width: 640px) {
    body {
        padding: 1.25rem 0.85rem;
    }

    .main-card {
        padding: 1.5rem 1.15rem;
        border-radius: 18px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    h1 {
        font-size: 1.75rem;
        letter-spacing: 1px;
    }

    .subtitle {
        font-size: 0.95rem;
        padding: 0 0.5rem;
        margin-bottom: 1.75rem;
    }

    .logo-img {
        height: 95px;
    }

    .form-grid {
        grid-template-columns: 100%;
        gap: 1.1rem;
    }
    
    .col-span-2 {
        grid-column: span 1;
    }

    .form-group {
        width: 100%;
        min-width: 0;
        margin-bottom: 1rem;
    }

    input[type="text"],
    input[type="tel"],
    input[type="date"],
    input[type="number"],
    select,
    textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        padding: 0.85rem 1rem;
        font-size: 0.98rem;
    }

    /* Ottimizzazione specifica iOS/Android per input date */
    input[type="date"] {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 48px;
    }

    /* Layout opzioni spartito su smartphone: righe orizzontali ben spaziate e comode al tocco */
    .radio-options {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .radio-content {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 0.85rem;
        padding: 0.95rem 1.1rem;
        text-align: left;
        min-height: 48px;
    }

    .radio-content i {
        font-size: 1.35rem;
        min-width: 24px;
        text-align: center;
    }

    .radio-content span {
        font-size: 0.95rem;
        font-weight: 500;
    }

    .btn-submit {
        padding: 1rem 1.5rem;
        font-size: 1.05rem;
    }
}
