/* --- CSS Variables --- */
:root {
    --bg-dark: #0f0f15;
    --bg-card: rgba(25, 25, 36, 0.7);
    --bg-card-hover: rgba(35, 35, 48, 0.9);
    --primary: #E6332A; /* Mada Red */
    --secondary: #F58220; /* Mada Orange */
    --text-main: #f5f5f7;
    --text-muted: #a0a0b0;
    --glass-border: rgba(255, 255, 255, 0.08);
    --gradient-primary: linear-gradient(135deg, #E6332A 0%, #F58220 100%);
    --gradient-hero: linear-gradient(135deg, rgba(15,15,21,0.9) 0%, rgba(15,15,21,0.4) 100%);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.light-mode {
    --bg-dark: #f0f0f5;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --text-main: #0f0f15;
    --text-muted: #505060;
    --glass-border: rgba(0, 0, 0, 0.1);
    --gradient-hero: linear-gradient(135deg, rgba(240,240,245,0.9) 0%, rgba(240,240,245,0.4) 100%);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* --- Reset & Global --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

.container {
    width: 85%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 3.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    background: linear-gradient(to left, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title .underline {
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    margin: 0 auto 1rem;
    border-radius: 2px;
}

section {
    padding: 12rem 0; /* Massive spacing for editorial look */
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(155, 81, 224, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(155, 81, 224, 0.6);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--secondary);
    color: var(--secondary);
}

.btn-secondary:hover {
    background: var(--secondary);
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(242, 201, 76, 0.4);
    transform: translateY(-3px);
}

.w-100 {
    width: 100%;
}

/* --- Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.header.scrolled {
    padding: 1rem 0;
    background: rgba(15, 15, 21, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 1px;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-weight: 600;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: var(--transition);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

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

.theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle-btn:hover {
    color: var(--secondary);
    transform: scale(1.1);
}

.nav-links a.store-link {
    background: var(--gradient-primary);
    color: #fff !important;
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid var(--glass-border);
}

.nav-links a.store-link:hover {
    box-shadow: 0 4px 15px rgba(155, 81, 224, 0.4);
    transform: translateY(-2px);
}

.nav-links a.store-link::after {
    display: none !important;
}

/* --- Hero Section --- */
.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;
    z-index: 0;
    opacity: 0.85;
}

body.light-mode .hero-overlay {
    background: rgba(240, 240, 245, 0.85); /* Slightly frosty for video in light mode */
}

.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0;
    overflow: hidden;
}

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

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

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-hero);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin-top: 80px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero h1 span {
    color: var(--secondary);
    text-shadow: 0 0 20px rgba(242, 201, 76, 0.4);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.stats {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-item i {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.about-image {
    position: relative;
}

.about-image img {
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid var(--glass-border);
}

/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2.5rem 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-glass);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card .icon {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-muted);
}

/* --- Testimonials --- */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2rem;
    position: relative;
}

.quote-icon {
    position: absolute;
    top: -15px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 4px 10px rgba(155, 81, 224, 0.4);
}

.testimonial-card p {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-muted);
}

.client-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
}

.client-avatar i {
    font-size: 2.5rem;
    color: var(--text-muted);
}

.client-info h4 {
    font-size: 1.1rem;
}

/* --- Contact Section --- */
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

.contact-info {
    padding: 4rem;
    background: rgba(15, 15, 21, 0.5);
}

.contact-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.contact-info > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.contact-list i {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-top: 0.2rem;
}

.contact-list strong {
    display: block;
    font-size: 1.1rem;
}

.contact-list span {
    color: var(--text-muted);
}

.contact-form {
    padding: 4rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 3rem 0;
    background: #0a0a0f;
    text-align: center;
}

.footer-logo h2 {
    font-size: 2rem;
    font-weight: 800;
}

.footer-logo span {
    color: var(--primary);
}

.footer-logo p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-links a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

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

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Custom Logos --- */
.header-logo {
    max-height: 40px;
    width: auto;
}

.footer-img-logo {
    max-width: 250px;
    margin: 0 auto 1.5rem;
}

/* --- Voice of Mada Section --- */
.voice-of-mada {
    background: linear-gradient(to bottom, var(--bg-dark), #151520);
}

.audio-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.audio-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: var(--transition);
}

.audio-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(155, 81, 224, 0.2);
}

.audio-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 1.2rem;
    width: 80px;
    height: 80px;
    background: rgba(155, 81, 224, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

.audio-card h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* --- Video World Section --- */
.video-world {
    background: var(--bg-dark);
}

.video-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: var(--transition);
}

.video-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary);
    box-shadow: 0 10px 30px rgba(245, 130, 32, 0.2);
}

.video-icon {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 1.2rem;
    width: 80px;
    height: 80px;
    background: rgba(245, 130, 32, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

.video-card h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* --- Gallery Section --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-glass);
    border: 1px solid var(--glass-border);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    aspect-ratio: 4 / 3;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* --- Animations --- */
.animate-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-up.show {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* --- Responsive Media Queries --- */
@media (max-width: 992px) {
    .about-grid, .contact-card {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2.8rem;
    }
    
    .contact-info, .contact-form {
        padding: 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-dark);
        flex-direction: column;
        padding: 1.5rem 0;
        text-align: center;
        border-bottom: 1px solid var(--glass-border);
    }

    .nav-links.active-menu {
        display: flex;
    }

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

    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
}

/* --- Dynamic Visual Effects --- */
/* Particles */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1; /* Below content, above overlay */
}

/* Premium Trailing Cursor */
.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    margin-left: -4px;
    margin-top: -4px;
    transition: opacity 0.2s;
}

.cursor-ring {
    width: 40px;
    height: 40px;
    border: 2px solid var(--secondary);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9998;
    margin-left: -20px;
    margin-top: -20px;
    transition: transform 0.1s ease-out, width 0.3s, height 0.3s, margin 0.3s, background-color 0.3s, border-color 0.3s;
}

@media (min-width: 900px) {
    body, a, button, .magnetic, .bento-item, input, textarea {
        cursor: none !important;
    }
}

@media (max-width: 900px) {
    .cursor-dot, .cursor-ring {
        display: none !important;
    }
}

/* Apply continuous subtle floating animation to the about image */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}
.about-image img {
    animation: float 6s ease-in-out infinite;
}

/* --- Premium Agency Overrides --- */
.animate-up {
    opacity: 0 !important;
    transform: translateY(60px) scale(0.96) !important;
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), opacity 1s ease-out !important;
}
.animate-up.show {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

.magnetic {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s;
}

body.light-mode .web-design-showcase {
    background: rgba(255, 255, 255, 0.5) !important;
}

/* Footer Agency Overhaul */
.footer-agency {
    padding: 10rem 0 2rem;
    background: var(--bg-dark);
    position: relative;
    border-top: 1px solid var(--glass-border);
}
.footer-agency h2 {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
}
.footer-agency .email-cta {
    font-size: 3rem;
    color: var(--text-main);
    display: inline-block;
    margin-bottom: 4rem;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
}
.footer-agency .email-cta:hover {
    color: var(--secondary);
    text-shadow: 0 0 20px rgba(245, 130, 32, 0.5);
}
.footer-social a:hover {
    color: var(--primary) !important;
    transform: translateY(-5px);
}

/* --- Bento Gallery --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: 280px;
    gap: 24px;
}

.bento-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), filter 0.8s;
    filter: brightness(0.85);
}

.bento-item:hover img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.bento-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 15, 21, 0.95) 0%, transparent 70%);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    transition: all 0.4s ease;
}

body.light-mode .bento-overlay {
    background: linear-gradient(to top, rgba(230, 51, 42, 0.9) 0%, transparent 70%);
}

.bento-item:hover .bento-overlay {
    opacity: 1;
}

.bento-overlay i {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 1rem;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s, color 0.3s;
}

.bento-item:hover .bento-overlay i {
    transform: translateY(0);
    color: var(--secondary);
}

.bento-overlay h3 {
    color: #fff;
    font-size: 1.5rem;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.2s;
}

.bento-item:hover .bento-overlay h3 {
    transform: translateY(0);
}

@media (min-width: 900px) {
    .bento-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .span-2 {
        grid-column: span 2;
    }
    .span-row-2 {
        grid-row: span 2;
    }
}
