:root {
    --primary: #287383;
    --secondary: #ffffff;
    --light: #f0f5f6;
    --dark: #1e2b32;
    --accent: #e0e5e6;
    --primary-light: #5293a3;
}

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

body {
    font-family: 'Scheherazade New', serif;
    background-color: var(--light);
    color: var(--dark);
    overflow-x: hidden;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: var(--light);
    opacity: 0.3;
}

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

/* Header */
header {
    background-color: var(--primary);
    color: white;
    padding: 20px 0;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-icon {
    width: 50px;
    height: 50px;
    background-color: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
}

.logo-text {
    font-family: 'Amiri', serif;
    font-size: 24px;
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

/* Vision Mission styles */
.vision-mission {
    padding: 80px 0;
    background-color: var(--light);
}

.vision-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.vision-box {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.vision-title {
    background-color: var(--primary);
    color: white;
    padding: 15px 25px;
    font-size: 24px;
    position: relative;
}

.vision-title::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 15px;
    background-color: var(--primary-light);
}

.vision-content {
    padding: 25px;
}

.vision-content p {
    margin-bottom: 15px;
    font-size: 18px;
    line-height: 1.7;
    position: relative;
    padding-right: 30px;
}

.vision-content p:last-child {
    margin-bottom: 0;
}

.vision-content p .bullet-icon {
    position: absolute;
    right: 0;
    top: 8px;
    width: 10px;
    height: 10px;
    background-color: var(--primary);
    border-radius: 50%;
}

/* Slideshow styles */
.biography-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.biography-slideshow {
    margin-bottom: 30px;
}

.slideshow-container {
    width: 100%;
    max-width: 600px;
    height: 400px;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background-color: #f0f0f0;
}

.slides {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.slides img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {
        opacity: .4
    }

    to {
        opacity: 1
    }
}

.biography-text {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.biography-text p {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 15px;
    text-align: right;
}

.biography-text p strong {
    color: var(--primary);
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .slideshow-container {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .slideshow-container {
        height: 250px;
    }
}

/* Competition Levels Table */
.competition-levels {
    padding: 80px 0;
    background-color: white;
}

.table-container {
    overflow-x: auto;
    margin-top: 40px;
}

.levels-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.levels-table th {
    background-color: var(--primary);
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 18px;
}

.levels-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 16px;
}

.levels-table tr:nth-child(even) {
    background-color: var(--light);
}

.levels-table tr:hover {
    background-color: rgba(40, 115, 131, 0.1);
}

.registration-note {
    margin-top: 20px;
    text-align: center;
    padding: 10px;
    background-color: rgba(40, 115, 131, 0.1);
    border-radius: 5px;
    border: 1px solid var(--primary);
}

.registration-note p {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    position: relative;
    padding-bottom: 5px;
    transition: all 0.3s ease;
}

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

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--secondary);
    transition: all 0.3s ease;
}

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

.mobile-menu {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle, rgba(240, 245, 246, 0.9) 0%, rgba(240, 245, 246, 0.8) 100%);
}

.hero-content {
    z-index: 1;
    max-width: 800px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--primary);
}

.hero p {
    font-size: 20px;
    margin-bottom: 30px;
    color: var(--dark);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--secondary);
    color: var(--primary);
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    border-radius: 5px;
    transition: all 0.3s ease;
    margin: 0 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--primary);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: 1px solid white;
}

/* About Section */
.about,
.biography,
.previous-competitions,
.rules,
.registration {
    padding: 80px 0;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

.about,
.rules {
    background-color: white;
}

.biography,
.registration {
    background-color: var(--light);
}

.previous-competitions {
    background-color: var(--dark);
    color: white;
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    color: var(--primary);
    position: relative;
}

.previous-competitions .section-title {
    color: white;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: var(--secondary);
    margin: 15px auto 0;
    border: 1px solid var(--primary);
}

.previous-competitions .section-title::after {
    border-color: white;
}

.about-content,
.biography-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-img,
.biography-img {
    flex: 1;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.about-img img,
.biography-img img {
    width: 100%;
    height: auto;
    display: block;
}

.about-text,
.biography-text {
    flex: 1;
}

.about-text h3,
.biography-text h3 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--primary);
}

.about-text p,
.biography-text p {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Categories Section */
.categories {
    padding: 80px 0;
    background-color: var(--light);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card-img {
    height: 200px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

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

.card-content {
    padding: 20px;
}

.card-content h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--primary);
}

.card-content p {
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 20px;
}

/* Video Gallery */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.video-card {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.video-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-content {
    padding: 20px;
}

.video-content h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: white;
}

.video-content p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

/* Vertical Video Gallery */
.video-gallery-vertical {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.video-card-vertical {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 500px;
}

.video-card-vertical:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.video-container-vertical {
    width: 100%;
    display: flex;
    justify-content: center;
}

.video-container-vertical video {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px 10px 0 0;
}

@media (max-width: 768px) {
    .video-card-vertical {
        max-width: 90%;
    }
}

/* Rules Section */
.rules-content {
    background-color: var(--light);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.rules-list {
    list-style-type: none;
    counter-reset: rule-counter;
}

.rules-list li {
    position: relative;
    padding: 15px 30px 15px 0;
    margin-bottom: 15px;
    font-size: 18px;
    line-height: 1.7;
    border-bottom: 1px solid rgba(40, 115, 131, 0.1);
    counter-increment: rule-counter;
}

.rules-list li:last-child {
    border-bottom: none;
}

.rules-list li::before {
    content: counter(rule-counter);
    position: absolute;
    right: 0;
    top: 15px;
    width: 24px;
    height: 24px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* Registration Form Overrides */
.registration {
    background-color: var(--light);
}

.registration-info {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--secondary);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.announcement {
    margin-bottom: 30px;
}

.announcement h3 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--primary);
}

.announcement p {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.register-button-container {
    margin-top: 30px;
}

.register-button {
    font-size: 20px;
    padding: 15px 40px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.register-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.registration-form {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--secondary);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.registration-form .form-group {
    margin-bottom: 20px;
}

.registration-form label {
    display: block;
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--primary);
}

.registration-form input,
.registration-form select,
.registration-form textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid var(--accent);
    border-radius: 5px;
    font-family: 'Scheherazade New', serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.registration-form input:focus,
.registration-form select:focus,
.registration-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(40, 115, 131, 0.2);
}

.registration-form .form-row {
    display: flex;
    gap: 20px;
}

@media (max-width: 768px) {
    .registration-form .form-row {
        flex-direction: column;
    }
}

.registration-form button[type="submit"] {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 18px;
    font-weight: bold;
    color: var(--secondary);
    background-color: var(--primary);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 10px;
}

.registration-form button[type="submit"]:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

/* Footer */
footer {
    background-color: var(--dark);
    color: white;
    padding: 40px 0 20px;
}

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

.footer-column h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--secondary);
}

.footer-column p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul li a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-column ul li a:hover {
    color: var(--secondary);
    padding-right: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

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

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

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 992px) {

    .about-content,
    .biography-content {
        flex-direction: column;
    }

    .about-img,
    .about-text,
    .biography-img,
    .biography-text {
        flex: 100%;
        width: 100%;
    }
}

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

    .mobile-menu {
        display: block;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 18px;
    }

    .btn {
        display: block;
        margin: 10px 0;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Edition Content */
.edition-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 30px;
    margin-bottom: 30px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.ceremony-image {
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.edition-content p {
    line-height: 1.7;
    font-size: 18px;
}

@media (max-width: 768px) {
    .slideshow-container {
        height: 300px;
    }
    
    .slide {
        height: 300px;
    }
}

/* Third Edition Section */
.third-edition {
    padding: 80px 0;
    background-color: var(--light);
    position: relative;
    overflow: hidden;
}

.third-edition::before {
    content: "﴾﴿";
    position: absolute;
    font-size: 200px;
    color: rgba(40, 115, 131, 0.05);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.third-edition .container {
    position: relative;
    z-index: 1;
}

.third-edition .edition-content {
    background-color: white;
    margin: 0 auto;
    max-width: 900px;
}

/* News and Events Section */
.news-events {
    padding: 80px 0;
    background-color: white;
}

.news-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
}

.news-content {
    display: flex;
    flex-direction: column;
    flex: 0 0 calc(50% - 20px);
    max-width: calc(50% - 20px);
    background-color: var(--light);
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.news-content:hover {
    transform: translateY(-10px);
}

.news-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-image:hover {
    transform: scale(1.02);
}

.news-text {
    flex: 1;
    padding: 25px;
}

.news-text h3 {
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 15px;
    font-weight: bold;
}

.news-text p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark);
    margin-bottom: 20px;
}

.news-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid var(--primary);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.news-link:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

@media (max-width: 1200px) {
    .news-content {
        flex: 0 0 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 992px) {
    .news-content {
        flex: 0 0 100%;
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .news-image {
        height: 220px;
    }
}

/* Slideshow for Third Edition Section */
.slideshow-container {
    width: 100%;
    max-width: 100%;
    height: 600px;
    overflow: hidden;
    position: relative;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    direction: ltr; /* Force LTR for animation direction */
}

.slideshow-wrapper {
    display: flex;
    width: 1000%;  /* 10 slides x 100% */
    animation: slideshow 150s linear infinite;
    animation-fill-mode: forwards;
}

.slide {
    width: 10%;  /* 100% / 10 slides */
    height: 600px;
    flex-shrink: 0;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes slideshow {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-90%); /* Move 9/10 of the width (all slides except one) */
    }
}

@media (max-width: 992px) {
    .slideshow-container {
        height: 450px;
    }
    
    .slide {
        height: 450px;
    }
}

@media (max-width: 768px) {
    .slideshow-container {
        height: 350px;
    }
    
    .slide {
        height: 350px;
    }
}

/* Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.nav-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.prev-arrow {
    left: 20px;
    right: auto;
}

.next-arrow {
    right: 20px;
    left: auto;
}

/* For RTL support */
html[dir="rtl"] .prev-arrow {
    right: 20px;
    left: auto;
}

html[dir="rtl"] .next-arrow {
    left: 20px;
    right: auto;
}

@media (max-width: 768px) {
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .prev-arrow {
        left: 10px;
        right: auto;
    }
    
    .next-arrow {
        right: 10px;
        left: auto;
    }
    
    html[dir="rtl"] .prev-arrow {
        right: 10px;
        left: auto;
    }
    
    html[dir="rtl"] .next-arrow {
        left: 10px;
        right: auto;
    }
}