/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 40px 0;
}
.modal-overlay.active { 
	display: flex; 
}
.modal-container {
    background: #0b0f19;
    width: 95%;   
    border-radius: 20px;
    height: fit-content;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
}
.md-close {
    position: absolute;
    top: 30px; right: 40px;
    background: rgba(255,255,255,0.1);
    border: none; color: #fff;
    width: 45px; height: 45px;
    border-radius: 50%; font-size: 32px;
    cursor: pointer; z-index: 20;
}
.loader-box {
    padding: 150px 0;
    text-align: center;
    color: #38bdf8;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}
.error-box {
    padding: 100px 0;
    text-align: center;
    color: #ef4444;
}

/* Backdrop */
.md-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 600px;
    background-size: cover;
    background-position: center 10%;
    z-index: 1;
}
.md-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        #0b0f19 0%,
        rgba(11, 15, 25, 0.5) 30%,
        rgba(11, 15, 25, 0.1) 70%,
        transparent 100%
    );
}

/* Top */
.md-top-header {
    padding: 40px 40px 20px;
    position: relative;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(11,15,25,0.9), transparent);
}
.md-header-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
/* type */
.md-type-tag {
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 900;
    font-size: 11px;
    text-transform: uppercase;
    color: #000;
    display: inline-block;
    letter-spacing: 0.5px;
}
.t-movie { background: #00d4ff;}
.t-tv-series { background: #fbbf24;}
.t-cartoon { background: #ff4d94;}
.t-animated-series { background: #8b5cf6;}
.t-anime { background: #ff7b00;}
/* age-limit */
.md-age-limit {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.md-age-limit.mpaa {
    border-color: #fbbf24;
    color: #fbbf24;
    background: transparent;
}
/* title */
.md-title {
    font-size: 48px;
    font-weight: 900;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}
.md-slogan {
    font-size: 18px;
    font-style: italic;
    margin-top: 14px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

/* Main */
.md-main-grid {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 40px;
    padding: 0 80px 40px 40px;
    align-items: start;
}

/* Left */
.md-left-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* poster */
.md-main-poster {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
/* rating */
.md-poster-ratings {
    display: flex;
    gap: 10px;
}
.md-p-rate {
    flex: 1;
    background: rgba(255,255,255,0.03);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
}
.md-p-rate .val {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
}
.md-p-rate .votes {
    font-size: 12px;
    color: #fff;
    display: block;
    opacity: 0.8;
    margin: 2px 0;
}
.lbl.kp{
    color: #FF6600;
}
.lbl.imdb{
    color: #F5C518;
}
/* action buttons */
.md-poster-actions {
    display: flex;
    justify-content: space-around;
    background: rgba(255,255,255,0.03);
    padding: 12px 0;
    border-radius: 12px;
    width:100%;
}
.md-poster-actions .status-btn svg {
    width: 30px;
    height: 30px;
    stroke: #94a3b8;
}
.status-btn.active-watched svg {
    stroke: var(--accent);
    fill: rgba(56, 189, 248, 0.2);
}
.status-btn.active-planned svg {
    stroke: #fbbf24;
    fill: #fbbf24;
}
.status-btn.active-liked svg {
    stroke: #ef4444;
    fill: #ef4444;
}
/* play buttons */
.btn-play-trailer {
    width: 100%;
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}
.btn-play {
    width: 100%;
    background: #22c55e;
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}

/* Center */
.md-center-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 10;
}
.backdrop-top{
    margin-top: 350px;
}
.backdrop-none{
    margin-top: 50px;
}
.backdrop-zero{
    margin-top: 0px!important;
}
.md-details-bottom {
    padding-top: 10px;
}
/* genres */
.md-genres-line {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}
/* description */
.md-description {
    font-size: 17px;
    line-height: 1.8;
    color: #cbd5e1;
    margin: 6px 0 20px;
}
/* logo */
.movie-logo{
    text-align: center;
}
/* info table */
.md-facts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    padding: 10px 20px;
    margin: 20px 0;
}
.md-fact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.md-fact-item:nth-last-child(-n+2) {
    border-bottom: none;
}
.md-fact-item .lbl {
    color: #94a3b8;
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
    margin-right: 15px;
}
.md-fact-item .val {
    color: #fff;
    font-size: 14px;
    text-align: right;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* watch links */
.md-watch-section {
    margin: 24px 0;
}
.md-watch-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}
.md-watch-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(11, 15, 25, 0.6);
    backdrop-filter: blur(5px);
    padding: 8px 14px;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}
.md-watch-link:hover {
    background: rgba(11, 15, 25, 0.9);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.md-provider-logo {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: contain;
}
.md-provider-name {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}
/* player */
#player-container{
    text-align: center;
}
.video-responsive {
    position: relative;
    height: 590px;
}
.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Right */
.md-team-header-block {
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: brightness(1);
    padding: 0 20px 10px;
    margin-bottom: 0;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 300px;
    max-height: 682px;
    overflow-y: auto;
    position: relative;
    z-index: 10;
}
.md-team-header-block::-webkit-scrollbar {
    width: 4px;
}
.md-team-header-block::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1); border-radius: 10px;
}
.md-persons-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
}
.md-sec-title {
    font-size: 16px;
    color: var(--accent);
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 1px;
}
.md-person-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0;
    transition: transform 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}
.md-person-item:hover {
    transform: translateX(5px);
}
.md-person-img {
    max-height: 70px;
    border-radius: 20%;
    object-fit: fill;
    border: 2px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}
.md-person-img.director {
    border-color: var(--accent);
}
.md-person-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.md-person-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bottom */
.bottom_full_length {
    padding: 20px 40px 40px;
    position: relative;
    z-index: 5;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.01);
}
.md-horizontal-list {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}
.md-horizontal-list::-webkit-scrollbar {
    height: 4px;
}
.md-horizontal-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}
.md-sim-item {
    width: 150px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    cursor: pointer;
}
.md-sim-item:hover {
    transform: translateY(-5px);
}
.md-sim-item img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}
.md-sim-item span {
    font-size: 14px;
    font-weight: 500;
    color: #cbd5e1;
    display: block;
    text-align: center;
    line-height: 1.3;
}

/* MOBILE */
@media (max-width: 1024px) {
    /* Backdrop */
    .md-backdrop{
        display: none;
    }
    /* Main */
    .md-main-grid {
        grid-template-columns:  1fr;
        padding: 0 30px 30px;
    }
    .backdrop-top{
        margin-top: 0;
    }
    /* Right */
    .md-team-header-block {
        margin: 0 auto;
        max-width: 100%;
        max-height: 100%;
    }
    .md-persons-list {
        grid-template-columns: 1fr 1fr;
    }
    .md-persons-list h3{
        display: none;
    }
}
@media (max-width: 768px) {
    /* Modal */
    .modal-overlay {
        padding: 0;
    }
    .modal-container {
        width: 100%;
        border-radius: 0;
    }
    .md-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    /* Backdrop */
    .md-backdrop {
        height: 350px;
    }
    /* Top */
    .md-top-header {
        padding: 60px 20px 20px;
    }
    .md-title {
        font-size: 28px;
    }
    /* Main */
    .md-main-grid {
        grid-template-columns: 1fr;
        padding: 0 20px 30px;
        gap: 20px;
    }
    /* Left */
    .md-left-col {
        align-items: center;
    }
    .md-main-poster {
        max-width: 220px;
        margin: 0 auto;
    }
    .md-poster-ratings {
        width: 100%;
    }
    /* Center */
    .backdrop-top {
        margin-top: 20px;
    }
    .md-facts-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .md-fact-item {
        flex-direction: row;
        justify-content: space-between;
    }
    .md-fact-item:nth-last-child(2) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    /* Right */
    .md-team-header-block {
        max-width: fit-content;
    }
    .md-persons-list {
        grid-template-columns: 1fr;
    }
    .md-person-img {
        width: 48px;
        height: 70px;
    }
    /* Bottom */
    .md-horizontal-list {
        gap: 12px;
    }
    .md-sim-item {
        width: 130px;
    }
}
@media (max-width: 480px) {
    /* Top */
    .md-header-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
    .md-title {
        font-size: 24px;
    }
    /* Left */
    .md-poster-ratings {
        flex-direction: row;
    }
    .md-p-rate .val {
        font-size: 18px;
    }
    .btn-play, .btn-play-trailer {
        padding: 12px;
        font-size: 14px;
    }
    /* Right */
    .md-team-header-block {
        max-width: fit-content;
    }
}