@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg-primary: #080808;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-card-hover: #1c1c1c;
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    --accent: #e50914;
    --accent-hover: #f40612;
    --accent-transparent: rgba(229, 9, 20, 0.15);
    --accent-glow: 0 0 15px rgba(229, 9, 20, 0.5);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    
    --shadow-subtle: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-strong: 0 20px 40px -10px rgba(0, 0, 0, 0.8);
    --shadow-accent: 0 10px 25px -5px rgba(229, 9, 20, 0.35);
    
    --transition-fastest: 0.1s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    
    --type-tv: rgba(229, 9, 20, 0.9);
    --type-anime: rgba(229, 9, 20, 0.7);
    --type-movie: rgba(229, 9, 20, 0.8);
    
    --rating-color: #FFD700;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulseAccent {
    0% { box-shadow: 0 0 0 0 var(--accent-transparent); }
    70% { box-shadow: 0 0 0 10px rgba(229, 9, 20, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 9, 20, 0); }
}

@keyframes riseUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes shine {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0% { opacity: 0.6; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.6; transform: scale(0.9); }
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink {
    50% { border-color: transparent }
}

@keyframes slideLeft {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-30px); opacity: 0; }
}

@keyframes slideRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(30px); opacity: 0; }
}

@keyframes slideInLeft {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-left {
    animation: slideLeft 0.3s forwards, slideInRight 0.3s 0.3s forwards;
}

.slide-right {
    animation: slideRight 0.3s forwards, slideInLeft 0.3s 0.3s forwards;
}

.fade-in {
    animation: fadeIn 0.4s forwards;
}

.calendar-container, .calendar-container * {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

.calendar-container {
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}


.calendar-header {
    position: relative;
    margin-bottom: 50px;
    text-align: center;
    animation: fadeIn 0.8s ease-out forwards;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.filter-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 10px;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(229, 9, 20, 0) 0%, rgba(229, 9, 20, 0.1) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: -1;
    border-radius: 10px;
}

.filter-btn:hover {
    color: var(--text-primary);
    transform: translateY(-3px);
}

.filter-btn:hover::before {
    opacity: 1;
}

.filter-btn.active {
    background-color: var(--accent);
    color: white;
    box-shadow: var(--shadow-accent);
}

.filter-btn.active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 100%);
    animation: shine 2s infinite;
    z-index: -1;
}

.filter-btn span {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fastest);
}

.filter-btn:hover svg {
    transform: translateY(-2px);
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0;
    padding: 15px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.calendar-month {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    display: flex;
    align-items: center;
}

.month-highlight {
    color: var(--accent);
    margin-left: 8px;
}

.nav-button {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 30px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-button:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background-color: rgba(229, 9, 20, 0.1);
    transform: translateY(-2px);
}

.nav-button svg {
    width: 20px;
    height: 20px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.calendar-days.animating {
    pointer-events: none;
}

.day-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calendar-day {
    position: relative;
    min-height: 150px;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-normal);
    background-color: rgba(22, 22, 22, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    will-change: transform, box-shadow;
}

.calendar-day.animate-in {
    animation: fadeIn 0.5s forwards;
    animation-delay: var(--animation-delay, 0s);
    opacity: 0;
}

.calendar-day::-webkit-scrollbar {
    width: 5px;
}

.calendar-day::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.calendar-day::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.calendar-day::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.calendar-day:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(30, 30, 30, 0.7);
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.calendar-day.has-events {
    box-shadow: 0 0 8px rgba(229, 9, 20, 0.2);
    cursor: pointer;
}

.calendar-day.has-events:hover {
    transform: scale(1.02);
    z-index: 10;
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.3);
}

.calendar-day.has-events:before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: var(--accent);
    border-radius: 50%;
    margin: 5px;
    animation: pulseAccent 2s infinite;
}

.day-number {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.event-count {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: var(--accent);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    margin-left: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.day-number:after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 20px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.calendar-day:hover .day-number:after {
    width: 30px;
    background-color: var(--accent);
}

.day-today {
    border: 2px solid var(--accent);
    background-color: rgba(229, 9, 20, 0.08);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.2);
}

.day-today .day-number {
    color: var(--accent);
}

.day-today .day-number:after {
    background-color: var(--accent);
    width: 25px;
}

.day-today:before {
    content: "AUJOURD'HUI";
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.day-empty {
    background-color: rgba(10, 10, 10, 0.3);
    border-color: rgba(255, 255, 255, 0.03);
    box-shadow: none;
}

.day-empty:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.03);
    background-color: rgba(10, 10, 10, 0.3);
    box-shadow: none;
}

.calendar-event {
    padding: 3px 6px;
    margin-bottom: 3px;
    font-size: 0.75rem;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: all var(--transition-fast);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: rgba(22, 22, 22, 0.9);
    border-left: 3px solid var(--accent);
    text-decoration: none;
    color: var(--text-primary);
}

.calendar-event:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.event-tv {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.15);
}

.event-anime {
    border-color: #9b59b6;
    background-color: rgba(155, 89, 182, 0.15);
}

.event-movie {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.15);
}

.event-more {
    background-color: rgba(50, 50, 50, 0.7);
    border-color: #999;
    color: #ccc;
    font-style: italic;
    text-align: center;
    justify-content: center;
}

.event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: white;
    flex-shrink: 0;
}

.event-tv .event-dot {
    background-color: #3498db;
}

.event-anime .event-dot {
    background-color: #9b59b6;
}

.event-movie .event-dot {
    background-color: #e74c3c;
}

.day-events-container {
    position: relative;
    max-width: 1600px;
    margin: 0 auto;
}

.day-events-header {
    margin-bottom: 30px;
}

.day-events-count {
    color: var(--accent);
    font-weight: 800;
}

.day-events-date {
    position: relative;
    display: inline-block;
    padding-bottom: 6px;
}

.day-events-date::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.day-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    gap: 16px;
}

.day-search-container {
    margin-top: 20px;
}

.event-search-input {
    width: 100%;
    padding: 16px 45px 16px 50px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.event-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.3);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: rgba(255, 255, 255, 0.5);
    transition: stroke 0.3s ease;
}

.event-search-input:focus + .search-icon {
    stroke: var(--accent);
}

.search-clear-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    background: none;
    border: none;
    color: white;
    border-radius: 50%;
}

.event-search-input:not(:placeholder-shown) + .search-icon + .search-clear-button {
    opacity: 1;
    visibility: visible;
}

.search-clear-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.day-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.pagination-info {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-info .page-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 600;
    color: white;
}

.pagination-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    text-decoration: none;
}

.pagination-btn:hover:not([disabled]) {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.3);
}

.pagination-btn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-btn svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

.pages-jump {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.page-number {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.9rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.page-number:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.page-number.active {
    background: var(--accent);
    border-color: var(--accent);
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}

.page-divider {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 2px;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin: 20px 0;
    animation: fadeIn 0.5s forwards;
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.no-results svg {
    width: 48px;
    height: 48px;
    stroke: rgba(255, 255, 255, 0.3);
    margin-bottom: 15px;
}

.event-card {
    position: relative;
    background: rgba(25, 25, 30, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    animation: riseUp 0.5s forwards;
    animation-delay: calc(var(--card-index, 0) * 0.06s);
    opacity: 0;
    transform: translateY(30px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    height: 100%;
    will-change: transform, box-shadow;
    cursor: pointer;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.event-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 25px rgba(229, 9, 20, 0.25);
    border-color: rgba(255, 255, 255, 0.2);
    z-index: 5;
}

.event-card:hover::before {
    opacity: 1;
}

.event-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, 
                                rgba(229, 9, 20, 0.1), 
                                transparent 80%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
    border-radius: 18px;
}

.event-card:hover::after {
    opacity: 1;
}

.event-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 1;
}

.event-image {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
}

.event-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        0deg,
        rgba(25, 25, 30, 1) 0%,
        rgba(25, 25, 30, 0.8) 40%,
        rgba(25, 25, 30, 0) 100%
    );
    z-index: 1;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform;
}

.event-card:hover .event-image img {
    transform: scale(1.08) rotate(1deg);
}

.event-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: white;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.08em;
}

.event-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 2px;
}

.badge-tv, .event-badge.badge-tv {
    background: linear-gradient(135deg, rgba(32, 84, 168, 0.9), rgba(41, 128, 185, 0.9));
}

.badge-tv::before, .event-badge.badge-tv::before {
    background-color: #5CB3FF;
    box-shadow: 0 0 8px #5CB3FF;
}

.badge-anime, .event-badge.badge-anime {
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.9), rgba(125, 60, 152, 0.9));
}

.badge-anime::before, .event-badge.badge-anime::before {
    background-color: #DA70D6;
    box-shadow: 0 0 8px #DA70D6;
}

.badge-movie, .event-badge.badge-movie {
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.9), rgba(169, 50, 38, 0.9));
}

.badge-movie::before, .event-badge.badge-movie::before {
    background-color: #FF6B6B;
    box-shadow: 0 0 8px #FF6B6B;
}

.event-details {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
}

.event-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: white;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: color 0.3s ease;
}

.event-card:hover .event-title {
    color: #fff;
}

.event-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.event-card:hover .event-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

.event-meta {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s ease;
}

.event-card:hover .event-meta {
    border-color: rgba(255, 255, 255, 0.2);
}

.event-time, .event-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.event-time {
    color: rgba(255, 255, 255, 0.6);
}

.event-card:hover .event-time {
    color: rgba(255, 255, 255, 0.8);
}

.event-rating {
    color: #FFD700;
}

.event-time svg, .event-rating svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.event-card:hover .event-time svg,
.event-card:hover .event-rating svg {
    transform: scale(1.15);
}

.episode-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: opacity;
}

.episode-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    background-color: rgba(20, 20, 25, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    width: 95%;
    max-width: 2000px;
    max-height: 100vh;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6), 
                0 0 100px rgba(229, 9, 20, 0.25);
    transform: translateY(40px) scale(0.95);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform, opacity;
}

.episode-modal.show .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-image {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform;
}

.modal-image img.loading {
    opacity: 0;
}

.modal-image img.loaded {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.modal-image img.error {
    opacity: 0.7;
}

.episode-modal.show .modal-image img {
    transform: scale(1.05);
}

.modal-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        0deg,
        rgba(20, 20, 25, 1) 0%,
        rgba(20, 20, 25, 0.9) 30%,
        rgba(20, 20, 25, 0.5) 60%,
        rgba(20, 20, 25, 0.2) 80%,
        rgba(20, 20, 25, 0) 100%
    );
    z-index: 1;
}

.modal-badge {
    position: absolute;
    top: 25px;
    left: 25px;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    color: white;
    z-index: 2;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 2px;
    animation: pulse 2s infinite;
}

.badge-tv {
    background: linear-gradient(135deg, rgba(32, 84, 168, 0.9), rgba(41, 128, 185, 0.9));
}

.badge-tv::before {
    background-color: #5CB3FF;
    box-shadow: 0 0 10px #5CB3FF;
}

.badge-anime {
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.9), rgba(125, 60, 152, 0.9));
}

.badge-anime::before {
    background-color: #DA70D6;
    box-shadow: 0 0 10px #DA70D6;
}

.badge-movie {
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.9), rgba(169, 50, 38, 0.9));
}

.badge-movie::before {
    background-color: #FF6B6B;
    box-shadow: 0 0 10px #FF6B6B;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}

.modal-close:hover {
    background-color: var(--accent);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.5);
}

.modal-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.modal-close svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.modal-details {
    position: relative;
    padding: 0 60px 45px;
    margin-top: -80px;
    z-index: 2;
    overflow-y: auto;
    max-height: calc(92vh - 320px);
    scrollbar-width: thin;
    scrollbar-color: rgba(229, 9, 20, 0.5) rgba(0, 0, 0, 0.2);
}

.modal-details::-webkit-scrollbar {
    width: 6px;
}

.modal-details::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.modal-details::-webkit-scrollbar-thumb {
    background: rgba(229, 9, 20, 0.5);
    border-radius: 6px;
}

.modal-details::-webkit-scrollbar-thumb:hover {
    background: rgba(229, 9, 20, 0.7);
}

.modal-title {
    font-size: 3rem;
    font-weight: 900;
    color: white;
    margin-bottom: 12px;
    line-height: 1.2;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
    background: linear-gradient(90deg, #ffffff, #cccccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.modal-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 24px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.modal-info {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.modal-info-item:hover {
    color: rgba(255, 255, 255, 1);
}

.modal-info-item svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent);
    filter: drop-shadow(0 0 5px rgba(229, 9, 20, 0.3));
    transition: transform 0.3s ease;
}

.modal-info-item:hover svg {
    transform: translateY(-2px) scale(1.1);
}

.modal-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.modal-rating::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    transition: width 0.3s ease;
}

.modal-rating:hover::after {
    width: 100%;
}

.modal-rating svg {
    width: 26px;
    height: 26px;
    fill: #FFD700;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
    transition: transform 0.3s ease;
}

.modal-rating:hover svg {
    transform: rotate(15deg) scale(1.1);
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 35px;
    position: relative;
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    border-left: 4px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease;
}

.modal-description::before {
    content: '"';
    position: absolute;
    top: 5px;
    left: 12px;
    font-size: 4rem;
    line-height: 1;
    color: rgba(229, 9, 20, 0.15);
    font-family: Georgia, serif;
}

.modal-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 16px 32px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.03em;
}

.modal-btn.animated {
    animation: fadeIn 0.5s forwards;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--accent), #ff3d47);
    color: white;
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.4);
}

.modal-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    transition: 0.6s;
}

.modal-btn-primary:hover::before {
    left: 100%;
}

.modal-btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(229, 9, 20, 0.6);
}

.modal-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.25);
}

.modal-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.modal-btn:hover svg {
    transform: translateX(4px);
}

.modal-btn-primary:active, .modal-btn-secondary:active {
    transform: translateY(-2px);
    transition: all 0.1s ease;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.mobile-day-name {
    display: none !important;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    position: relative;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
}

@media (min-width: 1200px) {
    .calendar-days {
        gap: 10px;
    }
    
    .calendar-day {
        min-height: 150px;
    }
    
    .day-header {
        font-size: 0.95rem;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .calendar-days {
        gap: 8px;
    }
    
    .calendar-day {
        min-height: 130px;
        max-height: 200px;
        padding: 8px;
    }
    
    .day-number {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .calendar-event {
        font-size: 0.7rem;
        padding: 3px 5px;
        margin-bottom: 3px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .calendar-days {
        gap: 6px;
    }
    
    .calendar-day {
        min-height: 110px;
        max-height: 180px;
        padding: 8px;
    }
    
    .day-header {
        font-size: 0.8rem;
    }
    
    .day-number {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    
    .calendar-event {
        font-size: 0.65rem;
        padding: 2px 4px;
        margin-bottom: 2px;
    }
    
    .calendar-month {
        font-size: 1.3rem;
    }
    
    .filter-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
    
    .event-count {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }
}

@media (max-width: 767px) {
    .day-header {
        display: none;
    }
    
    .mobile-day-name {
        display: block !important;
        margin-bottom: 3px;
    }
    
    .day-today:before {
        display: none;
    }
    
    .day-today {
        border: 2px solid var(--accent);
        background-color: rgba(229, 9, 20, 0.08);
        box-shadow: 0 0 12px rgba(229, 9, 20, 0.2);
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .calendar-days {
        gap: 5px;
    }
    
    .calendar-day {
        min-height: 85px;
        max-height: 140px;
        padding: 8px;
    }
    
    .day-number {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .calendar-event {
        font-size: 0.65rem;
        padding: 2px 4px;
        margin-bottom: 2px;
    }
    
    .filter-tabs {
        padding: 10px;
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    .calendar-month {
        font-size: 1.2rem;
    }
    
    .nav-button {
        width: 35px;
        height: 35px;
    }
    
    .event-count {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
}

@media (max-width: 575px) {
    .calendar-header {
        margin-bottom: 30px;
    }
    
    .calendar-days {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    
    .mobile-day-name {
        display: block !important;
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    
    .calendar-day {
        min-height: 70px;
        max-height: 110px;
        padding: 6px;
    }
    
    .day-number {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
    
    .calendar-event {
        font-size: 0.6rem;
        padding: 2px 3px;
        margin-bottom: 2px;
    }
    
    .filter-tabs {
        padding: 8px;
        gap: 6px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .filter-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .calendar-month {
        font-size: 1.1rem;
    }
    
    .nav-button {
        width: 30px;
        height: 30px;
    }
    
    .nav-button svg {
        width: 16px;
        height: 16px;
    }
    
    .event-count {
        width: 14px;
        height: 14px;
        font-size: 0.55rem;
    }
    
    .calendar-nav {
        margin: 20px 0;
        padding: 10px 0;
    }
}

@media (max-width: 767px) and (orientation: landscape) {
    .calendar-days {
        grid-template-columns: repeat(7, 1fr);
    }
    
    .calendar-day {
        min-height: 65px;
        max-height: 100px;
    }
    
    .mobile-day-name {
        display: block !important;
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
}

@media (pointer: coarse) {
    .filter-btn, .calendar-event, .modal-btn {
        min-height: 44px;
    }
}