:root {
    --primary-dark: #1a1a1a;
    --primary-sand: #c6bc96;
    --secondary-sand: #bbae7e;
    --dark-brown: #3d2914;
    --white: #ffffff;
    --gray-light: #f5f5f5;
    --gray-medium: #d9d9d9;
    --text-primary: #000000;
    --text-secondary: rgba(0, 0, 0, 0.7);
    --text-light: rgba(0, 0, 0, 0.3);
    --radius: 14px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

html[dir="ltr"] {
    direction: ltr;
}

html[dir="rtl"] {
    direction: rtl;
}

body {
    font-family: 'Tajawal', 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e3d3 100%);
    overflow-x: hidden;
}

/* Language specific font adjustments */
html[lang="en"] body {
    font-family: 'Inter', 'Tajawal', sans-serif;
}

/* Remove all underlines */
a {
    text-decoration: none !important;
}

/* Enhanced Navbar with Language Switcher */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-logo img {
    height: 50px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary-sand);
    transition: width 0.3s ease;
}

html[dir="ltr"] .nav-link::before {
    right: auto;
    left: 0;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

html[dir="ltr"] .nav-link:hover::before,
html[dir="ltr"] .nav-link.active::before {
    right: 0;
    left: auto;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-sand);
    background: rgba(198, 188, 150, 0.1);
}

/* Language Switcher Styles */
.language-switcher {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 25px;
    padding: 4px;
}

.lang-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.lang-btn:hover {
    background: rgba(198, 188, 150, 0.2);
}

.lang-btn.active {
    background: var(--dark-brown);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(61, 41, 20, 0.3);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* Hero Section with Video Background */
.hero-section {
    margin-top: 80px;
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-dark) 0%, #2a2a2a 100%);
}

.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    background: var(--primary-dark);
}

.hero-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.hero-content {
    text-align: center;
    color: var(--white);
    z-index: 3;
    position: relative;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s backwards;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Unified Button Styles */
.btn,
.slide-btn,
.carousel-btn,
.slider-btn,
button[type="submit"],
input[type="submit"] {
    display: inline-block;
    padding: 12px 32px;
    border-radius: var(--radius);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    background: var(--dark-brown);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(61, 41, 20, 0.3);
    text-align: center;
}

.btn::before,
.slide-btn::before,
.carousel-btn::before,
.slider-btn::before,
button[type="submit"]::before,
input[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover,
.slide-btn:hover,
.carousel-btn:hover,
.slider-btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
    background: var(--primary-sand);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(198, 188, 150, 0.4);
}

.btn:hover::before,
.slide-btn:hover::before,
.carousel-btn:hover::before,
.slider-btn:hover::before,
button[type="submit"]:hover::before,
input[type="submit"]:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active,
.slide-btn:active,
.carousel-btn:active,
.slider-btn:active,
button[type="submit"]:active,
input[type="submit"]:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary,
.btn-dark,
.btn-outline {
    background: var(--dark-brown);
    color: var(--white);
    border: none;
    box-shadow: 0 4px 15px rgba(61, 41, 20, 0.3);
}

.btn-primary:hover,
.btn-dark:hover,
.btn-outline:hover {
    background: var(--primary-sand);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(198, 188, 150, 0.4);
}

/* UNESCO Section Styling */
.unesco-section {
    position: relative;
    padding: 4rem 2rem;
    background-image: url('55971.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    margin-top: 4rem;
}

.unesco-content {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
}

.unesco-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
    align-items: stretch;
}

.unesco-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.unesco-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.25rem;
}

.unesco-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.unesco-card p {
    font-size: 1.05rem;
    color: #666;
    line-height: 1.7;
    margin-top: 0.25rem;
}

.unesco-show-all {
    text-align: center;
    margin-top: 3rem;
}

/* Cultural Cards Grid */
.cards-section {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #544b3a;
}

/* Digital Library Section */
.digital-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.digital-book-card {
    position: relative;
    height: 500px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
}

.digital-book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.digital-book-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.digital-book-card:hover .digital-book-image {
    transform: scale(1.05);
    filter: brightness(0.4);
}

.digital-book-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: white;
    transition: var(--transition);
}

.digital-book-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-sand);
    position: relative;
    z-index: 2;
}

.digital-book-description {
    font-size: 1rem;
    margin-bottom: 1rem;
    opacity: 0;
    transition: var(--transition);
    line-height: 1.6;
    transform: translateY(20px);
}

.digital-book-card:hover .digital-book-description {
    opacity: 1;
    transform: translateY(0);
}

.digital-book-author {
    font-size: 0.9rem;
    color: #cbd5e1;
    opacity: 0;
    transition: var(--transition);
    font-style: italic;
    transform: translateY(20px);
}

.digital-book-card:hover .digital-book-author {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced Form */
.form-section {
    padding: 4rem 2rem;
    background: var(--gray-light);
}

.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius);
    padding: 3rem;
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

html[dir="ltr"] .form-label {
    text-align: left;
}

html[dir="rtl"] .form-label {
    text-align: right;
}

.form-input,
.form-select,
.form-textarea {
    padding: 12px 16px;
    border: 2px solid var(--gray-medium);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

html[dir="ltr"] .form-input,
html[dir="ltr"] .form-select,
html[dir="ltr"] .form-textarea {
    text-align: left;
}

html[dir="rtl"] .form-input,
html[dir="rtl"] .form-select,
html[dir="rtl"] .form-textarea {
    text-align: right;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-sand);
    box-shadow: 0 0 0 3px rgba(198, 188, 150, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-full {
    grid-column: 1 / -1;
}

/* Clean Footer */
.footer {
    background: white;
    padding: 2rem 0 0 0;
    margin-top: 0;
    border-top: 1px solid #e0e0e0;
}

.footer-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 3rem;
}

.footer-logo-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-top: -3rem;
}

html[dir="rtl"] .footer-logo-section {
    text-align: right;
}

html[dir="ltr"] .footer-logo-section {
    text-align: left;
}

.footer-logo {
    height: 160px;
    width: auto;
    margin-bottom: -2rem;
}

html[dir="rtl"] .footer-logo {
    margin-right: -17rem;
}

html[dir="ltr"] .footer-logo {
    margin-left: -17rem;
}

.footer-description {
    max-width: 400px;
}

html[dir="rtl"] .footer-description {
    text-align: right;
}

html[dir="ltr"] .footer-description {
    text-align: left;
}

.footer-description p {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.footer-contact {
    flex: 1;
    text-align: center;
}

.footer-contact h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #333;
}

html[dir="rtl"] .footer-contact h3 {
    text-align: right;
}

html[dir="ltr"] .footer-contact h3 {
    text-align: left;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

/* RTL Direction (Arabic) - default */
html[dir="rtl"] .footer-contact-item {
    justify-content: flex-start;
    text-align: right;
}

/* LTR Direction (English) */
html[dir="ltr"] .footer-contact-item {
    justify-content: flex-start;
    text-align: left;
}

.footer-contact-item img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.footer-contact-item span {
    color: #666;
    font-size: 0.95rem;
}

.footer-social-section {
    flex: 1;
    text-align: center;
}

.footer-social-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.footer-social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.social-icon img {
    width: 18px;
    height: 18px;
}

.footer-bottom {
    background: #1a1a1a;
    color: white;
    text-align: center;
    padding: 1rem;
    margin: 0;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
}

/* Loading Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--gray-medium);
    border-top-color: var(--primary-sand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

/* Heritage Carousel */
.heritage-section {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.heritage-carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #000;
    height: 520px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
}

.slide-image-container {
    width: 100%;
    height: 100%;
    position: relative;
}

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

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

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.75));
    pointer-events: none;
}

.slide-content {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 2rem;
    color: #fff;
}

.content-wrapper {
    max-width: 680px;
    margin-inline: auto;
}

.slide-number {
    display: inline-block;
    font-weight: 700;
    opacity: .8;
    margin-bottom: .25rem;
    font-size: 0.9rem;
}

.slide-title {
    font-size: clamp(1.25rem, 2.5vw, 1.8rem);
    margin: .25rem 0 .5rem;
    color: var(--primary-sand);
    font-weight: 700;
}

.slide-description {
    font-size: clamp(.95rem, 1.8vw, 1.1rem);
    opacity: .95;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.slide-btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    background: var(--dark-brown);
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.slide-btn:hover {
    background: var(--primary-sand);
    transform: translateY(-1px);
}

/* Carousel Controls */
.carousel-controls {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 .75rem;
    pointer-events: none;
    z-index: 10;
}

.carousel-btn {
    pointer-events: all;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--dark-brown);
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 400;
    box-shadow: 0 4px 15px rgba(61, 41, 20, 0.3);
    transition: var(--transition);
    cursor: pointer;
    padding: 0 .75rem;
}

.carousel-btn:hover {
    background: var(--primary-sand);
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(198, 188, 150, 0.4);
}

.carousel-btn:active {
    transform: scale(.95);
}

/* Carousel Indicators */
.carousel-indicators {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: .5rem;
    z-index: 10;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.indicator.active {
    background: var(--primary-sand);
    transform: scale(1.15);
}

/* Progress bar */
.carousel-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, .15);
    z-index: 10;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-sand);
    transition: width .1s linear;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeInUp 0.8s ease;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .unesco-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .digital-library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .digital-book-card {
        height: 450px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }

    .nav-menu {
        position: fixed;
        right: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    html[dir="ltr"] .nav-menu {
        left: -100%;
        right: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    html[dir="ltr"] .nav-menu.active {
        left: 0;
        right: auto;
    }

    .language-switcher {
        position: absolute;
        top: 1rem;
        right: 60px;
    }

    html[dir="ltr"] .language-switcher {
        right: auto;
        left: 60px;
    }

    .nav-toggle {
        display: block;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .unesco-cards {
        grid-template-columns: 1fr;
    }

    .unesco-card img {
        height: 220px;
    }

    .digital-library-grid {
        grid-template-columns: 1fr;
    }

    .digital-book-card {
        height: 400px;
    }

    .digital-book-content {
        padding: 1.5rem;
    }

    .digital-book-title {
        font-size: 1.2rem;
    }

    .digital-book-description {
        font-size: 0.9rem;
    }

    .digital-book-author {
        font-size: 0.8rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }

    .form-container {
        padding: 2rem;
    }

    .footer-main {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .footer-logo-section {
        order: 1;
    }

    .footer-logo {
        height: 100px;
        margin-bottom: 0.8rem;
        margin-right: 0;
        margin-left: 0;
    }

    .footer-description {
        max-width: 100%;
        text-align: center;
    }

    .footer-description p {
        font-size: 0.95rem;
        line-height: 1.5;
        text-align: center;
    }

    .footer-contact {
        order: 2;
    }

    .footer-contact h3 {
        text-align: center;
    }

    .footer-social-section {
        order: 3;
    }

    .heritage-carousel {
        height: 400px;
    }

    .slide-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .language-switcher {
        gap: 0.25rem;
        padding: 3px;
    }

    .lang-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .digital-book-card {
        height: 350px;
    }

    .digital-book-content {
        padding: 1rem;
    }

    .digital-book-title {
        font-size: 1.1rem;
    }

    .digital-book-description {
        font-size: 0.85rem;
    }

    .digital-book-author {
        font-size: 0.75rem;
    }

    .heritage-carousel {
        height: 320px;
    }

    .slide-content {
        padding: 1rem;
    }
}