/* ============================================
   ONIRIKA - SPIRALI ARCHIVE & DETAIL
   Sistema di visualizzazione per reperti
   ============================================ */

:root {
    --spirale-primary: #f72585;
    --spirale-secondary: #4cc9f0;
    --spirale-accent: #ffd60a;
    --spirale-bg: #0d0221;
    --spirale-text: #f8f9fa;
}

/* ============================================
   ARCHIVE - Layout Base
   ============================================ */

.spirali-archive {
    min-height: 80vh;
}

.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(247, 37, 133, 0.3);
}

.archive-header h1 {
    margin: 0;
    background: linear-gradient(135deg, #f72585, #b5179e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.archive-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    font-size: 1.5rem;
    background: rgba(247, 37, 133, 0.1);
    border: 2px solid rgba(247, 37, 133, 0.3);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(247, 37, 133, 0.2);
    border-color: var(--spirale-primary);
    transform: scale(1.05);
}

/* ============================================
   FILTRI
   ============================================ */

.filters-bar {
    background: rgba(13, 2, 33, 0.6);
    border: 1px solid rgba(247, 37, 133, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.search-input,
.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(247, 37, 133, 0.3);
    border-radius: 6px;
    color: var(--spirale-text);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--spirale-primary);
    background: rgba(255, 255, 255, 0.08);
}

.filter-select option {
    background: #0d0221;
    color: white;
}

.btn-filter,
.btn-reset {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-filter {
    background: var(--spirale-primary);
    color: white;
    border: none;
}

.btn-filter:hover {
    background: #d91d6c;
    transform: translateY(-2px);
}

.btn-reset {
    background: rgba(255, 255, 255, 0.1);
    color: var(--spirale-accent);
    border: 1px solid rgba(255, 214, 10, 0.3);
}

.btn-reset:hover {
    background: rgba(255, 214, 10, 0.1);
    border-color: var(--spirale-accent);
}

/* ============================================
   VISTA GRIGLIA
   ============================================ */

.spirali-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.spirale-card {
    background: rgba(13, 2, 33, 0.8);
    border: 2px solid rgba(247, 37, 133, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s ease;
    text-decoration: none;
    display: block;
    position: relative;
}

.spirale-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-color, var(--spirale-primary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spirale-card:hover::before {
    opacity: 1;
}

.spirale-card:hover {
    transform: translateY(-8px);
    border-color: var(--card-color, var(--spirale-primary));
    box-shadow: 0 12px 24px rgba(247, 37, 133, 0.3);
}

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(13, 2, 33, 0.9), rgba(247, 37, 133, 0.1));
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.spirale-card:hover .card-image img {
    transform: scale(1.1);
}

.card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-icon {
    font-size: 4rem;
    opacity: 0.3;
}

.card-content {
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.card-level {
    font-size: 1.25rem;
}

.card-code {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--spirale-accent);
    background: rgba(255, 214, 10, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.card-title {
    color: var(--spirale-text);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.meta-dominio,
.meta-zona {
    color: var(--spirale-secondary);
}

/* ============================================
   VISTA LISTA
   ============================================ */

.spirali-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.spirale-list-item {
    background: rgba(13, 2, 33, 0.6);
    border: 1px solid rgba(247, 37, 133, 0.2);
    border-left: 4px solid var(--spirale-primary);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.spirale-list-item:hover {
    background: rgba(247, 37, 133, 0.05);
    border-color: var(--spirale-primary);
    transform: translateX(8px);
}

.list-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.list-level {
    font-size: 1.5rem;
}

.list-code {
    font-family: 'Courier New', monospace;
    color: var(--spirale-accent);
    font-weight: 600;
    min-width: 80px;
}

.list-title {
    color: var(--spirale-text);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.list-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.meta-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.meta-badge.dominio {
    background: rgba(247, 37, 133, 0.2);
    color: var(--spirale-primary);
}

.meta-badge.zona {
    background: rgba(76, 201, 240, 0.2);
    color: var(--spirale-secondary);
}

.meta-date {
    color: #999;
    font-size: 0.875rem;
}

/* ============================================
   DETTAGLIO SPIRALE
   ============================================ */

.spirale-dettaglio {
    background: linear-gradient(180deg, rgba(13, 2, 33, 0.95), rgba(74, 25, 66, 0.3));
    min-height: 100vh;
}

.breadcrumb {
    display: flex;
    gap: 0.5rem;
    color: #999;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--spirale-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .current {
    color: var(--spirale-accent);
    font-weight: 600;
}

.spirale-content {
    color: var(--spirale-text);
}

.spirale-header {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 2px solid rgba(247, 37, 133, 0.2);
    margin-bottom: 3rem;
}

.header-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.meta-level,
.meta-code {
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
}

.meta-code {
    font-family: 'Courier New', monospace;
    color: var(--spirale-accent);
}

.spirale-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f72585, #4cc9f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1rem 0;
}

.header-tags {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.tag.dominio {
    background: rgba(247, 37, 133, 0.2);
    color: var(--spirale-primary);
}

.tag.zona {
    background: rgba(76, 201, 240, 0.2);
    color: var(--spirale-secondary);
}

.tag.date {
    background: rgba(255, 214, 10, 0.2);
    color: var(--spirale-accent);
}

/* ============================================
   GALLERIA IMMAGINI
   ============================================ */

.spirale-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(247, 37, 133, 0.2);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item.primary {
    grid-column: 1 / -1;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item figcaption {
    padding: 1rem;
    background: rgba(13, 2, 33, 0.8);
    color: #ccc;
    font-size: 0.875rem;
    font-style: italic;
}

/* ============================================
   SEZIONI CONTENUTO
   ============================================ */

.spirale-description,
.spirale-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.75rem;
    color: var(--spirale-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(247, 37, 133, 0.2);
}

.prose {
    line-height: 1.8;
    color: #e0e0e0;
}

.prose p {
    margin-bottom: 1rem;
}

.prose strong {
    color: var(--spirale-accent);
}

/* ============================================
   SPECIFICHE TECNICHE
   ============================================ */

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.spec-item {
    background: rgba(13, 2, 33, 0.6);
    border: 1px solid rgba(247, 37, 133, 0.2);
    border-radius: 8px;
    padding: 1.25rem;
}

.spec-item dt {
    color: var(--spirale-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.spec-item dd {
    color: var(--spirale-text);
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
}

/* ============================================
   MISSIONE CARD
   ============================================ */

.missione-card {
    background: rgba(13, 2, 33, 0.8);
    border: 2px solid rgba(76, 201, 240, 0.3);
    border-radius: 12px;
    padding: 2rem;
}

.missione-title {
    color: var(--spirale-secondary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.missione-desc {
    color: #ccc;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.missione-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.875rem;
}

.meta-item.esito-riuscita {
    background: rgba(0, 255, 0, 0.1);
    color: #4ade80;
}

.meta-item.esito-fallita {
    background: rgba(255, 0, 0, 0.1);
    color: #f87171;
}

/* ============================================
   PALETTE COLORI
   ============================================ */

.palette-card {
    background: rgba(13, 2, 33, 0.6);
    border: 1px solid rgba(247, 37, 133, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}

.palette-name {
    font-weight: 700;
    color: var(--spirale-accent);
    margin-bottom: 1rem;
}

.palette-colors {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.color-swatch {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.palette-desc {
    color: #ccc;
    font-size: 0.875rem;
    font-style: italic;
}

/* ============================================
   BOTTONI AZIONE
   ============================================ */

.btn-download {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--spirale-primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background: #d91d6c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 37, 133, 0.4);
}

.btn-back {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--spirale-secondary);
    text-decoration: none;
    border: 1px solid rgba(76, 201, 240, 0.3);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: rgba(76, 201, 240, 0.1);
    border-color: var(--spirale-secondary);
}

.spirale-nav {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(247, 37, 133, 0.2);
    text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .archive-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .filters-form {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    .spirali-grid {
        grid-template-columns: 1fr;
    }

    .spirale-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .list-meta {
        width: 100%;
        justify-content: flex-start;
    }

    .spirale-title {
        font-size: 2rem;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   STATI VUOTI
   ============================================ */

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(13, 2, 33, 0.6);
    border: 2px dashed rgba(247, 37, 133, 0.2);
    border-radius: 12px;
    margin-top: 2rem;
}

.results-info {
    margin: 1.5rem 0;
    padding: 0.75rem 1rem;
    background: rgba(76, 201, 240, 0.1);
    border-left: 4px solid var(--spirale-secondary);
    border-radius: 4px;
}
