/* Index Page Styles - Classifica Anime */

/* Bubble nav — styles live in /components/bubble-nav/bubble-nav.css, mirrored here for page use */

/* Bubble pill — bordo che pulsa come superficie di bolla */
@keyframes bubblePillFloat {
    0%   { transform: translateY(0) scale(1);
           box-shadow: inset 2px 2px 6px rgba(255,255,255,0.55),
                       inset -1px -1px 4px rgba(99,179,237,0.2),
                       0 0 0 1.5px rgba(99,179,237,0.35),
                       0 2px 8px rgba(99,179,237,0.12); }
    30%  { transform: translateY(-3px) scale(1.02);
           box-shadow: inset 3px 3px 8px rgba(255,255,255,0.7),
                       inset -2px -2px 5px rgba(99,179,237,0.25),
                       0 0 0 2px rgba(147,210,255,0.6),
                       0 6px 18px rgba(99,179,237,0.22); }
    60%  { transform: translateY(-5px) scale(1.01);
           box-shadow: inset 1px 1px 5px rgba(255,255,255,0.45),
                       inset -1px -2px 6px rgba(99,179,237,0.18),
                       0 0 0 1.5px rgba(99,179,237,0.4),
                       0 8px 20px rgba(99,179,237,0.18); }
    100% { transform: translateY(0) scale(1);
           box-shadow: inset 2px 2px 6px rgba(255,255,255,0.55),
                       inset -1px -1px 4px rgba(99,179,237,0.2),
                       0 0 0 1.5px rgba(99,179,237,0.35),
                       0 2px 8px rgba(99,179,237,0.12); }
}

@keyframes bubblePillFloatRed {
    0%   { transform: translateY(0) scale(1);
           box-shadow: inset 2px 2px 6px rgba(255,255,255,0.5),
                       inset -1px -1px 4px rgba(248,113,113,0.18),
                       0 0 0 1.5px rgba(248,113,113,0.35),
                       0 2px 8px rgba(248,113,113,0.12); }
    30%  { transform: translateY(-3px) scale(1.02);
           box-shadow: inset 3px 3px 8px rgba(255,255,255,0.65),
                       inset -2px -2px 5px rgba(248,113,113,0.22),
                       0 0 0 2px rgba(255,160,160,0.6),
                       0 6px 18px rgba(248,113,113,0.22); }
    60%  { transform: translateY(-5px) scale(1.01);
           box-shadow: inset 1px 1px 5px rgba(255,255,255,0.42),
                       inset -1px -2px 6px rgba(248,113,113,0.16),
                       0 0 0 1.5px rgba(248,113,113,0.4),
                       0 8px 20px rgba(248,113,113,0.18); }
    100% { transform: translateY(0) scale(1);
           box-shadow: inset 2px 2px 6px rgba(255,255,255,0.5),
                       inset -1px -1px 4px rgba(248,113,113,0.18),
                       0 0 0 1.5px rgba(248,113,113,0.35),
                       0 2px 8px rgba(248,113,113,0.12); }
}

@keyframes bubbleRise {
    0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    10%  { opacity: 1; }
    50%  { transform: translateY(-50px) translateX(12px) scale(1.04); }
    90%  { opacity: 0.6; }
    100% { transform: translateY(-180px) translateX(-8px) scale(0.85); opacity: 0; }
}

.bubble-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 20px;
    border-radius: 999px;
    background: rgba(220, 242, 255, 0.18);
    backdrop-filter: blur(4px);
    border: none;
    color: #2563eb;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    animation: bubblePillFloat 3.5s ease-in-out infinite;
    transition: background 0.25s, color 0.2s;
}
.bubble-pill:nth-child(1) { animation-delay: 0s; }
.bubble-pill:nth-child(2) { animation-delay: 0.4s; }
.bubble-pill:nth-child(3) { animation-delay: 0.8s; }
.bubble-pill:nth-child(4) { animation-delay: 1.2s; }
.bubble-pill:nth-child(5) { animation-delay: 1.6s; }
.bubble-pill:nth-child(6) { animation-delay: 2.0s; }
.bubble-pill:hover { background: rgba(186,230,253,0.45); color: #1d4ed8; text-decoration: none; }

.bubble-pill--admin {
    background: rgba(255, 228, 228, 0.18);
    color: #dc2626;
    animation-name: bubblePillFloatRed;
}
.bubble-pill--admin:hover { background: rgba(254,202,202,0.45); color: #b91c1c; }

/* Background rising bubbles inside hero-panel */
.bubble-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.bubble-bg .bubble {
    position: absolute;
    bottom: -60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(147,197,253,0.35);
    animation: bubbleRise linear infinite;
}
.bubble-bg .bubble:nth-child(1) { width:28px;height:28px;left:5%;  animation-duration:7s;  animation-delay:0s; }
.bubble-bg .bubble:nth-child(2) { width:18px;height:18px;left:15%; animation-duration:9s;  animation-delay:1.5s; }
.bubble-bg .bubble:nth-child(3) { width:38px;height:38px;left:28%; animation-duration:11s; animation-delay:0.8s; }
.bubble-bg .bubble:nth-child(4) { width:22px;height:22px;left:42%; animation-duration:8s;  animation-delay:3s; }
.bubble-bg .bubble:nth-child(5) { width:16px;height:16px;left:58%; animation-duration:10s; animation-delay:2s; }
.bubble-bg .bubble:nth-child(6) { width:32px;height:32px;left:70%; animation-duration:7.5s;animation-delay:0.5s; }
.bubble-bg .bubble:nth-child(7) { width:20px;height:20px;left:82%; animation-duration:9.5s;animation-delay:4s; }
.bubble-bg .bubble:nth-child(8) { width:14px;height:14px;left:92%; animation-duration:6.5s;animation-delay:1s; }

/* Pannello principale */
.hero-panel {
    position: relative;
    overflow: hidden;
    background: rgba(220, 242, 255, 0.18);
    border: 1.5px solid rgba(147, 197, 253, 0.35);
    border-radius: 16px;
    padding: 28px 32px;
}

/* Popular View Toggle - Simple Buttons */
.popular-view-toggle {
    display: flex;
    gap: 4px;
}

.popular-view-toggle .btn {
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.popular-view-toggle .btn.active {
    background-color: #3377ff !important;
    border-color: #3377ff !important;
    color: white !important;
}

.popular-view-toggle .btn:not(.active) {
    background-color: transparent;
    border-color: #dee2e6;
    color: #64748b;
}

.popular-view-toggle .btn:not(.active):hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

[data-theme="dark"] .popular-view-toggle .btn.active {
    background-color: #3377ff !important;
    border-color: #3377ff !important;
    color: white !important;
}

[data-theme="dark"] .popular-view-toggle .btn:not(.active) {
    background-color: transparent;
    border-color: #475569;
    color: #94a3b8;
}

[data-theme="dark"] .popular-view-toggle .btn:not(.active):hover {
    background-color: #475569;
    border-color: #64748b;
}

[data-theme="dark"] .hero-panel {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 1px solid #475569;
}

.feature-tile {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px;
    transition: all .2s ease;
    text-decoration: none;
    display: block;
    height: 100%;
}

[data-theme="dark"] .feature-tile {
    background: #334155;
    border: 1px solid #475569;
    color: #ffffff;
}

.feature-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, .15);
    border-color: #93c5fd;
    text-decoration: none;
}

[data-theme="dark"] .feature-tile:hover {
    box-shadow: 0 12px 24px rgba(59, 130, 246, .3);
    border-color: #3b82f6;
}

.feature-icon {
    width: 56px; height: 56px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: #eff6ff; color: #2563eb;
    margin-bottom: 12px;
}

[data-theme="dark"] .feature-icon {
    background: #1e3a8a;
    color: #93c5fd;
}

/* Scroll orizzontale moderno */
.horizontal-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 16px 0;
    scrollbar-width: thin;
    scrollbar-color: #3377ff #1e293b;
}

.horizontal-scroll::-webkit-scrollbar {
    height: 6px;
}

.horizontal-scroll::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 3px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
    background: #3377ff;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: #0055ff;
}

.horizontal-item {
    display: inline-block;
    width: 160px;
    margin-right: 20px;
    vertical-align: top;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.horizontal-item:hover {
    transform: translateY(-8px) scale(1.05);
    z-index: 10;
}

.anime-poster {
    width: 160px;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.horizontal-item:hover .anime-poster {
    border-color: #3377ff;
    box-shadow: 0 8px 25px rgba(51, 119, 255, 0.3);
}

[data-theme="dark"] .anime-poster {
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .horizontal-item:hover .anime-poster {
    border-color: #3377ff;
    box-shadow: 0 8px 25px rgba(51, 119, 255, 0.4);
}

.anime-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    margin-top: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.horizontal-item:hover .anime-title {
    color: #3377ff;
}

[data-theme="dark"] .anime-title {
    color: #ffffff;
}

[data-theme="dark"] .horizontal-item:hover .anime-title {
     color: #3377ff;
 }

 /* Modern scroll enhancements */
 .modern-scroll {
     background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
     border-radius: 12px;
     padding: 20px 16px;
     position: relative;
 }

 [data-theme="dark"] .modern-scroll {
     background: linear-gradient(90deg, transparent 0%, rgba(51, 119, 255, 0.03) 50%, transparent 100%);
 }

 .modern-scroll::before {
     content: '';
     position: absolute;
     left: 0;
     top: 0;
     bottom: 0;
     width: 20px;
     background: linear-gradient(90deg, rgba(255,255,255,1) 0%, transparent 100%);
     pointer-events: none;
     z-index: 1;
 }

 .modern-scroll::after {
     content: '';
     position: absolute;
     right: 0;
     top: 0;
     bottom: 0;
     width: 20px;
     background: linear-gradient(270deg, rgba(255,255,255,1) 0%, transparent 100%);
     pointer-events: none;
     z-index: 1;
 }

 [data-theme="dark"] .modern-scroll::before {
     background: linear-gradient(90deg, #1e293b 0%, transparent 100%);
 }

 [data-theme="dark"] .modern-scroll::after {
     background: linear-gradient(270deg, #1e293b 0%, transparent 100%);
 }

/* Popular Anime Sidebar */
.popular-anime-sidebar {
     background: #ffffff;
     border: 1px solid #e5e7eb;
     border-radius: 16px;
     padding: 20px;
     max-height: 900px;
     overflow: hidden;
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
     transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
     display: flex;
     flex-direction: column;
 }

/* Header popolari - sempre compatto */
.popular-anime-sidebar .mb-3 {
    gap: 8px;
    align-items: center;
}

.popular-anime-sidebar .mb-2 {
    flex-shrink: 0;
}

.popular-anime-sidebar .mb-3 {
    flex-shrink: 0;
}

.popular-anime-sidebar h2 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .popular-anime-sidebar {
    background: #334155;
    border: 1px solid #475569;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Contenitore per la visualizzazione verticale (colonna) */
.vertical-scroll-popular {
     flex: 1;
     overflow-y: auto;
     overflow-x: hidden;
     padding-right: 8px;
     transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
     min-height: 0;
 }

/* Scrollbar custom per vertical-scroll (stile calendario) */
.vertical-scroll-popular::-webkit-scrollbar {
    width: 8px;
}

.vertical-scroll-popular::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 4px;
}

.vertical-scroll-popular::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border-radius: 4px;
}

.vertical-scroll-popular::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
}

/* Contenitore per la visualizzazione orizzontale (riga) */
.horizontal-scroll-popular {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-bottom: 30px;
    padding-top: 10px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: none; /* Nascosto di default */
}

/* Scrollbar custom per horizontal-scroll (stile calendario) */
.horizontal-scroll-popular::-webkit-scrollbar {
    height: 8px;
}

.horizontal-scroll-popular::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 4px;
}

.horizontal-scroll-popular::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border-radius: 4px;
}

.horizontal-scroll-popular::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
}

.vertical-anime-item {
    margin-bottom: 16px;
    transition: transform 0.2s ease;
}

.vertical-anime-item:hover {
    transform: translateX(4px);
}

.vertical-anime-item a {
    text-decoration: none;
    color: inherit;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid transparent;
    margin-bottom: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.vertical-anime-item a:hover {
    background: #eff6ff;
    border-color: #3377ff;
    box-shadow: 0 8px 20px rgba(51, 119, 255, 0.25);
    color: inherit;
    text-decoration: none;
}

/* Elementi per visualizzazione orizzontale */
.horizontal-anime-item {
    display: inline-block;
    margin-right: 16px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.horizontal-anime-item:hover {
    transform: translateY(-4px);
    z-index: 10;
}

.horizontal-anime-item a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 160px;
    transition: all 0.3s ease;
}

/* Animazioni per il cambio di layout */
.layout-transition {
    animation: smoothLayoutTransition 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes smoothLayoutTransition {
    0% {
        opacity: 0.3;
        transform: scale(0.95);
        filter: blur(2px);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
        filter: blur(1px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

.popular-anime-sidebar {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.horizontal-scroll-popular, .vertical-scroll-popular {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .vertical-anime-item a {
    background: #475569;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
}

[data-theme="dark"] .vertical-anime-item a:hover {
    background: #64748b;
    border-color: #3377ff;
    box-shadow: 0 8px 25px rgba(51, 119, 255, 0.4);
    transform: translateY(-2px);
}

.anime-poster-small {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 12px;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.vertical-anime-item:hover .anime-poster-small {
    border-color: #3377ff;
    transform: scale(1.05);
}

/* Stili per poster nella visualizzazione orizzontale */
.horizontal-anime-item .anime-poster-small {
    width: 160px;
    height: 220px;
    margin-right: 0;
    margin-bottom: 8px;
    border-radius: 12px;
    object-fit: cover;
}

.horizontal-anime-item:hover .anime-poster-small {
    transform: scale(1.05);
    border-color: #3377ff;
}

.horizontal-anime-item {
    position: relative;
    margin-right: 15px;
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.horizontal-anime-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.horizontal-anime-item:hover::before {
    opacity: 1;
}

.horizontal-anime-item .anime-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 70%, transparent 100%);
    color: white;
    padding: 8px 6px 6px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.horizontal-anime-item:hover .anime-title-overlay {
    opacity: 1;
}

.anime-info-vertical {
    flex: 1;
    min-width: 0;
}

.anime-title-vertical {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

[data-theme="dark"] .anime-title-vertical {
    color: #f1f5f9;
}

/* Stili per le informazioni nella visualizzazione orizzontale */
.horizontal-anime-item .anime-info-vertical {
    padding: 8px 4px;
    text-align: center;
}

.horizontal-anime-item .anime-title-vertical {
    display: none !important;
}

.horizontal-anime-item .anime-info-vertical {
    display: none !important;
}

 /* Hero Section Dark Mode */
 [data-theme="dark"] .bg-gradient-to-br {
     background: linear-gradient(to bottom right, #0f172a, #1e293b) !important;
 }

 /* Feature Cards Dark Mode */
 [data-theme="dark"] .feature-card {
     background: #334155;
     border: 1px solid #475569;
 }

 [data-theme="dark"] .bg-yellow-100 {
     background: #1e3a8a !important;
 }

 [data-theme="dark"] .bg-green-100 {
     background: #065f46 !important;
 }

 [data-theme="dark"] .bg-blue-100 {
     background: #1e3a8a !important;
 }

 [data-theme="dark"] .text-yellow-600 {
     color: #fbbf24 !important;
 }

 [data-theme="dark"] .text-green-600 {
     color: #10b981 !important;
 }

 [data-theme="dark"] .text-blue-600 {
     color: #3b82f6 !important;
 }

 [data-theme="dark"] .text-gray-900 {
     color: #ffffff !important;
 }

 [data-theme="dark"] .text-gray-600 {
     color: #cbd5e1 !important;
 }

 
 /* Manga Section Styles - continues in next section... */

@media (max-width: 576px) {
    .popular-anime-sidebar {
        padding: 12px;
        border-radius: 12px;
    }
    
    .vertical-scroll-popular {
        padding-right: 4px;
        max-height: 400px;
    }
    
    /* Layout LISTA (verticale) su cellulare */
    .vertical-anime-item {
        margin-bottom: 8px;
    }
    
    .vertical-anime-item a {
        padding: 8px;
        border-radius: 10px;
        margin-bottom: 0;
        height: auto;
        min-height: 0;
        align-items: center; /* Centra l'immagine col testo per evitare card altissime */
    }
    
    .vertical-anime-item .anime-poster-small {
        width: 48px;
        height: 68px;
        margin-right: 12px;
        border-radius: 6px;
    }
    
    .anime-title-vertical {
        font-size: 0.85rem;
    }

    /* Layout GRIGLIA (orizzontale) su cellulare */
    .horizontal-scroll-popular {
        padding-bottom: 15px; /* Riduciamo lo spazio morto sotto su smartphone */
        padding-top: 5px;
    }
    
    .horizontal-anime-item .anime-poster-small {
        width: 100px;
        height: 140px;
        border-radius: 8px;
        margin-right: 0;
    }
    
    .horizontal-anime-item {
        margin-right: 10px; /* Riduciamo lo spazio tra un anime e l'altro in griglia */
    }
}
