/* ===== GLOBAL STYLES ===== */
:root {
    /* Color Palette */
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFD166;
    --dark-color: #2A2D34;
    --light-color: #F7FFF7;
    --gradient-1: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    --gradient-2: linear-gradient(135deg, #4ECDC4 0%, #56B4D3 100%);

    /* Typography */
    --heading-font: 'Changa', sans-serif;
    --body-font: 'Tajawal', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;

    /* Borders & Shadows */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 24px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    color: var(--dark-color);
    background-color: var(--light-color);
    line-height: 1.6;
    overflow-x: hidden;
    direction: rtl;
    text-align: right;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md) 0;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.8rem;
}

h4 {
    font-size: 1.3rem;
}

p {
    margin-bottom: var(--spacing-sm);
}

.section-heading {
    text-align: center;
    margin-bottom: var(--spacing-md);
    position: relative;
    color: var(--dark-color);
}

.section-heading::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--gradient-1);
    margin: var(--spacing-xs) auto;
    border-radius: 2px;
}

.section-subheading {
    text-align: center;
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto var(--spacing-lg);
    color: #666;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-family: var(--heading-font);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn i {
    margin-left: 8px;
    margin-right: 0;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
    color: white;
}

.btn-secondary {
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.6);
    color: white;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.2rem;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--light-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-animation {
    text-align: center;
}

.balloon {
    width: 40px;
    height: 50px;
    border-radius: 50%;
    margin: 0 10px;
    position: relative;
    display: inline-block;
    animation: float 2s infinite ease-in-out;
}

.balloon::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 15px;
    background-color: inherit;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.balloon-red {
    background-color: var(--primary-color);
    animation-delay: 0s;
}

.balloon-blue {
    background-color: var(--secondary-color);
    animation-delay: 0.2s;
}

.balloon-yellow {
    background-color: var(--accent-color);
    animation-delay: 0.4s;
}

.loading-text {
    margin-top: 20px;
    font-family: var(--heading-font);
    font-size: 1.5rem;
    color: var(--dark-color);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* ===== HEADER ===== */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px;
    margin-right: var(--spacing-xs);
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav ul {
    display: flex;
}

nav ul li {
    margin-right: var(--spacing-md);
    margin-left: 0;
}

nav ul li a {
    color: var(--dark-color);
    font-weight: 600;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-1);
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== HERO SECTION ===== */
.hero {
    background: var(--gradient-2);
    color: white;
    position: relative;
    overflow: hidden;
    padding: var(--spacing-xl) 0 0;
}

.hero .container {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.main-heading {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-md);
    line-height: 1.1;
}

.hero-text {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.hero-animation {
    flex: 1;
    position: relative;
    height: 400px;
}

.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    background-color: var(--accent-color);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.star-1 {
    width: 40px;
    height: 40px;
    top: 20%;
    left: 10%;
    animation: twinkle 3s infinite ease-in-out;
}

.star-2 {
    width: 30px;
    height: 30px;
    top: 60%;
    right: 20%;
    animation: twinkle 4s infinite ease-in-out;
    animation-delay: 1s;
}

.cloud {
    position: absolute;
    background-color: white;
    border-radius: 50px;
}

.cloud-1 {
    width: 100px;
    height: 40px;
    top: 30%;
    right: 30%;
    animation: float-cloud 15s infinite linear;
}

.cloud-1::before,
.cloud-1::after {
    content: '';
    position: absolute;
    background-color: white;
    border-radius: 50%;
}

.cloud-1::before {
    width: 50px;
    height: 50px;
    top: -20px;
    left: 15px;
}

.cloud-1::after {
    width: 30px;
    height: 30px;
    top: -10px;
    left: 60px;
}

.cloud-2 {
    width: 70px;
    height: 30px;
    top: 70%;
    left: 20%;
    animation: float-cloud 20s infinite linear reverse;
}

.cloud-2::before,
.cloud-2::after {
    content: '';
    position: absolute;
    background-color: white;
    border-radius: 50%;
}

.cloud-2::before {
    width: 35px;
    height: 35px;
    top: -15px;
    left: 10px;
}

.cloud-2::after {
    width: 25px;
    height: 25px;
    top: -8px;
    left: 40px;
}

.character {
    position: absolute;
    width: 150px;
    height: 200px;
    background-image: url('assets/character.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.character-1 {
    bottom: 0;
    right: 10%;
    animation: bounce 3s infinite ease-in-out;
}

.wave-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    line-height: 0;
}

.wave-divider svg {
    display: block;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

@keyframes float-cloud {
    0% {
        transform: translateX(-100px);
    }
    100% {
        transform: translateX(calc(100vw + 100px));
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* ===== VIDEO SECTION ===== */
.video-section {
    padding: var(--spacing-xl) 0;
    background-color: white;
}

.video-filter {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background: none;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-family: var(--body-font);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--secondary-color);
    color: white;
}

.refresh-btn {
    margin-right: var(--spacing-md);
    font-size: 0.9rem;
    padding: 8px 16px;
}

.video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.video-card {
    background-color: white;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    position: relative;
}

.video-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--box-shadow-hover);
}

.video-thumbnail {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.1);
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 107, 107, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.video-card:hover .video-play-button {
    opacity: 1;
}

.video-info {
    padding: var(--spacing-sm);
}

.video-title {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    color: #777;
    font-size: 0.9rem;
}

.video-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-lg);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(78, 205, 196, 0.2);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    margin: 0 auto var(--spacing-sm);
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.load-more-container {
    text-align: center;
    margin-top: var(--spacing-lg);
}

.video-count {
    text-align: center;
    margin-bottom: var(--spacing-md);
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.video-count .channel-info {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 5px;
    font-weight: normal;
}

.error-message {
    text-align: center;
    padding: var(--spacing-lg);
    background-color: rgba(255, 107, 107, 0.1);
    border-radius: var(--border-radius-md);
    margin: var(--spacing-md) 0;
}

.error-message p {
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.error-message small {
    display: block;
    margin-top: var(--spacing-xs);
    color: #666;
    font-size: 0.9rem;
}

/* ===== ABOUT SECTION ===== */
.about-section {
    padding: var(--spacing-xl) 0;
    background-color: #f9f9f9;
}

.about-section .container {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.about-content {
    flex: 1;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.feature {
    text-align: center;
    padding: var(--spacing-md);
    background-color: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto var(--spacing-sm);
    color: white;
    font-size: 1.8rem;
}

.about-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.floating-image {
    max-width: 100%;
    animation: float 6s infinite ease-in-out;
}

/* ===== TESTIMONIALS SECTION ===== */
.testimonials-section {
    padding: var(--spacing-xl) 0;
    background-color: white;
}

.testimonials-carousel {
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.testimonial-card {
    background-color: #f9f9f9;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--box-shadow);
    margin: 0 var(--spacing-sm);
}

.testimonial-content {
    font-style: italic;
    margin-bottom: var(--spacing-md);
    position: relative;
}

.testimonial-content::before {
    content: '"';
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.2;
    position: absolute;
    top: -20px;
    left: -10px;
    font-family: Georgia, serif;
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.author-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: var(--spacing-sm);
    margin-right: 0;
    border: 3px solid var(--primary-color);
}

.author-info h4 {
    margin-bottom: 0;
}

.author-info p {
    color: #777;
    margin-bottom: 0;
}

.testimonial-indicators {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-md);
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ddd;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* ===== FAQ SECTION ===== */
.faq-section {
    padding: var(--spacing-xl) 0;
    background-color: #f9f9f9;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background-color: white;
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-sm);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.faq-question {
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-direction: row-reverse;
}

.faq-question h3 {
    margin-bottom: 0;
    font-size: 1.2rem;
}

.faq-toggle {
    color: var(--primary-color);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 var(--spacing-md) var(--spacing-md);
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 300px;
}

/* ===== SUBSCRIBE SECTION ===== */
.subscribe-section {
    padding: var(--spacing-xl) 0;
    background: var(--gradient-1);
    color: white;
    position: relative;
    overflow: hidden;
}

.subscribe-section .container {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.subscribe-content {
    flex: 1;
    max-width: 600px;
}

.subscribe-animation {
    flex: 1;
    position: relative;
    height: 300px;
}

.floating-character {
    position: absolute;
    width: 200px;
    height: 200px;
    background-image: url('assets/character2.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 4s infinite ease-in-out;
}

/* ===== FOOTER ===== */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: var(--spacing-lg) 0 var(--spacing-sm);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-logo {
    text-align: center;
}

.footer-logo-img {
    height: 60px;
    margin-bottom: var(--spacing-xs);
}

.footer-logo h3 {
    margin-bottom: var(--spacing-xs);
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.footer-links h4,
.footer-social h4,
.footer-newsletter h4 {
    color: var(--accent-color);
    margin-bottom: var(--spacing-sm);
}

.footer-links ul li {
    margin-bottom: var(--spacing-xs);
}

.footer-links ul li a {
    color: #ccc;
}

.footer-links ul li a:hover {
    color: white;
}

.social-icons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

.social-icons a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.newsletter-form {
    display: flex;
    margin-top: var(--spacing-sm);
}

.newsletter-form input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    font-family: var(--body-font);
}

.newsletter-form button {
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    padding: 10px 15px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.footer-bottom p {
    margin-bottom: 0;
}

.footer-bottom-links {
    display: flex;
    gap: var(--spacing-md);
}

.footer-bottom-links a {
    color: #ccc;
    font-size: 0.9rem;
}

.footer-bottom-links a:hover {
    color: white;
}

/* ===== STICKY SUBSCRIBE BUTTON ===== */
.sticky-subscribe {
    position: fixed;
    bottom: 30px;
    left: 30px;
    right: auto;
    z-index: 99;
    animation: pulse 2s infinite;
}

/* ===== AUTH BUTTON ===== */
.auth-button {
    margin-right: var(--spacing-md);
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 992px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .main-heading {
        font-size: 2.8rem;
    }

    .hero .container,
    .about-section .container,
    .subscribe-section .container {
        flex-direction: column;
    }

    .hero-content,
    .about-content,
    .subscribe-content {
        max-width: 100%;
        text-align: center;
        margin-bottom: var(--spacing-lg);
    }

    .hero-cta {
        justify-content: center;
    }

    .about-features {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .video-gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }

    .newsletter-form {
        max-width: 400px;
        margin: var(--spacing-sm) auto 0;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .main-heading {
        font-size: 2.2rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .btn {
        width: 100%;
    }

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

    .sticky-subscribe {
        bottom: 20px;
        right: 20px;
    }
}
