/* ==========================================================================
   Dedicated Calendar (Takvim) Page Styles
   ========================================================================== */

:root {
    --cal-card-bg: rgba(20, 20, 26, 0.75);
    --cal-card-border: rgba(255, 255, 255, 0.08);
    --cal-card-hover-border: rgba(var(--primary-rgb, 0, 255, 163), 0.45);
}

body.calendar-page {
    background-color: #0b0b0e;
    background-image: radial-gradient(circle at 50% -80px, rgba(var(--primary-rgb, 0, 255, 163), 0.08) 0%, transparent 60%);
    color: #e0e0e0;
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Header Navigation (Exact match to Movies / Category screen)
   -------------------------------------------------------------------------- */
header#header,
header {
    background: rgba(14, 14, 18, 0.88) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    padding: 14px 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 100 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-sizing: border-box !important;
}

header .logo-link {
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
}

header .logo {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: var(--primary-color, #00ffa3) !important;
    font-family: 'Montserrat', sans-serif !important;
    letter-spacing: 0.5px !important;
    text-shadow: 0 0 10px rgba(var(--primary-rgb, 0, 255, 163), 0.4) !important;
}

@media (max-width: 768px) {
    header#header,
    header {
        padding: 12px 5% !important;
    }
}

@media (max-width: 576px) {
    header .logo {
        font-size: 24px !important;
    }
}

/* --------------------------------------------------------------------------
   Calendar Main Container
   -------------------------------------------------------------------------- */
.calendar-main {
    flex: 1;
    padding: 100px 5% 50px;
    max-width: 1400px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Calendar Header Bar (Title & Today Date Chip)
   -------------------------------------------------------------------------- */
.calendar-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.title-area {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.today-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 0.82rem;
    font-family: 'Poppins', sans-serif;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.live-pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color, #00ffa3);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--primary-color, #00ffa3);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 0, 255, 163), 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(var(--primary-rgb, 0, 255, 163), 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 0, 255, 163), 0); }
}

/* --------------------------------------------------------------------------
   Sliding Day Tabs (Segmented Control)
   -------------------------------------------------------------------------- */
.calendar-tabs-wrapper {
    background: rgba(18, 18, 24, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.calendar-tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.day-tabs-slider {
    display: flex;
    gap: 6px;
    min-width: max-content;
    width: 100%;
}

.day-tab {
    position: relative;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.65);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
}

.day-tab .day-short {
    display: none;
}

.day-tab .day-full {
    display: inline;
}

.day-tab .day-label {
    display: inline;
}

.day-tab .day-count {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
}

.day-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.day-tab.active {
    background: var(--primary-color, #00ffa3);
    color: #0b0b0e;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb, 0, 255, 163), 0.35);
}

.day-tab.active .day-count {
    background: rgba(0, 0, 0, 0.25);
    color: #0b0b0e;
    font-weight: 800;
}

.day-tab.is-today:not(.active)::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: var(--primary-color, #00ffa3);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--primary-color, #00ffa3);
}

/* --------------------------------------------------------------------------
   Day Blocks & Show Cards Grid
   -------------------------------------------------------------------------- */
.day-block {
    margin-bottom: 36px;
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInDay 0.4s ease forwards;
}

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

.day-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--primary-color, #00ffa3);
    border-radius: 0 10px 10px 0;
    margin-bottom: 18px;
}

.day-block-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-today-pill {
    padding: 3px 9px;
    background: var(--primary-color, #00ffa3);
    color: #0b0b0e;
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 20px;
    letter-spacing: 0.8px;
}

.day-shows-count {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.84rem;
    font-weight: 500;
}

.shows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Individual Show Card */
.show-card {
    background: var(--cal-card-bg);
    border: 1px solid var(--cal-card-border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
}

.show-card:hover {
    transform: translateY(-4px);
    border-color: var(--cal-card-hover-border);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 18px rgba(var(--primary-rgb, 0, 255, 163), 0.15);
}

.card-poster-wrapper {
    position: relative;
    width: 100%;
    height: 175px;
    background-color: #15151c;
    overflow: hidden;
}

.card-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 0.45s ease;
}

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

.poster-overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(14, 14, 18, 0.85) 80%, rgba(20, 20, 26, 0.98) 100%);
    pointer-events: none;
}

/* Badges on Poster */
.badge-time {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(14, 14, 18, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(8px);
}

.badge-time i {
    color: var(--primary-color, #00ffa3);
}

.badge-channel {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(var(--primary-rgb, 0, 255, 163), 0.18);
    border: 1px solid rgba(var(--primary-rgb, 0, 255, 163), 0.35);
    color: var(--primary-color, #00ffa3);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    backdrop-filter: blur(8px);
    text-transform: uppercase;
}

.badge-platform {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge-platform.bldizi {
    background: rgba(255, 64, 129, 0.25);
    border-color: rgba(255, 64, 129, 0.5);
    color: #ff4081;
}

.badge-platform.whodatidols {
    background: rgba(0, 255, 163, 0.2);
    border-color: rgba(0, 255, 163, 0.4);
    color: #00ffa3;
}

/* Card Body */
.card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-episode-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color, #00ffa3);
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.7em;
}

.card-categories {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-summary {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.btn-card-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.22s ease;
    border: none;
}

.btn-card-action.primary {
    background: var(--primary-color, #00ffa3);
    color: #0b0b0e;
}

.btn-card-action.primary:hover {
    background: #ffffff;
    box-shadow: 0 0 14px rgba(var(--primary-rgb, 0, 255, 163), 0.5);
    transform: translateY(-2px);
}

.btn-card-action.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-card-action.secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

/* --------------------------------------------------------------------------
   Empty / Loading State
   -------------------------------------------------------------------------- */
.calendar-loading-placeholder,
.calendar-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(20, 20, 26, 0.45);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.calendar-loading-placeholder i,
.calendar-empty-state i {
    font-size: 2.2rem;
    color: var(--primary-color, #00ffa3);
    margin-bottom: 12px;
}

.calendar-empty-state h3 {
    color: #ffffff;
    font-size: 1.2rem;
    margin: 0 0 6px;
}

.calendar-empty-state p {
    font-size: 0.88rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
}

/* --------------------------------------------------------------------------
   Quick Details Modal
   -------------------------------------------------------------------------- */
.calendar-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.calendar-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.calendar-modal-dialog {
    position: relative;
    z-index: 2;
    background: #14141a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    max-width: 620px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    animation: modalPop 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-show-detail {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 22px;
    padding: 24px;
}

.modal-poster-col img {
    width: 100%;
    height: 275px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-info-col {
    display: flex;
    flex-direction: column;
}

.modal-show-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 8px;
    line-height: 1.25;
}

.modal-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.modal-meta-pill {
    padding: 4px 9px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

.modal-meta-pill.highlight {
    background: rgba(var(--primary-rgb, 0, 255, 163), 0.15);
    border-color: rgba(var(--primary-rgb, 0, 255, 163), 0.35);
    color: var(--primary-color, #00ffa3);
    font-weight: 700;
}

.modal-summary-box {
    margin-bottom: 18px;
    flex: 1;
}

.modal-summary-box h4 {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 6px;
}

.modal-summary-box p {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* --------------------------------------------------------------------------
   Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .modal-show-detail {
        grid-template-columns: 1fr;
    }

    .modal-poster-col {
        text-align: center;
    }

    .modal-poster-col img {
        width: 160px;
        height: 230px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .calendar-main {
        padding: 85px 4% 40px;
    }

    .page-title {
        font-size: 1.45rem;
    }

    .day-tab {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .day-tab .day-short {
        display: inline;
    }

    .day-tab .day-full {
        display: none;
    }

    .shows-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-poster-wrapper {
        height: 160px;
    }
}
