/* Index Page Extended Styles - Manga, Calendar, Modal & Responsive */

/* Manga Section Styles */
.manga-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .manga-card {
    background: #334155;
    border-color: #475569;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.manga-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

[data-theme="dark"] .manga-card:hover {
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.3);
}

.manga-poster {
    position: relative;
    width: 100%;
    padding-top: 75%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.manga-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.manga-card:hover .manga-poster img {
    transform: scale(1.05);
}

.manga-status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.manga-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.manga-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.manga-progress {
    margin-bottom: 8px;
    flex: 1;
}

.progress-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
}

.chapters-read {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

[data-theme="dark"] .chapters-read {
    color: #94a3b8;
}

.last-chapter {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
}

[data-theme="dark"] .last-chapter {
    color: #6b7280;
}

.manga-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #f59e0b;
    font-weight: 600;
}

.manga-actions {
    margin-top: auto;
}

.manga-actions .btn {
    width: 100%;
    font-size: 0.8rem;
    padding: 6px 10px;
}

/* Manga Tabs */
.manga-tabs-container {
    margin-bottom: 24px;
}

.manga-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 10;
}

[data-theme="dark"] .manga-tabs {
    background: #334155;
    border-color: #475569;
}

.manga-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.manga-tab:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.manga-tab.active {
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

[data-theme="dark"] .manga-tab {
    color: #94a3b8;
}

[data-theme="dark"] .manga-tab:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .manga-tab.active {
    color: white;
    background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
}

.manga-tab i {
    font-size: 1rem;
}

.manga-tab span {
    font-size: 0.9rem;
}

.manga-tab-content {
    position: relative;
}

.manga-tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.manga-tab-pane.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Manga Rows Layout */
.manga-rows-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.manga-row-item {
    width: 100%;
}

.manga-row-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .manga-row-card {
    background: #334155;
    border-color: #475569;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.manga-row-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

[data-theme="dark"] .manga-row-card:hover {
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.manga-row-poster {
    width: 80px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.manga-row-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.manga-row-card:hover .manga-row-poster img {
    transform: scale(1.05);
}

.manga-row-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.manga-row-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

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

.manga-row-progress {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.manga-row-progress .progress-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.manga-row-progress .chapters-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.manga-row-progress .chapters-read {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

[data-theme="dark"] .manga-row-progress .chapters-read {
    color: #94a3b8;
}

.manga-row-progress .last-chapter {
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 500;
}

[data-theme="dark"] .manga-row-progress .last-chapter {
    color: #6b7280;
}

.manga-row-progress .manga-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: #f59e0b;
    font-weight: 600;
}

.manga-row-actions {
    flex-shrink: 0;
}

.manga-row-actions .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Quick Controls */
.chapters-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.quick-controls {
    display: flex;
    gap: 4px;
}

.btn-xs {
    padding: 2px 6px;
    font-size: 0.7rem;
    line-height: 1.2;
    border-radius: 4px;
}


/* Modern Manga Modal Styles */
.modern-manga-modal {
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    transition: all 0.3s ease;
}

/* Fix per posizionamento modal */
.modal {
    z-index: 9999 !important;
}

.modal-backdrop {
    display: none !important;
    /* Nasconde completamente il backdrop */
}

.modal-dialog {
    margin: 1.75rem auto !important;
    max-width: 1000px !important;
    z-index: 10000 !important;
    /* Assicura che il contenuto del modal sia sopra il backdrop */
}

/* Assicura che il modal sia centrato */
.modal.show {
    display: block !important;
    z-index: 9999 !important;
}

/* Assicura che il contenuto del modal sia cliccabile */
.modal-content {
    z-index: 10001 !important;
    pointer-events: auto !important;
}

.modern-manga-modal .modal-dialog {
    margin: 1rem;
    max-width: 1000px;
}

.modern-modal-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    border: none;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.modern-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.modern-modal-header .modal-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.modern-modal-header .modal-title {
    font-weight: 700;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modern-modal-header .btn-close {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.modern-modal-header .btn-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.modern-modal-body {
    padding: 2rem;
    background: #ffffff;
}

.manga-modal-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.manga-modal-image-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.manga-modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.manga-modal-image:hover {
    transform: scale(1.02);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 0%, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-size: 2rem;
}

.manga-modal-image-container:hover .image-overlay {
    opacity: 1;
}

.manga-modal-title-section {
    text-align: center;
}

.manga-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.manga-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.manga-status-badge i {
    font-size: 0.5rem;
}

/* Status Badge Colors */
.status-completed {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: #bbf7d0 !important;
}

.status-reading {
    background: #dbeafe !important;
    color: #1e40af !important;
    border-color: #93c5fd !important;
}

.status-onhold {
    background: #fef3c7 !important;
    color: #92400e !important;
    border-color: #fde68a !important;
}

.status-planning {
    background: #e9d5ff !important;
    color: #7c3aed !important;
    border-color: #c4b5fd !important;
}

/* Dark Mode Status Badge Colors */
[data-bs-theme="dark"] .status-completed {
    background: #14532d !important;
    color: #86efac !important;
    border-color: #22c55e !important;
}

[data-bs-theme="dark"] .status-reading {
    background: #1e3a8a !important;
    color: #93c5fd !important;
    border-color: #3b82f6 !important;
}

[data-bs-theme="dark"] .status-onhold {
    background: #78350f !important;
    color: #fbbf24 !important;
    border-color: #f59e0b !important;
}

[data-bs-theme="dark"] .status-planning {
    background: #581c87 !important;
    color: #c4b5fd !important;
    border-color: #8b5cf6 !important;
}

.manga-form-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.section-title i {
    color: #3b82f6;
    font-size: 1.25rem;
}

.modern-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.modern-label i {
    color: #6b7280;
    font-size: 0.875rem;
}

.modern-input,
.modern-select,
.modern-textarea {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #374151;
}

.modern-input:focus,
.modern-select:focus,
.modern-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.modern-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Rating Input Controls */
.rating-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.rating-input {
    padding-right: 80px !important;
    text-align: center;
    font-weight: 600;
}

.rating-controls {
    position: absolute;
    right: 8px;
    display: flex;
    gap: 4px;
}

.rating-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    color: #6b7280;
}

.rating-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.rating-btn:active {
    background: #e5e7eb;
    transform: scale(0.95);
}

/* Dark Mode Rating Controls */
[data-bs-theme="dark"] .rating-btn {
    background: #475569;
    border-color: #64748b;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .rating-btn:hover {
    background: #64748b;
    border-color: #94a3b8;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .rating-btn:active {
    background: #334155;
}

.modern-modal-footer {
    background: #f8fafc;
    border: none;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
}

.modern-save-btn {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.modern-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.4);
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

/* Dark Mode Support */
[data-bs-theme="dark"] .modern-manga-modal {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #475569;
}

[data-bs-theme="dark"] .modern-modal-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    border-bottom: 1px solid #475569;
}

[data-bs-theme="dark"] .modern-modal-body {
    background: #1e293b;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .manga-modal-card {
    background: #334155;
    border-color: #475569;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .manga-modal-title {
    color: #f1f5f9;
}

[data-bs-theme="dark"] .manga-status-badge {
    background: #1e3a8a;
    color: #93c5fd;
    border-color: #3b82f6;
}

[data-bs-theme="dark"] .form-section {
    background: #334155;
    border-color: #475569;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .section-title {
    color: #f1f5f9;
    border-color: #475569;
}

[data-bs-theme="dark"] .section-title i {
    color: #60a5fa;
}

[data-bs-theme="dark"] .modern-label {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .modern-label i {
    color: #94a3b8;
}

[data-bs-theme="dark"] .modern-input,
[data-bs-theme="dark"] .modern-select,
[data-bs-theme="dark"] .modern-textarea {
    background: #475569;
    border-color: #64748b;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .modern-input:focus,
[data-bs-theme="dark"] .modern-select:focus,
[data-bs-theme="dark"] .modern-textarea:focus {
    border-color: #60a5fa;
    background: #475569;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

[data-bs-theme="dark"] .modern-input::placeholder,
[data-bs-theme="dark"] .modern-textarea::placeholder {
    color: #94a3b8;
}

[data-bs-theme="dark"] .modern-modal-footer {
    background: #334155;
    border-color: #475569;
    border-top: 1px solid #475569;
}

[data-bs-theme="dark"] .modern-save-btn {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
}

[data-bs-theme="dark"] .modern-save-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.5);
}

[data-bs-theme="dark"] .btn-outline-danger {
    color: #fca5a5;
    border-color: #dc2626;
}

[data-bs-theme="dark"] .btn-outline-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #64748b;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background-color: #64748b;
    border-color: #64748b;
    color: #ffffff;
}

/* Supporto per data-theme="dark" (alternativo) */
[data-theme="dark"] .modern-manga-modal {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #475569;
}

[data-theme="dark"] .modern-modal-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    border-bottom: 1px solid #475569;
}

[data-theme="dark"] .modern-modal-body {
    background: #1e293b;
    color: #e2e8f0;
}

[data-theme="dark"] .manga-modal-card {
    background: #334155;
    border-color: #475569;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

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

[data-theme="dark"] .form-section {
    background: #334155;
    border-color: #475569;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .section-title {
    color: #f1f5f9;
    border-color: #475569;
}

[data-theme="dark"] .section-title i {
    color: #60a5fa;
}

[data-theme="dark"] .modern-label {
    color: #cbd5e1;
}

[data-theme="dark"] .modern-label i {
    color: #94a3b8;
}

[data-theme="dark"] .modern-input,
[data-theme="dark"] .modern-select,
[data-theme="dark"] .modern-textarea {
    background: #475569;
    border-color: #64748b;
    color: #f1f5f9;
}

[data-theme="dark"] .modern-input:focus,
[data-theme="dark"] .modern-select:focus,
[data-theme="dark"] .modern-textarea:focus {
    border-color: #60a5fa;
    background: #475569;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .modern-modal-footer {
    background: #334155;
    border-color: #475569;
    border-top: 1px solid #475569;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modern-manga-modal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modern-modal-header {
        padding: 1rem 1.5rem;
    }

    .modern-modal-body {
        padding: 1.5rem;
    }

    .manga-modal-card {
        position: static;
        margin-bottom: 1.5rem;
    }

    .manga-modal-image {
        height: 250px;
    }

    .form-section {
        padding: 1rem;
    }

    .modern-modal-footer {
        padding: 1rem 1.5rem;
    }

    .modern-modal-footer .d-flex {
        flex-direction: column;
        gap: 1rem;
    }

    .modern-modal-footer .d-flex>div {
        width: 100%;
    }
}


/* Weekly Calendar Styles - Design Grigio/Blu Stondato */
.weekly-calendar-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    border-radius: 24px;
    padding: 32px;
    margin: 32px 0;
    box-shadow: 0 25px 50px rgba(71, 85, 105, 0.15), 0 10px 25px rgba(71, 85, 105, 0.1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.weekly-calendar-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    pointer-events: none;
}

[data-theme="dark"] .weekly-calendar-container {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #475569;
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    color: #334155;
    position: relative;
}

[data-theme="dark"] .calendar-header {
    color: #f1f5f9;
}

.calendar-header h3 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.calendar-header h3 i {
    margin-right: 16px;
    color: #3b82f6;
    -webkit-text-fill-color: #3b82f6;
}

[data-theme="dark"] .calendar-header h3 {
    color: #f1f5f9;
}

.calendar-date {
    font-size: 1.125rem;
    color: #64748b;
    font-weight: 500;
    text-transform: capitalize;
}

[data-theme="dark"] .calendar-date {
    color: #94a3b8;
}

.weekly-calendar {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-behavior: smooth;
}

.weekly-calendar::-webkit-scrollbar {
    height: 8px;
}

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

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

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

/* Pallini del carosello settimanale: solo mobile (vedi @media max-width:768px) */
.weekly-calendar-dots {
    display: none;
}

.day-column {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 16px;
    min-height: 300px;
    min-width: 200px;
    flex-shrink: 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.day-column:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(71, 85, 105, 0.15);
    border-color: #3b82f6;
}

/* Stile per il giorno corrente - bordino celeste e testo celeste */
.day-column.today {
    border: 2px solid rgba(59, 130, 246, 0.5);
}

.day-column.today .day-header h4 {
    color: #3b82f6 !important;
}

.day-column.today .day-date {
    color: #3b82f6 !important;
}

[data-theme="dark"] .day-column.today {
    border: 2px solid rgba(96, 165, 250, 0.5);
}

[data-theme="dark"] .day-column.today .day-header h4 {
    color: #60a5fa !important;
    font-weight: 700;
}

[data-theme="dark"] .day-column.today .day-date {
    color: #60a5fa !important;
    font-weight: 700;
}

[data-theme="dark"] .day-column {
    background: rgba(51, 65, 85, 0.7);
    border-color: #475569;
}

.day-header {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

[data-theme="dark"] .day-header {
    border-bottom-color: #475569;
}

.day-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .day-header h4 {
    color: #f1f5f9;
}

.day-episodes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.no-episodes {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: #94a3b8;
    text-align: center;
}

.no-episodes i {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.no-episodes span {
    font-size: 0.875rem;
    font-weight: 500;
}

.anime-button {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.anime-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
}

[data-theme="dark"] .anime-button {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    border-color: #475569;
}

[data-theme="dark"] .anime-button:hover {
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
    border-color: #3b82f6;
}

.anime-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.anime-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.anime-button:hover .anime-image img {
    transform: scale(1.1);
}

.anime-button.dropped-post {
    display: none;
    opacity: 0.5;
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

[data-theme="dark"] .anime-button.dropped-post {
    background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
    border-color: #dc2626;
}

.show-dropped-active .anime-button.dropped-post {
    display: flex;
}

.mini-episode.dropped-post {
    display: none;
    opacity: 0.5;
}

.show-dropped-active .mini-episode.dropped-post {
    display: flex;
}

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

.anime-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.episode-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 2px;
}

[data-theme="dark"] .episode-badge {
    background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
}

.air-time {
    color: #64748b;
    font-weight: 500;
    font-size: 0.75rem;
}

[data-theme="dark"] .air-time {
    color: #94a3b8;
}

.empty-calendar {
    text-align: center;
    padding: 64px 24px;
    color: #64748b;
}

[data-theme="dark"] .empty-calendar {
    color: #94a3b8;
}

.empty-calendar i {
    font-size: 4rem;
    margin-bottom: 24px;
    color: #94a3b8;
}

.empty-calendar h4 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    font-weight: 600;
    color: #475569;
}

[data-theme="dark"] .empty-calendar h4 {
    color: #d1d5db;
}

.empty-calendar p {
    font-size: 1rem;
    margin: 0;
    color: #64748b;
}

/* Stili per il modale anime: vedi wwwroot/js/infoModalAM.js (addStyles) */

/* RESPONSIVE MEDIA QUERIES */

/* Tablet & below */
@media (max-width: 992px) {
    .week-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .popular-anime-sidebar {
        padding: 16px;
    }

    .popular-anime-sidebar .mb-3 {
        flex-wrap: wrap;
        gap: 8px;
    }

    .popular-anime-sidebar h2 {
        font-size: 0.9rem !important;
    }

    .popular-anime-sidebar .badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .vertical-scroll-popular {
        max-height: 600px;
    }

    .anime-poster-small {
        width: 50px !important;
        height: 70px !important;
    }

    .anime-title-vertical {
        font-size: 0.85rem !important;
    }

    .size-controls {
        display: none !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .weekly-calendar-container {
        padding: 20px;
        border-radius: 16px;
    }

    .calendar-header {
        flex-direction: column;
        gap: 16px;
        align-items: center;
        text-align: center;
        margin-bottom: 24px;
    }

    .calendar-header h3 {
        position: static;
        transform: none;
        font-size: 1.5rem;
        margin: 0;
        order: 2;
    }

    .calendar-view-toggle {
        width: 100%;
        display: flex;
        justify-content: center;
        order: 1;
    }

    .calendar-controls {
        order: 3;
    }

    /* Vista settimanale mobile: carosello a un giorno per volta con scroll-snap + pallini */
    .weekly-calendar {
        gap: 0;
        padding-bottom: 0;
        scroll-snap-type: x mandatory;
        scroll-behavior: auto; /* sovrascrive il smooth del desktop; goToDay usa scrollLeft diretto */
        -webkit-overflow-scrolling: touch;
    }

    .day-column {
        width: 100%;
        min-width: 100%;
        min-height: auto;
        flex-shrink: 0;
        padding: 12px 14px;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    .day-column:hover {
        transform: none;
    }

    /* Pallini di navigazione, generati via JS (index.js) */
    .weekly-calendar-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-top: 14px;
    }

    .weekly-calendar-dots .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(148, 163, 184, 0.4);
        border: none;
        padding: 0;
        cursor: pointer;
        transition: background 0.2s ease, transform 0.2s ease;
    }

    .weekly-calendar-dots .dot.active {
        background: #3b82f6;
        transform: scale(1.3);
    }

    [data-theme="dark"] .weekly-calendar-dots .dot {
        background: rgba(148, 163, 184, 0.3);
    }

    [data-theme="dark"] .weekly-calendar-dots .dot.active {
        background: #60a5fa;
    }

    .day-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        text-align: left;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .day-header h4 {
        font-size: 0.875rem;
        margin: 0;
    }

    .day-header .day-date {
        font-size: 0.8rem;
        color: #94a3b8;
    }

    .day-episodes {
        gap: 8px;
    }

    .no-episodes {
        flex-direction: row;
        justify-content: flex-start;
        gap: 8px;
        padding: 8px 2px;
        opacity: 0.5;
    }

    .no-episodes i {
        font-size: 1rem;
    }

    .anime-button {
        padding: 8px;
        gap: 8px;
    }

    .anime-image {
        width: 32px;
        height: 32px;
    }

    .anime-name {
        font-size: 0.8rem;
    }

    .episode-badge {
        font-size: 0.7rem;
        padding: 1px 6px;
    }

    .air-time {
        font-size: 0.7rem;
    }

    .anime-poster {
        height: 100px;
    }

    .anime-info {
        padding: 8px;
        height: 80px;
    }

    .anime-title {
        font-size: 0.75rem;
    }

    .manga-title {
        font-size: 0.85rem;
    }

    .chapters-read {
        font-size: 0.75rem;
    }


    .manga-tabs {
        flex-direction: column;
        gap: 8px;
    }

    .manga-tab {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .manga-tab i {
        font-size: 0.9rem;
    }

    .manga-row-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .manga-row-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }

    .manga-row-progress {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    .manga-row-actions {
        width: 100%;
    }

    .manga-row-actions .btn {
        width: 100%;
    }

}

@media (max-width: 576px) {
    .week-grid {
        grid-template-columns: 1fr;
    }

    .popular-anime-sidebar {
        padding: 10px;
        margin-bottom: 20px;
    }

    .popular-anime-sidebar .mb-3 {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .popular-anime-sidebar h2 {
        font-size: 0.85rem !important;
        margin-right: 6px !important;
    }

    .popular-anime-sidebar .badge {
        font-size: 0.65rem;
        padding: 2px 5px;
    }

    .vertical-scroll-popular {
        max-height: 400px;
    }

    .anime-title-vertical {
        font-size: 0.85rem !important;
        -webkit-line-clamp: 2;
    }

    .layout-toggle {
        width: 65px !important;
        height: 30px !important;
    }

    .layout-btn {
        width: 30px !important;
        height: 24px !important;
    }

    .layout-btn svg {
        width: 12px !important;
        height: 12px !important;
    }

    .layout-toggle::before {
        width: 30px !important;
        height: 24px !important;
    }

    .layout-toggle.horizontal-active::before {
        transform: translateX(30px) !important;
    }

    .size-controls {
        display: none !important;
    }

    .anime-3d-card {
        width: 100px;
        height: 160px;
    }

    .anime-poster {
        height: 90px;
    }

    .anime-info {
        height: 70px;
        padding: 6px;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    .popular-anime-sidebar {
        padding: 8px !important;
        border-radius: 12px;
    }

    .popular-anime-sidebar .mb-3 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .popular-anime-sidebar h2 {
        font-size: 0.8rem !important;
        margin: 0 !important;
    }

    .popular-anime-sidebar .badge {
        font-size: 0.6rem !important;
        padding: 1px 4px !important;
        width: fit-content;
    }

    .layout-toggle {
        width: 60px !important;
        height: 28px !important;
        margin: 0 !important;
    }

    .layout-btn {
        width: 28px !important;
        height: 22px !important;
    }

    .layout-btn svg {
        width: 10px !important;
        height: 10px !important;
    }

    .layout-toggle::before {
        width: 28px !important;
        height: 22px !important;
    }

    .layout-toggle.horizontal-active::before {
        transform: translateX(28px) !important;
    }

    .vertical-scroll-popular {
        max-height: 350px !important;
    }
}

/* ==========================================
   CALENDARIO MENSILE STYLES
   ========================================== */

/* Calendar View Toggle */
.calendar-view-toggle {
    display: flex;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toggle-btn:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.toggle-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .calendar-view-toggle {
    background: rgba(71, 85, 105, 0.5);
}

[data-theme="dark"] .toggle-btn {
    color: #94a3b8;
}

[data-theme="dark"] .toggle-btn:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .toggle-btn.active {
    background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
    color: white;
}

/* Calendar Controls */
.calendar-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.month-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(148, 163, 184, 0.1);
    padding: 6px 16px;
    border-radius: 12px;
}

.month-navigation .nav-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.month-navigation .nav-btn:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.05);
}

.month-display {
    font-weight: 600;
    font-size: 1rem;
    color: #374151;
    min-width: 150px;
    text-align: center;
}

[data-theme="dark"] .month-navigation {
    background: rgba(71, 85, 105, 0.5);
}

[data-theme="dark"] .month-display {
    color: #f1f5f9;
}

[data-theme="dark"] .month-navigation .nav-btn {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

[data-theme="dark"] .month-navigation .nav-btn:hover {
    background: #3b82f6;
    color: white;
}

/* Monthly Calendar Grid */
.monthly-calendar {
    margin-top: 24px;
}

.monthly-calendar-header {
    margin-bottom: 8px;
}

.weekday-names {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.weekday-name {
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: #64748b;
    padding: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .weekday-name {
    color: #94a3b8;
}

.monthly-calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.monthly-week-slide {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

/* Pallini carosello mensile: solo mobile (vedi @media max-width:768px) */
.monthly-carousel-dots {
    display: none;
}

.calendar-day {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    min-height: 120px;
    padding: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.calendar-day:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.calendar-day.today {
    border: 2px solid #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.calendar-day.other-month {
    opacity: 0.4;
    background: rgba(148, 163, 184, 0.1);
}

.calendar-day.has-episodes {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
}

[data-theme="dark"] .calendar-day {
    background: rgba(51, 65, 85, 0.7);
    border-color: #475569;
}

[data-theme="dark"] .calendar-day:hover {
    border-color: #60a5fa;
}

[data-theme="dark"] .calendar-day.today {
    border-color: #60a5fa;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1) 0%, rgba(129, 140, 248, 0.1) 100%);
}

[data-theme="dark"] .calendar-day.has-episodes {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15) 0%, rgba(129, 140, 248, 0.15) 100%);
}

.day-number {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.calendar-day.today .day-number {
    color: #3b82f6;
}

[data-theme="dark"] .day-number {
    color: #f1f5f9;
}

[data-theme="dark"] .calendar-day.today .day-number {
    color: #60a5fa;
}

.day-episodes-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 80px;
    overflow-y: auto;
}

.day-episodes-list::-webkit-scrollbar {
    width: 4px;
}

.day-episodes-list::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 2px;
}

.mini-episode {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-episode:hover {
    background: rgba(59, 130, 246, 0.25);
}

.mini-episode.aired {
    background: rgba(34, 197, 94, 0.1);
}

.mini-episode.aired:hover {
    background: rgba(34, 197, 94, 0.2);
}

[data-theme="dark"] .mini-episode {
    background: rgba(96, 165, 250, 0.2);
}

[data-theme="dark"] .mini-episode:hover {
    background: rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .mini-episode.aired {
    background: rgba(74, 222, 128, 0.2);
}

.mini-episode-img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
}

.mini-episode-info {
    flex: 1;
    min-width: 0;
}

.mini-episode-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.mini-episode-ep {
    font-size: 0.6rem;
    color: #64748b;
}

[data-theme="dark"] .mini-episode-ep {
    color: #94a3b8;
}

.more-episodes {
    font-size: 0.7rem;
    color: #3b82f6;
    text-align: center;
    padding: 4px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.more-episodes:hover {
    color: #2563eb;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
}

[data-theme="dark"] .more-episodes {
    color: #60a5fa;
}

[data-theme="dark"] .more-episodes:hover {
    color: #93c5fd;
    background: rgba(96, 165, 250, 0.15);
}

/* Tooltip per episodi nascosti - GLOBALE */
.episodes-tooltip {
    position: fixed;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 200px;
    max-width: 280px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    white-space: normal;
    transform: translate(-50%, -100%) translateY(-8px);
}

/* Overlay per mobile */
.tooltip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tooltip-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.episodes-tooltip.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -100%) translateY(-4px);
}

[data-theme="dark"] .episodes-tooltip {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Freccia del tooltip */
.episodes-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: white;
}

[data-theme="dark"] .episodes-tooltip::after {
    border-top-color: #1e293b;
}

/* Elementi episodi nel tooltip */
.tooltip-episode-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 4px;
}

.tooltip-episode-item:last-child {
    margin-bottom: 0;
}

.tooltip-episode-item:hover {
    background: #f1f5f9;
}

.tooltip-episode-item.aired {
    opacity: 0.6;
}

.tooltip-episode-item.aired:hover {
    opacity: 0.8;
}

[data-theme="dark"] .tooltip-episode-item:hover {
    background: #334155;
}

.tooltip-episode-item img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.tooltip-episode-info {
    flex: 1;
    min-width: 0;
}

.tooltip-episode-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

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

.tooltip-episode-ep {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
}

[data-theme="dark"] .tooltip-episode-ep {
    color: #94a3b8;
}

/* Loading state */
.monthly-calendar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: #64748b;
}

.monthly-calendar-loading p {
    margin-top: 16px;
    font-weight: 500;
}

/* Responsive per calendario mensile */
@media (max-width: 992px) {
    .calendar-header {
        flex-direction: column;
        gap: 16px;
    }

    .calendar-header .d-flex {
        flex-direction: column;
        gap: 12px;
    }

    .calendar-controls {
        flex-direction: column;
        gap: 12px;
    }

    .calendar-day {
        min-height: 100px;
    }

    .mini-episode-img {
        width: 20px;
        height: 20px;
    }

    /* Tooltip responsive per tablet */
    .episodes-tooltip {
        max-width: 240px;
    }
}

@media (max-width: 768px) {
    .calendar-view-toggle {
        width: 100%;
        justify-content: center;
    }

    .toggle-btn {
        flex: 1;
        justify-content: center;
    }

    /* Vista mensile mobile: carosello a una settimana per volta con scroll-snap */
    .monthly-calendar {
        overflow-x: visible;
        padding-bottom: 0;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .weekday-names {
        display: none;
    }

    /* Il grid diventa il track del carosello; ogni week-slide è uno snap item */
    .monthly-calendar-grid {
        flex-direction: row;
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
        scroll-behavior: auto;
        gap: 0;
        min-width: 0;
        scrollbar-width: none; /* Firefox */
    }

    .monthly-calendar-grid::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .monthly-week-slide {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
        min-width: 100%;
        flex-shrink: 0;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        padding: 4px 0;
    }

    /* Nascondi solo i giorni di altri mesi; i giorni vuoti del mese corrente rimangono visibili */
    .monthly-week-slide .calendar-day.other-month {
        display: none;
    }

    /* Giorni senza episodi: riga compatta con solo il numero del giorno */
    .monthly-week-slide .calendar-day:not(.has-episodes) {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        min-height: auto;
        padding: 8px 12px;
        opacity: 0.45;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    /* Stato vuoto per settimane dove TUTTI i giorni sono di altri mesi (caso raro) */
    .week-no-episodes {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 24px 0;
        color: #94a3b8;
        font-size: 0.9rem;
    }

    .week-no-episodes i {
        font-size: 1.5rem;
    }

    /* Pallini carosello mensile */
    .monthly-carousel-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-top: 14px;
    }

    .monthly-carousel-dots .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(148, 163, 184, 0.4);
        border: none;
        padding: 0;
        cursor: pointer;
        transition: background 0.2s ease, transform 0.2s ease;
    }

    .monthly-carousel-dots .dot.active {
        background: #3b82f6;
        transform: scale(1.3);
    }

    [data-theme="dark"] .monthly-carousel-dots .dot {
        background: rgba(148, 163, 184, 0.3);
    }

    [data-theme="dark"] .monthly-carousel-dots .dot.active {
        background: #60a5fa;
    }

    /* Ogni giorno con episodi diventa una riga a piena larghezza (agenda) */
    .monthly-week-slide .calendar-day.has-episodes {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        min-height: auto;
        padding: 10px 12px;
    }

    .day-number {
        flex: 0 0 auto;
        min-width: 36px;
        font-size: 0.9rem;
        margin-bottom: 0;
        text-align: center;
    }

    .day-episodes-list {
        flex: 1;
        min-width: 0;
        max-height: none;
        overflow-y: visible;
        gap: 6px;
    }

    .mini-episode {
        padding: 6px 8px;
        margin-bottom: 0;
    }

    .mini-episode-img {
        width: 32px;
        height: 32px;
    }

    .mini-episode-title {
        font-size: 0.8rem;
        display: block;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
    }

    .mini-episode-ep {
        font-size: 0.7rem;
    }

    /* Tooltip responsive per mobile */
    .episodes-tooltip {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-width: 90%;
        width: 280px;
        max-height: 70vh;
        overflow-y: auto;
    }

    .episodes-tooltip.visible {
        transform: translate(-50%, -50%) !important;
    }

    .episodes-tooltip::after {
        display: none;
    }

    .tooltip-episode-item {
        padding: 8px;
        margin-bottom: 6px;
    }

    .tooltip-episode-item img {
        width: 40px;
        height: 40px;
    }

    .tooltip-episode-title {
        font-size: 0.8rem;
        white-space: normal;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        display: -webkit-box;
    }
}