/* NEWS BANNER */
.news-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: var(--bg);
    height: 40px;
    overflow: hidden;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.2);
}

.news-content {
    height: 100%;
    display: flex;
    align-items: center;
}

.news-items {
    display: flex;
    animation: scroll-news linear infinite;
    white-space: nowrap;
}

.news-item {
    padding: 0 3rem;
    font-size: 0.9em;
    font-weight: 500;
}

.news-item a {
    color: inherit;
    text-decoration: none;
}

.news-item a:hover {
    text-decoration: underline;
}

@keyframes scroll-news {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

.news-banner-active {
    padding-top: 40px;
}

/* GUI-specific styles with uniform background fix */

/* FIX BACKGROUND UNIFORME - Aggiunte all'inizio */
html, body {
    background: var(--bg) !important;
    background-image: none !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Assicura trasparenza per tutti i contenitori principali */
.container,
#view,
.header-container,
footer,
.nav,
.search-container,
.breadcrumb {
    background: transparent !important;
    background-color: transparent !important;
}

.container {
    max-width: 900px; 
    margin: 2rem auto; 
    padding: 0 1rem;
    box-shadow: none !important;
    border: none !important;
    background: transparent;
}

.nav {
    display: flex; 
    gap: 1rem; 
    flex-wrap: wrap; 
    margin: 1.5rem 0;
    justify-content: center;
    background: transparent;
}

.nav a {
    text-decoration: none; 
    border: 1px solid var(--accent-2); 
    padding: .5rem .75rem; 
    border-radius: .75rem;
    transition: all 0.3s ease;
    color: var(--text);
}

.nav a:hover {
    background: rgba(138, 43, 226, 0.2);
    border-color: var(--accent);
}

.nav a.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

#view {
    min-height: 400px;
    padding: 1rem 0;
    animation: fadeIn 0.3s ease-in-out;
    background: transparent;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.header-container {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    background: transparent;
}

.theme-indicator {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.8em;
    opacity: 0.7;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    width: 100%;
    background: transparent;
}

.loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid var(--accent-2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.breadcrumb {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    font-size: 0.9em;
    background: transparent;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 0.5rem;
    color: var(--muted);
}

.search-container {
    margin: 1rem 0;
    display: flex;
    gap: 0.5rem;
    background: transparent;
}

.search-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(127, 255, 212, 0.3);
    color: var(--text);
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-family: inherit;
}

.search-button {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-button:hover {
    background: var(--accent);
    color: var(--bg);
}

footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(127, 255, 212, 0.05);
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: var(--muted);
    background: transparent;
}

/* ============================================
   NUOVE REGOLE PER BLOG RAGGRUPPATO PER ANNO
   ============================================ */

.subtitle {
    font-size: 1.1em;
    color: var(--muted);
    margin-bottom: 2.5rem;
}

.year-section {
    margin-bottom: 3rem;
}

.year-header {
    font-size: 1.8em;
    color: var(--accent);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.year-count {
    font-size: 0.55em;
    color: var(--muted);
    font-weight: normal;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 1.5rem;
}

.blog-item {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    padding: 0.75rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.blog-item:hover {
    border-left-color: var(--accent-2);
    background: rgba(138, 43, 226, 0.05);
    padding-left: 1.5rem;
}

.blog-link {
    color: var(--accent);
    text-decoration: none;
    flex: 1;
    font-size: 1.05em;
    transition: color 0.2s ease;
}

.blog-link:hover {
    color: var(--accent-2);
    text-decoration: underline;
}

.blog-date {
    color: var(--muted);
    font-size: 0.9em;
    min-width: 120px;
    text-align: right;
    white-space: nowrap;
}

/* ============================================
   CARD GRID PER PROJECTS E TOOLS
   ============================================ */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.card-wrapper {
    text-decoration: none;
    display: block;
    height: 100%;
}

.card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--accent-2);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.card-wrapper:hover .card {
    border-color: var(--accent);
    background: rgba(138, 43, 226, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.card h3,
.card-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.3em;
    color: var(--accent);
    transition: color 0.2s ease;
}

.card-wrapper:hover .card-title {
    color: var(--accent-2);
}

.card-link {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-description {
    color: var(--text);
    opacity: 0.9;
    line-height: 1.6;
    flex: 1;
    margin: 0;
}

.card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(127, 255, 212, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* ============================================
   DOCS CATEGORIES CARDS
   ============================================ */

.docs-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.docs-category-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--accent-2);
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.docs-category-card:hover {
    border-color: var(--accent);
    background: rgba(138, 43, 226, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.docs-category-icon {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.docs-category-content {
    flex: 1;
}

.docs-category-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.3em;
    color: var(--accent);
    transition: color 0.2s ease;
}

.docs-category-card:hover .docs-category-title {
    color: var(--accent-2);
}

.docs-category-count {
    margin: 0 0 0.75rem 0;
    font-size: 0.9em;
    color: var(--muted);
    font-weight: 600;
}

.docs-category-description {
    margin: 0;
    color: var(--text);
    opacity: 0.9;
    line-height: 1.5;
    font-size: 0.95em;
}

/* ============================================
   MEDIA QUERIES
   ============================================ */

@media (max-width: 768px) {
    .nav {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        flex-wrap: nowrap;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .docs-categories {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-container div {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
}

@media (max-width: 600px) {
    .news-banner {
        height: 35px;
    }
    
    .news-banner-active {
        padding-top: 35px;
    }
    
    .news-item {
        padding: 0 2rem;
        font-size: 0.8em;
    }
    
    .container:not(.frame) {
        padding: 0 0.5rem;
    }
    
    .search-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .blog-item {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }
    
    .blog-date {
        text-align: left;
        font-size: 0.85em;
    }
    
    .year-header {
        font-size: 1.5em;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .year-count {
        font-size: 0.75em;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card h3 {
        font-size: 1.2em;
    }
    
    .docs-category-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .docs-category-icon {
        font-size: 2rem;
    }
    
    footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}