/* ========= Reset ========= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

@font-face {
  font-family: IRANSans;
  font-style: normal;
  font-weight: 400;
  src: url(/fonts/IRANSansWeb.eot);
  src: local("☺︎"), url(/fonts/IRANSansWeb.eot?#iefix) format("embedded-opentype"), url(/fonts/IRANSansWeb.woff2) format("woff2"), url(/fonts/IRANSansWeb.woff) format("woff"), url(/fonts/IRANSansWeb.ttf) format("truetype");
}
html{
    scroll-behavior:smooth;
}

body{
    font-family:IRANSans,sans-serif;
    background:#f5f5f5;
    color:#222;
    direction:rtl;
    transition:.3s;
}

/* ========= Dark Mode ========= */

body.dark{
    background:#111827;
    color:#fff;
}

/* ========= Container ========= */

.container{
    width:min(1300px,95%);
    margin:auto;
}

/* ========= Header ========= */

header{
    position:sticky;
    top:0;
    z-index:100;
    background:#fff;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
    padding:20px 0;
}

body.dark header{
    background:#1f2937;
}

header h1{
    text-align:center;
    margin-bottom:20px;
    color:#e53935;
}

.search-box{
    display:flex;
    gap:10px;
}

.search-box input{
    flex:1;
    height:48px;
    border:none;
    border-radius:12px;
    background:#eee;
    padding:0 18px;
    font-size:15px;
    outline:none;
}

body.dark .search-box input{
    background:#374151;
    color:white;
}

.search-box button{
    width:48px;
    border:none;
    border-radius:12px;
    cursor:pointer;
    font-size:22px;
    background:#ff1744;
    color:white;
}

/* ========= Grid ========= */

.videos-grid{

    margin-top:30px;

    display:grid;

    grid-template-columns:
        repeat(auto-fill,minmax(320px,1fr));

    gap:25px;

}

/* ========= Card ========= */

.card{

    background:white;

    border-radius:18px;

    overflow:hidden;

    cursor:pointer;

    transition:.25s;

    box-shadow:
        0 5px 18px rgba(0,0,0,.08);

}

body.dark .card{

    background:#1f2937;

}

.card:hover{

    transform:translateY(-6px);

    box-shadow:
        0 15px 35px rgba(0,0,0,.18);

}

/* ========= Thumbnail ========= */

.thumb{

    position:relative;

    overflow:hidden;

}

.poster{

    width:100%;

    display:block;

    aspect-ratio:16/9;

    object-fit:cover;

    transition:.4s;

}

.card:hover .poster{

    transform:scale(1.06);

}

/* ========= Play ========= */

.play{

    position:absolute;

    left:50%;

    top:50%;

    transform:translate(-50%,-50%);

    width:72px;

    height:72px;

    border-radius:50%;

    background:rgba(0,0,0,.65);

    color:white;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:32px;

    opacity:0;

    transition:.3s;

}

.card:hover .play{

    opacity:1;

}

/* ========= Duration ========= */

.duration{

    position:absolute;

    bottom:12px;

    left:12px;

    background:rgba(0,0,0,.8);

    color:white;

    padding:4px 10px;

    border-radius:6px;

    font-size:13px;

}

/* ========= Content ========= */

.content{

    padding:16px;

}

.title{

    font-size:16px;

    line-height:1.8;

    height:58px;

    overflow:hidden;

}

.details{

    margin-top:12px;

    display:flex;

    justify-content:space-between;

    font-size:13px;

    color:#666;

}

body.dark .details{

    color:#d1d5db;

}

/* ========= Loading ========= */

.loading{

    text-align:center;

    padding:60px;

}

.spinner{

    width:45px;

    height:45px;

    border:5px solid #ddd;

    border-top-color:#ff1744;

    border-radius:50%;

    margin:auto;

    animation:spin .8s linear infinite;

}

@keyframes spin{

    to{

        transform:rotate(360deg);

    }

}

/* ========= Modal ========= */

.modal{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.75);

    display:none;

    justify-content:center;

    align-items:center;

    z-index:999;

    padding:20px;

}

.modal.active{

    display:flex;

}

.modal-content{

    background:white;

    width:min(1100px,95%);

    border-radius:18px;

    overflow:hidden;

    position:relative;

}

body.dark .modal-content{

    background:#1f2937;

}

#player iframe{

    width:100%;

    aspect-ratio:16/9;

    border:0;

}

.video-info{

    padding:20px;

}

.video-info h2{

    margin-bottom:15px;

    font-size:20px;

}

.meta{

    display:flex;

    gap:20px;

    color:#777;

}

body.dark .meta{

    color:#ddd;

}

/* ========= Close ========= */

.close{

    position:absolute;

    top:15px;

    left:15px;

    width:42px;

    height:42px;

    border:none;

    border-radius:50%;

    cursor:pointer;

    font-size:20px;

    background:#ff1744;

    color:white;

    z-index:20;

}

main{
	min-height: calc(100vh - 310px);
}

/* ========= Footer ========= */

footer{

    margin-top:50px;

    padding:30px;

    text-align:center;

    background-color: white;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, .08);
}

body.dark footer{

    color:#ccc;

}

/* ========= Responsive ========= */

@media(max-width:768px){

    header h1{

        font-size:22px;

    }

    .videos-grid{

        grid-template-columns:1fr;

    }

    .title{

        height:auto;

    }

    .meta{

        flex-direction:column;

        gap:10px;

    }

}