/* فونت و راست‌چین */
body {
    font-family: Tahoma, sans-serif;
    background: #f9f9f9;
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

.container h2 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #202020;
}

.video-results {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* --- کارت ویدئو --- */
.video-item {
    flex: 0 0 calc(20% - 15px); /* 100 ÷ 5 = 20% */
    box-sizing: border-box;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.video-item a {
    text-decoration: none;
    color: inherit;
}

.thumb-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.thumb-container img {
    width: 100%;
    display: block;
    transition: transform 0.3s;
}

.video-item:hover .thumb-container img {
    transform: scale(1.05);
}

/* مدت زمان ویدئو */
.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
}


.video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.video-info h2 {
    font-size: 1rem;
    margin-bottom: 5px;
    line-height: 1.3;
    height: 2.6em; /* 2 خط */
    overflow: hidden;
}

.video-info p {
    font-size: 0.85rem;
    color: #555;
}


.video-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}
/* --- عنوان ویدئو --- */
.video-item h3 {
    font-size: 16px;
    padding: 10px;
    color: #111;
    line-height: 1.3;
    height: 44px; /* دو خط */
    overflow: hidden;
}




.video-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.main-video {
    flex: 3 1 0;
    min-width: 0;
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.main-video video {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.related-videos {
    flex: 1 1 0;
    min-width: 0;
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.related-item {
    display: flex;
    flex-direction: row; /* تصویر و عنوان کنار هم */
    gap: 10px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.related-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.related-item h4 {
    font-size: 14px;
    margin: 0;
    line-height: 1.2;
}

.related-meta {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.related-link {
    text-decoration: none;
    color: #000;
    display: flex;
    flex-direction: column; /* عنوان و متا زیر هم */
}

.related-thumb-title {
    display: flex;
    gap: 10px;
    align-items: center;
}

.video-description {
    word-wrap: break-word; /* شکستن کلمات طولانی */
    overflow-wrap: break-word;
    white-space: normal;
}

.video-info {
  padding: 10px;
  background-color:#fff;
}
h1 {
    text-align: center;
    margin: 30px 0;
    font-size: 2rem;
}

/* لیست ویدئوها */
.videos-list {
    display: flex;
    flex-wrap: wrap;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 0 20px 50px 20px;
}

/* آیتم ویدئو */
.video-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}




.pagination {
    text-align: center;
    margin: 20px 0;
}

.pagination a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
}

.pagination a.active {
    background: #0073e6;
    color: #fff;
    border-color: #0073e6;
}

  .download-button {
    width: 90%;
    text-align: center;
    background-color: orange !important;
  }

  .category-link , .tag-link {
  background: #c1c1c1;
  border-radius: 10px;
  padding: 5px;
  text-decoration: none;
  color: white;
    }
.video-tags , .video-category {
   padding: 10px;
   }
 
 a[href="index.php"] {
  border-radius: 10px;
  text-decoration: none;
  background-color: orange;
  width: 10%;
  align-content: center;
  margin-right: 10% !important;
  padding: 11px;
  color: white;
 }
  


/* ریسپانسیو موبایل */
@media (max-width: 900px) {
    .video-wrapper {
        display: block;
    }
    .main-video, .related-videos {
        flex: none;
        width: 90%;
        margin-bottom: 20px;
    }
    .related-item {
        flex-direction: row; /* تصویر و عنوان کنار هم */
        align-items: center;
    }

    .related-item h4 {
        font-size: 16px;
    }
    .header-left .logo {
             height: 20px !important;
           }

       .video-item {
        flex: 1 1 100%;
       
    }

    .search-form {
     width: 50% !important;
        }

       .header-center {
 
          }

        .search-btn {
       
    background-image: url("/v/img/search.png");
    background-size: 80% 80%;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    width: 28px;
    height: 28px;
    position: absolute


           }
      .search-box {
         width: 60% !important;
 
            }
        .search-form {
          width: 85% !important;
             }

    h1 {
        font-size: 1.5rem;
    }

    .video-info h2 {
        font-size: 0.9rem;
        height: auto;
    }

    .site-header {
    margin: 0 !important;
    }

   .download-button{

     }


   a[href="index.php"] {
  border-radius: 10px;
  text-decoration: none;
  background-color: orange;
  width: 35% !important;
  align-content: center;
  margin-right: 10% !important;
  padding: 11px;
  color: white;
 }
   
 
 


  .footer-links a {
      font-size: 13px !important;
}

  .icon-btn {
  font-size: 13px !important;
} 

}

/* header style */
.site-header {
    width: 90%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: white;
    border-bottom: 1px solid #ccc;
    position: sticky;
    top: 0;
    z-index: 100;
    margin: 0 4%;
}

.header-left .logo {
    height: 40px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.search-box {
    width: 80%;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 2px;
}
.search-form {
 width: 50%;
}

.search-btn {
     background-image: url("/v/img/search.png");
    background-size: 80% 80%;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    width: 28px;
    height: 28px;
    position: absolute;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

  .icon-btn {
  background: orange;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: 20px;
  text-decoration: none;
  padding: 5px;
  color: black;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.icon-btn:hover {
box-shadow: 0 0 5px rgb(4, 4, 4);

}


.profile-img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
}

/* footer */
.site-footer {
    background: #f9f9f9;
    text-align: center;
    padding: 15px 10px;
    border-top: 1px solid #ccc;
}

.footer-links {
    margin-bottom: 5px;
}

.footer-links a {
color: #161616;
  background-color: orange;
  padding: 5px;
  margin: 5px;
  border-radius: 5px;
text-decoration: none;
}

.footer-links a:hover {
    text-decoration: none;
}

/* دیدگاه‌ها */
.comments-section {
    margin-top: 40px;
}
.comment-item {
    background: #dbdbdb;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}
.comment-item p {
    margin: 5px 0;
}
.comment-form input, .comment-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}
.comment-form button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.comment-form button:hover {
    background-color: #0056b3;
}
