* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-yellow: #FFD700;
    --light-yellow: #FFF8DC;
    --dark-yellow: #FFA500;
    --white: #FFFFFF;
    --gray: #F5F5F5;
    --text-dark: #333333;
    --text-light: #666666;
}

body {
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--white) 0%, var(--light-yellow) 100%);
    min-height: 100vh;
    color: var(--text-dark);
    direction: rtl;
}

* {
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Landing Page */
.landing-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.geometric-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    opacity: 0.3;
}

.circle {
    position: absolute;
    border-radius: 50%;
    border: 3px solid var(--primary-yellow);
    background: transparent;
}

.circle-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    right: 10%;
    animation: float 6s ease-in-out infinite;
}

.circle-2 {
    width: 150px;
    height: 150px;
    bottom: 15%;
    left: 15%;
    animation: float 8s ease-in-out infinite reverse;
}

.triangle {
    width: 0;
    height: 0;
    position: absolute;
}

.triangle-1 {
    border-left: 80px solid transparent;
    border-right: 80px solid transparent;
    border-bottom: 140px solid var(--primary-yellow);
    top: 20%;
    left: 20%;
    animation: rotate 10s linear infinite;
}

.triangle-2 {
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-top: 100px solid var(--dark-yellow);
    bottom: 25%;
    right: 25%;
    animation: rotate 12s linear infinite reverse;
}

.square {
    position: absolute;
    border: 3px solid var(--primary-yellow);
    background: transparent;
    transform: rotate(45deg);
}

.square-1 {
    width: 120px;
    height: 120px;
    top: 50%;
    right: 30%;
    animation: pulse 4s ease-in-out infinite;
}

.square-2 {
    width: 90px;
    height: 90px;
    bottom: 30%;
    left: 30%;
    animation: pulse 5s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: rotate(45deg) scale(1); }
    50% { transform: rotate(45deg) scale(1.1); }
}

.landing-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 640px;
    width: 100%;
}

.main-title {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary-yellow);
    text-shadow: 3px 3px 6px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    animation: fadeInDown 1s ease-out;
}

.slogan {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.sub-slogan {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.videos-btn {
    display: inline-block;
    padding: 1rem 3rem;
    background: var(--primary-yellow);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease-out 0.9s both;
}

.videos-btn:hover {
    background: var(--dark-yellow);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.landing-buttons-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Video List Page */
.video-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.header-section {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.5rem;
    color: var(--primary-yellow);
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.search-container {
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--primary-yellow);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--dark-yellow);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.search-btn {
    padding: 0.8rem 2rem;
    background: var(--primary-yellow);
    color: var(--text-dark);
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--dark-yellow);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
}

/* Videos List */
.videos-list-container {
    max-width: 800px;
    margin: 2rem auto;
}

.videos-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.video-list-item {
    margin-bottom: 1rem;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.video-list-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.video-list-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.video-list-link:hover {
    background: var(--light-yellow);
}

.video-list-title {
    font-size: 1.2rem;
    font-weight: bold;
    flex: 1;
}

.video-list-date {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-right: 1rem;
}

.no-videos-item {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.2rem;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.video-card {
    background: var(--white);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
    border-color: var(--primary-yellow);
}

.video-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.video-title {
    font-size: 1.3rem;
    color: var(--text-dark);
    font-weight: bold;
    flex: 1;
}

.video-date {
    font-size: 0.9rem;
    color: var(--text-light);
    white-space: nowrap;
}

.video-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.video-player {
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.video-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.download-btn, .view-more-btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    margin: 0.5rem 0.5rem 0.5rem 0;
    background: var(--primary-yellow);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
}

.download-btn:hover, .view-more-btn:hover {
    background: var(--dark-yellow);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
}

.no-videos {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.2rem;
    grid-column: 1 / -1;
}

/* Video Detail Page */
.video-detail-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.back-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: var(--primary-yellow);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 25px;
    margin-bottom: 2rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--dark-yellow);
    transform: translateX(-5px);
}

.video-detail-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid var(--primary-yellow);
}

.detail-title {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.detail-date {
    display: block;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.detail-video-player {
    width: 100%;
    margin-bottom: 2rem;
    border-radius: 15px;
    overflow: hidden;
    background: #000;
    position: relative;
    aspect-ratio: 16 / 9;
}

.detail-video-player video,
.detail-video-player .plyr {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.detail-video-player .plyr__video-wrapper {
    width: 100%;
    height: 100%;
}

.detail-video-player .plyr__poster {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
}

.video-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 15px;
}

.video-loading-overlay.hidden {
    display: none !important;
}

.loading-spinner {
    text-align: center;
    color: var(--primary-yellow);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 215, 0, 0.3);
    border-top-color: var(--primary-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 1rem;
}

.detail-description {
    margin-bottom: 1.5rem;
}

.detail-description h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.detail-description p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1rem;
}

.download-handout-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-yellow);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.download-handout-btn:hover {
    background: var(--dark-yellow);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
}

/* Video Navigation */
.video-navigation {
    display: flex;
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 3px solid var(--light-yellow);
    position: relative;
}

.video-navigation::before {
    content: '';
    position: absolute;
    top: -1px;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-yellow), transparent);
}

.nav-video-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--primary-yellow) 0%, #FFC700 100%);
    border: none;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35),
                0 2px 8px rgba(255, 215, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    font-weight: 600;
}

.nav-video-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-video-btn:hover::before {
    opacity: 1;
}

.nav-video-btn:hover {
    background: linear-gradient(135deg, #FFC700 0%, var(--dark-yellow) 100%);
    transform: translateY(-4px);
    box-shadow: 0 10px 35px rgba(255, 215, 0, 0.5),
                0 4px 15px rgba(255, 215, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.nav-video-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4),
                0 2px 8px rgba(255, 215, 0, 0.2),
                inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-video-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #999;
}

.nav-video-btn.disabled::before {
    display: none;
}

.nav-video-btn.disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
}

.nav-prev {
    text-align: right;
}

.nav-next {
    text-align: left;
    flex-direction: row-reverse;
}

.nav-icon {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-dark);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1),
                0 2px 4px rgba(255, 255, 255, 0.3);
}

.nav-video-btn:hover .nav-icon {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1),
                0 3px 8px rgba(255, 255, 255, 0.4);
}

.nav-prev:hover .nav-icon {
    transform: scale(1.1) translateX(-3px);
}

.nav-next:hover .nav-icon {
    transform: scale(1.1) translateX(3px);
}

.nav-video-btn.disabled .nav-icon {
    color: #999;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.nav-label {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-video-btn:hover .nav-label {
    color: rgba(0, 0, 0, 0.9);
}

.nav-video-btn.disabled .nav-label {
    color: #999;
}

.nav-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.3s ease;
}

.nav-video-btn:hover .nav-title {
    color: var(--text-dark);
}

.nav-video-btn.disabled .nav-title {
    color: #999;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .landing-container {
        align-items: center;
        justify-content: center;
        padding: 3rem 1rem;
    }

    .landing-content {
        padding: 1.5rem 1rem;
    }

    .main-title {
        font-size: 2.4rem;
    }
    
    .slogan {
        font-size: 1.2rem;
    }
    
    .sub-slogan {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .detail-video-player {
        aspect-ratio: 16 / 9;
        min-height: 250px;
    }
    
    .videos-btn {
        padding: 0.7rem 1.6rem;
        font-size: 0.95rem;
        width: 100%;
        max-width: 260px;
    }

    .landing-buttons-group {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .video-card-header {
        flex-direction: column;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .detail-title {
        font-size: 1.5rem;
    }
    
    .video-navigation {
        flex-direction: column;
        gap: 1rem;
        margin-top: 2rem;
        padding-top: 2rem;
    }
    
    .video-navigation::before {
        width: 40px;
    }
    
    .nav-video-btn {
        padding: 1.3rem 1.5rem;
        gap: 1rem;
        border-radius: 14px;
    }
    
    .nav-icon {
        font-size: 1.5rem;
        min-width: 2.4rem;
        height: 2.4rem;
    }
    
    .nav-title {
        font-size: 1rem;
        -webkit-line-clamp: 2;
    }
    
    .nav-label {
        font-size: 0.7rem;
    }
    
    .nav-next {
        flex-direction: row;
    }
    
    .circle-1, .circle-2 {
        width: 100px;
        height: 100px;
    }
    
    .triangle-1 {
        border-left: 40px solid transparent;
        border-right: 40px solid transparent;
        border-bottom: 70px solid var(--primary-yellow);
    }
    
    .triangle-2 {
        border-left: 30px solid transparent;
        border-right: 30px solid transparent;
        border-top: 50px solid var(--dark-yellow);
    }
}

@media (max-width: 480px) {
    .landing-content {
        padding: 1rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .slogan {
        font-size: 1.1rem;
    }
    
    .sub-slogan {
        font-size: 0.9rem;
    }
    
    .video-list-container,
    .video-detail-container {
        padding: 1rem;
    }
    
    .video-card,
    .video-detail-card {
        padding: 1rem;
    }
    
    .detail-video-player {
        aspect-ratio: 16 / 9;
        min-height: 200px;
    }
    
    .video-navigation {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        gap: 0.8rem;
    }
    
    .video-navigation::before {
        width: 30px;
    }
    
    .nav-video-btn {
        padding: 1.2rem 1.3rem;
        gap: 0.9rem;
        border-radius: 12px;
    }
    
    .nav-icon {
        font-size: 1.3rem;
        min-width: 2.2rem;
        height: 2.2rem;
    }
    
    .nav-title {
        font-size: 0.95rem;
        -webkit-line-clamp: 2;
    }
    
    .nav-label {
        font-size: 0.65rem;
    }
}

@media (min-width: 1200px) {
    .videos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1920px) {
    .videos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    padding: 1rem 3rem;
    background: var(--primary-yellow);
    color: var(--text-dark);
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.load-more-btn:hover {
    background: var(--dark-yellow);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    background: var(--primary-yellow);
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
}

/* overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 900;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* ================= MOBILE ================= */

@media (max-width: 768px) {

    .menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        right: -260px;
        top: 0;
        width: 250px;
        height: 100vh;
        transition: right 0.3s ease;
    }

    .sidebar.active {
        right: 0;
    }

    .main-content {
        margin-right: 0;
    }

}
