:root {
    --primary-dark: #060c1a;
    --accent-gold: #d4af37;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --mobile-font: 1.1rem;
    --glass-card: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--primary-dark);
    color: var(--white);
    line-height: 1.8; /* لراحة العين في القراءة */
    overflow-x: hidden;
}

/* --- Navigation & Sidebar --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 2000;
    padding: 15px 6%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(6, 12, 26, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent-gold);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    transition: 0.3s;
}

.menu-btn {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--accent-gold);
    padding: 5px;
}

/* Sidebar for Mobile */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        background: #0a1428;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 2100;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        right: 0;
    }

    .menu-btn {
        display: block;
    }

    .nav-links a {
        font-size: 1.3rem;
        padding: 15px;
        display: block;
    }
}

/* --- Hero Section with Image --- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(6, 12, 26, 0.65), rgba(6, 12, 26, 0.85)),
    url('https://images.unsplash.com/photo-1512917774080-9991f1c4c750?auto=format&fit=crop&w=1600&q=80');
    background-size: cover;
    background-position: center;
    text-align: center;
    padding: 20px;
}

.hero-box {
    background: var(--glass);
    backdrop-filter: blur(10px);
    padding: 40px 30px;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    max-width: 850px;
    animation: fadeIn 1s ease;
}

.hero h1 {
    font-size: clamp(2rem, 8vw, 3.0rem);
    font-weight: 900;
    margin-bottom: 15px;
}

.hero p {
    font-size: clamp(1rem, 4vw, 1.25rem);
    color: #cbd5e1;
    margin-bottom: 30px;
}

.val-tag {
    background: var(--accent-gold);
    color: #000;
    padding: 4px 15px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: inline-block;
}

.slider-container {
    display: flex;
    width: max-content;
    animation: scrollInfinite 40s linear infinite;
}

@keyframes scrollInfinite {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(50%);
    }
    /* التحريك بناءً على النسخة المكررة */
}

/* --- Mobile Friendly Sections --- */
section {
    padding: 30px 7%;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.2rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.services-grid, .blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

/* Basic modal styles */
.popup-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Dark background with opacity */
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Popup content */
.popup-content {
    background-color: #222; /* Dark background for the modal content */
    color: #fff; /* White text */
    border-radius: 10px;
    padding: 20px;
    max-width: 600px;
    width: 100%;
    box-sizing: border-box;
    text-align: left; /* Align content to the left */
    border: 2px solid #fff; /* Initial border */
    animation: shine 1.5s infinite; /* Shiny border animation */
}

/* Title Styling */
.popup-content h3 {
    margin-bottom: 15px;
    font-size: 1.6rem;
    color: var(--accent-gold); /* Gold-colored title */
}

/* Description Styling */
.popup-content p {
    font-size: 1rem;
    line-height: 1.5;
}

/* Close button */
.close-popup {
    color: white;
    font-size: 40px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 35px;
    cursor: pointer;
}

.close-popup:hover,
.close-popup:focus {
    color: #f1f1f1;
    text-decoration: none;
    cursor: pointer;
}

/* Modal Close Button hover */
.close-popup:hover {
    color: var(--accent-gold); /* Change color on hover */
}

/* Shiny border animation */
@keyframes shine {
    0% {
        border-color: #fff;
    }
    50% {
        border-color: #FFD700; /* Gold color */
    }
    100% {
        border-color: #fff;
    }
}

/* Draggable blog item styles */
.glass-item {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 35px 25px;
    border-radius: 20px;
    transition: 0.3s;
    cursor: move; /* Show the cursor as moveable */
    margin-bottom: 20px;
}

.glass-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-8px);
}

.glass-item i {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
    display: block;
}

.glass-item h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

/* Add RTL support */
@media (prefers-color-scheme: dark) {
    .popup-modal {
        direction: rtl;
    }

    .popup-content {
        text-align: right;
    }

    .close-popup {
        left: 35px;
        right: auto;
    }
}

/* --- WhatsApp CTA --- */
.cta-btn {
    background: #25d366;
    color: white;
    padding: 16px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    transition: 0.3s;
}

.cta-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
}

footer {
    text-align: center;
    padding: 40px;
    border-top: 1px solid var(--glass-border);
    opacity: 0.6;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact {
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
}

.contact a {
    color: #cbd5e1;
    text-decoration: none
}

.contact p {
    opacity: 0.7;
}

.contact .contact-p {
    margin-top: 30px;
}

/* --- Projects Filtering System --- */

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--accent-gold);
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--glass-card);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.3s;
    font-size: 1rem;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--accent-gold);
    color: #000;
    border-color: var(--accent-gold);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--glass-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: 0.4s;
    animation: fadeIn 0.5s ease;
}

/* Logic for show/hide */
.project-card.hide {
    display: none;
}

.project-card.show {
    display: block;
}

.project-img-box {
    height: 250px;
    position: relative;
    overflow: hidden;
}

.project-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.project-card:hover img {
    transform: scale(1.1);
}

.project-info {
    padding: 25px;
}

.project-info .project-link {
    text-decoration: none;
    color: var(--accent-gold);
}

.project-info h3 {
    font-size: 1.4rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.project-tag {
    font-size: 0.8rem;
    background: rgba(212, 175, 55, 0.2);
    color: var(--accent-gold);
    padding: 2px 10px;
    border-radius: 5px;
}

.project-button-whatsapp {
    font-size: 1rem;
    background: #25D366; /* WhatsApp Green */
    color: white; /* White text */
    padding: 2px 10px;
    border-radius: 5px;
    text-decoration: none;
}

.project-button {
    font-size: 1rem;
    background: rgba(212, 175, 55, 0.2);
    color: var(--accent-gold);
    padding: 2px 10px;
    border-radius: 5px;
    text-decoration: none;

}

/* Skeleton loader styles */
@keyframes shimmer {
    0% {
        background-position: -200%;
    }
    100% {
        background-position: 200%;
    }
}

/* Default Skeleton Loader (Light Mode) */
.project-card.loading {
    background-color: #f0f0f0;
    position: relative;
    overflow: hidden;
}

/* Skeleton shimmer effect for image */
.project-img-box .shimmer {
    width: 100%;
    height: 250px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

/* Skeleton shimmer effect for text */
.project-info .shimmer-text {
    width: 100%;
    height: 20px;
    margin: 10px 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

/* Skeleton shimmer effect for buttons */
.shimmer-button {
    width: 120px;
    height: 40px;
    margin-right: 10px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 5px;
}

/* Hide real content while loading */
.project-card.loading .project-img-box img,
.project-card.loading .project-info .project-tag,
.project-card.loading .project-info h3,
.project-card.loading .project-info p,
.project-card.loading .project-info .project-button-whatsapp,
.project-card.loading .project-info .project-button {
    display: none;
}

/* Dark Mode Styles (using prefers-color-scheme media query) */
@media (prefers-color-scheme: dark) {

    /* Dark mode background for loading cards */
    .project-card.loading {
        background-color: #333;
    }

    /* Dark mode shimmer effect */
    .project-img-box .shimmer,
    .project-info .shimmer-text,
    .shimmer-button {
        background: linear-gradient(90deg, #444 25%, #666 50%, #444 75%);
    }
}


/* Modal Styles */
.image-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8); /* Black background with opacity */
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    display: block;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: #f1f1f1;
    text-decoration: none;
    cursor: pointer;
}


/* Shimmer animation for the blog card */
@keyframes shimmer {
    0% {
        background-position: -200%;
    }
    100% {
        background-position: 200%;
    }
}

/* Shimmer effect on the glass-item (blog card) */
.glass-item.shimmer {
    position: relative;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%; /* Make the gradient 200% wide for animation */
    animation: shimmer 1.5s infinite linear; /* Apply shimmer animation */
    border-radius: 20px;
    padding: 35px 25px;
    border: 1px solid var(--glass-border);
    transition: 0.3s;
    overflow: hidden;
}

/* Hide actual content during shimmer */
.glass-item.shimmer small,
.glass-item.shimmer h3,
.glass-item.shimmer p {
    visibility: hidden; /* Hide content while shimmer is active */
}

/* Show actual content once shimmer effect ends */
.glass-item:not(.shimmer) small,
.glass-item:not(.shimmer) h3,
.glass-item:not(.shimmer) p {
    visibility: visible;
}

/* Add hover effect to show active state */
.glass-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-8px);
}

/* Add shimmer icon to the image overlay */
.glass-item i {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
    display: block;
}

.glass-item h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

/* Add RTL support */
@media (prefers-color-scheme: dark) {
    .popup-modal {
        direction: rtl;
    }

    .popup-content {
        text-align: right;
    }

    .close-popup {
        left: 35px;
        right: auto;
    }
}

/* Shimmer animation for the blog card */
@keyframes shimmer {
    0% {
        background-position: -200%;
    }
    100% {
        background-position: 200%;
    }
}

/* Shimmer effect on the glass-item (blog card) */
.glass-item.shimmer {
    position: relative;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%; /* Make the gradient 200% wide for animation */
    animation: shimmer 1.5s infinite linear; /* Apply shimmer animation */
    border-radius: 20px;
    padding: 35px 25px;
    border: 1px solid var(--glass-border);
    transition: 0.3s;
    overflow: hidden;
}

/* Hide actual content during shimmer */
.glass-item.shimmer small,
.glass-item.shimmer h3,
.glass-item.shimmer p {
    visibility: hidden; /* Hide content while shimmer is active */
}

/* Show actual content once shimmer effect ends */
.glass-item:not(.shimmer) small,
.glass-item:not(.shimmer) h3,
.glass-item:not(.shimmer) p {
    visibility: visible;
}

/* Add hover effect to show active state */
.glass-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-8px);
}

/* Add shimmer icon to the image overlay */
.glass-item i {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
    display: block;
}

.glass-item h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

/* Light Mode Styles */
.glass-item {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: white;
}

.glass-item h3 {
    color: var(--accent-gold);
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
    /* Shimmer effect for dark mode */
    .glass-item.shimmer {
        background: linear-gradient(90deg, #555 25%, #777 50%, #555 75%); /* Darker shimmer gradient */
    }

    /* Regular card background for dark mode */
    .glass-item {
        background: #333; /* Dark background for the card */
        border: 1px solid #444; /* Darker border */
        color: white; /* White text for dark mode */
    }

    .glass-item h3 {
        color: #FFD700; /* Gold-colored title */
    }

    /* Text color for dark mode */
    .glass-item small,
    .glass-item p {
        color: #bbb; /* Lighter text for dark mode */
    }

    /* Hover effect for dark mode */
    .glass-item:hover {
        background: rgba(255, 255, 255, 0.12);
        transform: translateY(-8px);
    }
}
