/* videos.php — таза іздеу дизайны + popup modal */

.videos-page{
    background:#fbf3e9;
}

.videos-hero{
    min-height:240px;
    display:flex;
    align-items:center;
    border-bottom:1px solid #ead7bf;
    background:
        radial-gradient(circle at 15% 0%, rgba(226,153,44,.15), transparent 36%),
        radial-gradient(circle at 92% 8%, rgba(6,31,63,.08), transparent 34%),
        #fff8ef;
}

.videos-hero-inner,
.videos-section .container{
    width:calc(100% - 80px);
    max-width:1180px;
    margin:0 auto;
}

.videos-hero h1{
    margin:0 0 12px;
    color:#061f3f;
    font-size:56px;
    line-height:1.02;
    font-weight:900;
    letter-spacing:-.035em;
}

.videos-hero p{
    margin:0;
    color:#173252;
    font-size:19px;
    line-height:1.55;
    font-weight:700;
}

.videos-section{
    padding:36px 0 72px;
}

.videos-top-actions{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    margin-bottom:18px;
}

.back-link,
.home-link{
    height:44px;
    padding:0 20px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:1px solid #ead7bf;
    border-radius:999px;
    background:#fffdf9;
    color:#b86416;
    font-size:15.5px;
    font-weight:900;
    text-decoration:none;
    box-shadow:0 8px 18px rgba(61,34,8,.055);
}

.back-link:hover,
.home-link:hover{
    border-color:#d98a28;
    color:#c26f1f;
}

.videos-controls{
    display:grid;
    grid-template-columns:1fr auto;
    gap:18px;
    align-items:start;
    margin-bottom:28px;
}

.videos-search-form{
    min-width:0;
}

.search-box{
    width:100%;
    min-height:54px;
    display:grid;
    grid-template-columns:54px 1fr 140px;
    align-items:center;
    background:#fffdf9;
    border:1px solid #ead7bf;
    border-radius:999px;
    box-shadow:0 12px 28px rgba(61,34,8,.07);
    overflow:hidden;
}

.search-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    color:#c26f1f;
}

.search-icon svg{
    width:22px;
    height:22px;
    fill:none;
    stroke:currentColor;
    stroke-width:2.4;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.search-box input{
    width:100%;
    min-width:0;
    height:54px;
    border:0;
    outline:0;
    background:transparent;
    color:#061f3f;
    font-size:16px;
    font-weight:700;
    padding:0 12px 0 0;
}

.search-box input::placeholder{
    color:#9b8a78;
    font-weight:600;
}

.search-box button{
    height:44px;
    margin-right:5px;
    border:0;
    border-radius:999px;
    background:linear-gradient(180deg,#e7a142 0%,#c97418 100%);
    color:#fff;
    font-size:15.5px;
    font-weight:900;
    cursor:pointer;
    box-shadow:0 10px 20px rgba(194,111,31,.25);
}

.clear-search{
    display:inline-flex;
    margin-top:10px;
    color:#b86416;
    font-size:14.5px;
    font-weight:900;
    text-decoration:none;
}

.sort-form{
    display:flex;
    align-items:center;
    gap:10px;
    color:#061f3f;
    font-size:16px;
    font-weight:900;
}

.sort-form select{
    min-width:170px;
    height:54px;
    padding:0 18px;
    border:1px solid #ead7bf;
    border-radius:999px;
    background:#fffdf9;
    color:#061f3f;
    font-size:15px;
    font-weight:900;
    outline:0;
    box-shadow:0 8px 18px rgba(61,34,8,.055);
}

.search-result-label{
    margin:-10px 0 24px;
    color:#7c6a57;
    font-size:15px;
    font-weight:900;
}

/* VIDEO CARDS */

.video-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:22px;
}

.video-card{
    background:#fffdf9;
    border:1px solid #ead7bf;
    border-radius:22px;
    overflow:hidden;
    box-shadow:0 14px 32px rgba(61,34,8,.065);
    transition:transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.video-card:hover{
    transform:translateY(-2px);
    border-color:rgba(210,151,82,.9);
    box-shadow:0 18px 38px rgba(61,34,8,.105);
}

.video-frame{
    position:relative;
    width:100%;
    aspect-ratio:16/9;
    background:#fff4df;
    overflow:hidden;
    border:0;
    cursor:pointer;
    padding:0;
    display:block;
}

.video-frame img{
    width:100%;
    height:100%;
    display:block;
    object-fit:cover;
    transition:transform .25s ease;
}

.video-card:hover .video-frame img{
    transform:scale(1.04);
}

.video-placeholder{
    width:100%;
    height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#c26f1f;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.65), transparent 32%),
        linear-gradient(180deg,#fff4df 0%,#ffe7bd 100%);
}

.video-placeholder svg{
    width:58px;
    height:58px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.9;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.play-badge{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%, -50%);
    width:62px;
    height:62px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#ffffff;
    background:rgba(6,31,63,.82);
    box-shadow:0 14px 32px rgba(6,31,63,.28);
    backdrop-filter:blur(4px);
}

.play-badge svg{
    width:30px;
    height:30px;
    margin-left:3px;
    fill:currentColor;
    stroke:none;
}

.video-card-body{
    padding:20px 22px 22px;
}

.video-card h2{
    margin:0 0 10px;
    color:#082a52;
    font-size:21px;
    line-height:1.2;
    font-weight:900;
}

.video-card p{
    margin:0;
    color:#1e3654;
    font-size:15px;
    line-height:1.45;
    font-weight:600;
}

.video-date{
    margin-top:14px;
    color:#9a7a58;
    font-size:13.5px;
    font-weight:800;
}

.videos-count{
    margin-top:34px;
    text-align:center;
    color:#7c6a57;
    font-size:15px;
    font-weight:900;
}

/* PAGINATION */

.media-pagination{
    width:100%;
    max-width:720px;
    margin:26px auto 0;
    padding:10px 14px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    flex-wrap:wrap;
    background:rgba(255,253,249,.72);
    border:1px solid rgba(234,215,191,.85);
    border-radius:999px;
    box-shadow:0 16px 36px rgba(61,34,8,.07), inset 0 1px 0 rgba(255,255,255,.7);
}

.page-numbers{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    flex-wrap:wrap;
}

.page-btn,
.page-number{
    min-width:42px;
    height:42px;
    padding:0 15px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    border:1px solid rgba(225,190,150,.95);
    background:linear-gradient(180deg,#fffdf9 0%,#fff7ed 100%);
    color:#082a52;
    font-size:15px;
    line-height:1;
    font-weight:900;
    text-decoration:none;
    white-space:nowrap;
    box-shadow:0 8px 18px rgba(61,34,8,.055), inset 0 1px 0 rgba(255,255,255,.9);
    box-sizing:border-box;
}

.page-number{
    width:42px;
    padding:0;
}

.page-prev,
.page-next{
    min-width:116px;
    color:#b86416;
}

.page-number.active{
    border-color:#c26f1f;
    background:linear-gradient(180deg,#e7a142 0%,#c97418 100%);
    color:#fff;
}

.page-btn.disabled{
    opacity:.42;
    cursor:not-allowed;
    pointer-events:none;
    background:#fff8ef;
    color:#9a8a78;
    box-shadow:none;
}

.videos-empty{
    padding:56px 32px;
    text-align:center;
    background:#fffdf9;
    border:1px solid #ead7bf;
    border-radius:22px;
    box-shadow:0 12px 28px rgba(61,34,8,.06);
}

/* MODAL */

.video-modal{
    position:fixed;
    inset:0;
    z-index:9999;
    display:none;
    align-items:center;
    justify-content:center;
    padding:28px;
}

.video-modal.is-open{
    display:flex;
}

.video-modal-backdrop{
    position:absolute;
    inset:0;
    background:rgba(3,17,35,.72);
    backdrop-filter:blur(7px);
}

.video-modal-dialog{
    position:relative;
    width:min(1040px, 100%);
    background:#fffdf9;
    border:1px solid rgba(234,215,191,.95);
    border-radius:24px;
    box-shadow:0 30px 80px rgba(0,0,0,.35);
    overflow:hidden;
    animation:videoModalIn .18s ease-out;
}

@keyframes videoModalIn{
    from{opacity:0; transform:translateY(14px) scale(.98)}
    to{opacity:1; transform:translateY(0) scale(1)}
}

.video-modal-head{
    height:64px;
    padding:0 18px 0 24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    border-bottom:1px solid #ead7bf;
    background:#fff8ef;
}

.video-modal-head h2{
    margin:0;
    color:#061f3f;
    font-size:20px;
    line-height:1.2;
    font-weight:900;
}

.video-modal-close{
    width:42px;
    height:42px;
    border:0;
    border-radius:50%;
    background:#061f3f;
    color:#fff;
    font-size:30px;
    line-height:1;
    cursor:pointer;
}

.video-modal-body{
    background:#000;
    aspect-ratio:16/9;
}

.video-modal-body iframe,
.video-modal-body video{
    width:100%;
    height:100%;
    display:block;
    border:0;
    background:#000;
}

.video-modal-body .external-video-link{
    width:100%;
    height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#fff8ef;
}

.video-modal-body .external-video-link a{
    min-height:52px;
    padding:0 24px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    background:#061f3f;
    color:#fff;
    font-weight:900;
    text-decoration:none;
}

body.video-modal-open{
    overflow:hidden;
}

/* RESPONSIVE */

@media(max-width:1100px){
    .video-grid{
        grid-template-columns:repeat(2, minmax(0,1fr));
    }
}

@media(max-width:980px){
    .videos-controls{
        grid-template-columns:1fr;
    }
}

@media(max-width:620px){
    .videos-hero-inner,
    .videos-section .container{
        width:calc(100% - 32px);
    }

    .videos-hero h1{
        font-size:42px;
    }

    .videos-top-actions{
        flex-direction:column;
        align-items:flex-start;
    }

    .search-box{
        grid-template-columns:46px 1fr;
        border-radius:24px;
        padding:6px;
    }

    .search-box button{
        grid-column:1/-1;
        width:100%;
        margin:6px 0 0;
    }

    .sort-form{
        flex-direction:column;
        align-items:flex-start;
    }

    .sort-form select{
        width:100%;
    }

    .video-grid{
        grid-template-columns:1fr;
    }

    .media-pagination{
        border-radius:24px;
    }

    .video-modal{
        padding:12px;
    }

    .video-modal-dialog{
        border-radius:18px;
    }

    .video-modal-head{
        height:auto;
        min-height:58px;
    }

    .video-modal-head h2{
        font-size:16px;
    }
}
