body {
    font-family: 'Vazir', sans-serif;
    direction: rtl;
    background: linear-gradient(180deg, #121212 0%, #0a2b2f 100%);
    color: #FFFFFF;
    margin: 0;
    padding: 0;
}

.header {
    background-color: #121212;
    padding: 16px;
    box-shadow: 0 0 20px rgba(255, 234, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo img {
    height: 80px;
    width: auto;
    border: 2px solid #FFEA00;
    border-radius: 3vmin;
}

.logo {
    order: 1;
    margin-right: 20px;
}

.search-form {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
    order: 3;
}

.search-form input {
    width: 80%;
    padding: 8px;
    border: 2px solid #FFEA00;
    border-radius: 8px;
    background-color: #121212;
    color: #FFFFFF;
    outline: none;
    transition: box-shadow 0.3s;
}

.search-form input::placeholder {
    color: #CCCCCC;
    opacity: 1;
}

.search-form input:focus {
    box-shadow: 0 0 12px #FFEA00;
}

.nav {
    order: 2;
    margin-left: 300px;
}

.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav ul li {
    margin: 0 5px;
}

.nav ul li a {
    color: #FFEA00;
    text-shadow: 0 0 5px #FFEA00;
    text-decoration: none;
    padding: 10px;
    transition: color 0.3s, text-shadow 0.3s;
    font-weight: 700;
    font-size: 1.4em;
}

.nav ul li a:hover {
    color: #FFF333;
    text-shadow: 0 0 8px #FFF333;
}

.main-grid {
    display: grid;
    grid-template-columns: 4fr 1fr;
    gap: 10px;
    max-width: 1600px;
    margin: 20px auto;
    padding: 10px 5px;
    min-height: calc(100vh - 80px);
}

.content-section {
    background-color: #121212;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(255, 234, 0, 0.4);
    transition: transform 0.3s;
}

.content-section:hover {
    transform: scale(1.02);
}

.section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title {
    font-size: 1.5em;
    color: #FFEA00;
    text-shadow: 0 0 5px #FFEA00;
}

.section-more-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    background-color: #FFEA00;
    color: #000000;
    box-shadow: 0 0 12px #FFEA00, 0 0 24px #FFEA00;
    text-decoration: none;
    transition: all 0.3s;
}

.section-more-btn:hover {
    background-color: #FFF333;
}

.movie-carousel {
    display: flex;
    gap: 10px;
    padding-bottom: 10px;
    overflow-x: auto;
    flex-wrap: wrap;
}

.movie-carousel.updated {
    flex-wrap: nowrap;
}

.movie-card {
    background-color: #121212;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    box-shadow: 0 0 15px rgba(255, 234, 0, 0.4);
    transition: transform 0.3s;
    width: calc((100% / 6) - 0px);
    min-width: 120px; /* افزایش عرض برای عکس‌های بزرگتر */
    height: 200px; /* افزایش ارتفاع برای عکس‌های بزرگتر */
}

.movie-card:hover {
    transform: scale(1.05);
}

.movie-card img {
    width: 100px; /* افزایش عرض تصویر */
    height: 150px; /* افزایش ارتفاع تصویر */
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #FFEA00;
    cursor: pointer;
}

.movie-info {
    text-align: center;
    color: #FFFFFF;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.movie-info h4 {
    margin: 0 0 5px;
    color: #FFEA00;
    font-size: 0.9em; /* افزایش اندازه فونت برای تناسب */
}

.movie-info h5 {
    margin: 0 0 5px;
    color: #FFEA00;
    font-size: 0.6em;
}

.play-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    background-color: #FFEA00;
    color: #FFFFFF;
    box-shadow: 0 0 12px #FFEA00, 0 0 24px #FFEA00;
    text-decoration: none;
    transition: all 0.3s;
}

.play-btn:hover {
    background-color: #FFF333;
}

.more-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    background-color: #FFEA00;
    color: #000000;
    box-shadow: 0 0 12px #FFEA00, 0 0 24px #FFEA00;
    text-decoration: none;
    transition: all 0.3s;
}

.more-btn:hover {
    background-color: #FFF333;
}

.download-btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    background-color: #FFEA00;
    color: #000000;
    box-shadow: 0 0 12px #FFEA00, 0 0 24px #FFEA00;
    text-decoration: none;
    transition: all 0.3s;
    margin: 4px;
}

.download-buttons-container {
    display: flex;
    justify-content: flex-start;
    gap: 0.25em;
}

.episode-download-section .download-buttons-container .download-btn {
    margin: 0;
    border-radius: 0;
}

.episode-download-section .download-buttons-container .download-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.episode-download-section .download-buttons-container .download-btn:last-child {
    border-radius: 0 8px 8px 0;
}

.download-btn:hover {
    background-color: #FFF333;
}

.movie-details {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.movie-director, .movie-actors, .movie-genre, .movie-about, .episode-download-section {
    background-color: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #FFEA00;
}

.movie-director h3, .movie-actors h3, .movie-genre h3, .movie-about h3, .episode-download-section h3 {
    color: #FFEA00;
    font-size: 1.2em;
    margin: 0 0 10px;
}

.movie-director p, .movie-actors p, .movie-genre p, .movie-about p {
    color: #FFFFFF;
    font-size: 1em;
    margin: 0;
}

.movie-poster {
    width: 280px;
    height: auto;
    border-radius: 8px;
    border: 2px solid #FFEA00;
    margin-bottom: 20px;
}

.ad-section-vertical {
    background: #121212;
    padding: 15px;
    border-radius: 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 40px;
    min-height: calc(100vh - 80px);
    overflow-y: auto;
}

.ad-section-horizontal {
    background: #121212;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 0 15px rgba(255, 234, 0, 0.4);
}

.horizontal-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.ad-banner {
    background: #121212;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 0.9em;
    width: 100%;
    height: 105px;
    min-height: 105px;
    overflow: hidden;
    border: 2px solid #FFEA00;
}

.ad-banner.vertical {
    height: auto;
    min-height: 0;
    border: 2px solid #FFEA00;
}

.ad-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.ad-banner.vertical img {
    height: auto;
}

.episode-item {
    background-color: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #FFEA00;
    margin-bottom: 10px;
}

.episode-item h4 {
    margin: 0 0 10px;
    color: #FFEA00;
}

.admin-section {
    background-color: #121212;
    padding: 15px;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 800px;
    box-shadow: 0 0 15px rgba(255, 234, 0, 0.4);
    transition: transform 0.3s;
}

.admin-section:hover {
    transform: scale(1.02);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    background-color: #121212;
    border: 2px solid #FFEA00;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-button.active {
    background-color: #FFEA00;
    color: #000000;
    box-shadow: 0 0 12px #FFEA00, 0 0 24px #FFEA00;
}

.tab-button:hover {
    background-color: #FFF333;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.login-form, .add-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hidden {
    display: none;
}

.upload-field {
    margin: 10px 0;
}

.code-preview {
    background: #121212;
    padding: 10px;
    border-radius: 8px;
    white-space: pre-wrap;
    border: 2px solid #FFEA00;
}

.ads-list, .movies-list, .animations-list, .series-list {
    margin-top: 20px;
}

.ad-item, .movie-item, .animation-item, .series-item, .episode-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #121212;
    margin: 5px 0;
    border-radius: 8px;
    border: 2px solid #FFEA00;
}

.episode-list {
    margin-top: 20px;
}

.button-container {
    display: flex;
    justify-content: flex-start;
    gap: 0;
}

.delete-btn {
    padding: 5px 10px;
    border-radius: 8px 0 0 8px;
    font-weight: 600;
    background-color: #FF0000;
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.delete-btn:hover {
    background-color: #CC0000;
}

.edit-btn {
    padding: 5px 10px;
    border-radius: 0 8px 8px 0;
    font-weight: 600;
    background-color: #FFEA00;
    color: #000000;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.edit-btn:hover {
    background-color: #FFF333;
}

.logout-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.logout-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    background-color: #FF0000;
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: #CC0000;
}

.add-btn {
    background-color: #FFEA00;
    color: #000000;
}

.add-btn:hover {
    background-color: #FFF333;
}

@media (max-width: 800px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    .ad-section-vertical {
        margin-top: 20px;
    }
    .movie-carousel {
        flex-wrap: wrap;
    }
    .movie-card {
        width: calc((100% / 2) - 10px);
        min-width: 120px;
        height: 180px; /* تنظیم برای موبایل */
    }
    .movie-card img {
        width: 110px; /* افزایش سایز برای موبایل */
        height: 165px;
    }
    .movie-info h4 {
        font-size: 0.9em;
    }
    .movie-info h5 {
        font-size: 0.6em;
    }
    .horizontal-row {
        flex-direction: column;
    }
    .ad-banner {
        height: 70px;
        min-height: 70px;
    }
    .ad-banner.vertical {
        height: auto;
        min-height: 0;
    }
    .download-btn {
        padding: 5px 10px;
        font-size: 0.8em;
    }
    .download-buttons-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    .movie-poster {
        width: 200px;
    }
    .nav ul li a {
        font-size: 1.2em;
    }
}

@media (min-width: 801px) and (max-width: 1200px) {
    .movie-carousel {
        flex-wrap: wrap;
    }
    .movie-card {
        width: calc((100% / 5) - 10px);
        min-width: 110px;
        height: 180px; /* تنظیم برای تبلت */
    }
    .movie-card img {
        width: 90px; /* افزایش سایز برای تبلت */
        height: 135px;
    }
    .movie-info h4 {
        font-size: 0.85em;
    }
    .movie-info h5 {
        font-size: 0.55em;
    }
    .download-btn {
        padding: 5px 10px;
        font-size: 0.8em;
    }
    .download-buttons-container {
        justify-content: flex-start;
    }
    .movie-poster {
        width: 250px;
    }
    .nav ul li a {
        font-size: 1.3em;
    }
}