/* ==================== HOME PAGE SPECIFICS ==================== */
html {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Hero Slider - Contains images and content */
.hero-slider {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 90px);
    overflow: hidden;
    background: var(--bg-primary);
    margin: 80px 0 0 0;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    left: 0;
    right: 0;
}

/* Hero content inside slider */
.hero-slider .hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.slider-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: hidden;
    flex: 1 1 auto;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}



.slider-slides {
    display: flex;
    width: 100%;
    max-width: 100%;
    height: 100%;

    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    /* transition: none; */

    direction: ltr;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.slide {
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.slide picture {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.slide img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transform-origin: center center;
    /* Smooth continuous zoom animation */
    animation: smoothZoom 20s ease-in-out infinite;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Smooth repeating zoom keyframes */
@keyframes smoothZoom {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

@keyframes zoomIn {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}



.slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: clamp(1rem, 3vw, 2rem);
    max-width: min(900px, 90%);
    width: 100%;
    animation: slideUp 0.8s ease;
}

.slide-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: #ffffff;
    text-shadow: 2px 4px 20px rgba(0, 0, 0, 0.5);
}

.slide-title .highlight {
    color: #FFC400;
}

.slide-description {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 2px 10px rgba(0, 0, 0, 0.4);
    line-height: 1.6;
}

.slide-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #FFC400;
    color: #1a1a1a;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.125rem;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(255, 196, 0, 0.3);
}

.slide-cta:hover {
    transform: translateY(-3px) scale(1.05);
    background: #e6b000;
    color: #1a1a1a;
    box-shadow: 0 15px 40px rgba(255, 196, 0, 0.4);
}

/* Slider Navigation */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: clamp(40px, 5vw, 50px);
    height: clamp(40px, 5vw, 50px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
}

.slider-nav:hover {
    background: #FFC400;
    color: #1a1a1a;
    border-color: #FFC400;
    transform: translateY(-50%) scale(1.1);
}

.slider-nav.prev {
    left: clamp(0.5rem, 2vw, 2rem);
}

.slider-nav.next {
    right: clamp(0.5rem, 2vw, 2rem);
}

.slider-dots {
    display: none !important;
}

.dot {
    width: clamp(8px, 1.2vw, 10px);
    height: clamp(8px, 1.2vw, 10px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    position: relative;
}

.dot.active {
    background: #FFC400;
    border-color: #FFC400;
    transform: scale(1.4);
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.3);
}

.dot.active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background: rgba(255, 196, 0, 0.2);
    border-radius: 50%;
    animation: dotPulse 2s ease-in-out infinite;
}

.dot:hover {
    background: rgba(255, 196, 0, 0.8);
    transform: scale(1.25);
    box-shadow: 0 0 0 2px rgba(255, 196, 0, 0.2);
}

@keyframes dotPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

/* Hero Section */
.hero {
    min-height: 70vh;
    padding: 0.5rem;
    margin: 0;
    text-align: center;
    background: var(--bg-primary);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Tablet */
@media (min-width: 768px) {
    .hero {
        min-height: 65vh;
        padding: 1rem;
    }
}



.hero-content {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 1s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
}

.hero-brand {
    color: var(--text-primary);
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    line-height: 1.1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.hero-brand .white {
    color: var(--text-primary);
}

.hero-brand .yellow {
    color: #FFC400;
}

.hero-tagline {
    font-size: clamp(1.125rem, 3vw, 1.5rem);
    margin-bottom: 0;
    margin-top: 0;
    line-height: 1.8;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-secondary);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #FFC400;
    color: #1a1a1a;
    padding: 1.125rem 3rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.hero-cta:hover {
    transform: translateY(-5px) scale(1.02);
    background: #e6b000;
    color: #1a1a1a;
}

/* Scroll Arrow */
.scroll-arrow {
    position: relative;
    margin-top: 0;
    display: inline-block;
    font-size: 2rem;
    color: var(--text-primary);
    opacity: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.5s forwards, bounceGentle 2s ease 1.5s infinite;
    z-index: 1;
}

.scroll-arrow:hover {
    opacity: 1;
    transform: scale(1.2);
}

.scroll-arrow.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Gentle bounce animation */
@keyframes bounceGentle {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Fade in from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 0.7;
        transform: translateY(0);
    }
}

/* Section */
.section {
    padding: 4rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-primary);
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.section-title {
    color: var(--text-primary);
}

.section-title .yellow {
    color: #FFC400;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* Enhanced category cards */
.category-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FFC400 0%, #FFB300 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

/* Enhanced hover effect */
.category-card:hover {
    border-color: #FFC400;
    transform: translateY(-10px) scale(1.02);
    box-shadow:
        0 20px 60px rgba(255, 196, 0, 0.25),
        0 0 0 4px rgba(255, 196, 0, 0.1);
}

.category-card:hover::before {
    transform: scaleX(1);
}

/* Enhanced category images */
.category-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 1rem;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.theme-dark .category-image {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
}

.category-card:hover .category-image {
    transform: scale(1.08) rotate(2deg);
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #FFC400 0%, #e6b000 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #1a1a1a;
}

.category-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.category-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* View More */
.view-more {
    text-align: center;
    margin-top: 2.5rem;
}

.btn-outline-yellow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    color: #FFC400;
    border: 2px solid #FFC400;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.btn-outline-yellow:hover {
    background: #FFC400;
    color: #1a1a1a;
    transform: translateY(-3px);
}

/* Features Section */
.features {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: #FFC400;
    transform: translateY(-5px);
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: #FFC400;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #1a1a1a;
    box-shadow: 0 10px 30px rgba(255, 196, 0, 0.3);
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-icon {
    font-size: 5rem;
    color: #FFC400;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

/* Section Transitions */
.section-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.section-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-animate {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.4s ease-out,
        transform 0.4s ease-out;
}

.card-animate.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Slide up animation from bottom - all cards appear the same way */
.categories-grid .card-animate {
    transform: translateY(30px) scale(0.98);
}

.categories-grid .card-animate.visible {
    transform: translateY(0) scale(1);
}


/* Pulse effect for icons on appearance */
.feature-card.visible .feature-icon {
    animation: pulse 0.6s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Fade in from bottom keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 1024px) {
    .hero-slider {
        min-height: 75vh;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .slider-container {
        width: 100%;
        max-width: 100%;
        position: relative;
        left: 0;
        right: 0;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .slide {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .slide picture {
        width: 100%;
        height: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .slide img {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 60vh;
        object-fit: cover;
        object-position: center;
        box-sizing: border-box;
    }
}

/* Responsive */
@media (max-width: 768px) {

    .hero-slider {
        min-height: auto;
        height: auto;
        margin-top: 70px;
        display: flex;
        flex-direction: column;
    }


    .slide-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
        margin-bottom: 1rem;
    }

    .slide-description {
        font-size: clamp(0.95rem, 2vw, 1.1rem);
        margin-bottom: 1.5rem;
    }

    .slide-cta {
        padding: 0.75rem 1.75rem;
        font-size: 1rem;
    }

    .slider-nav {
        width: clamp(36px, 4.5vw, 44px);
        height: clamp(36px, 4.5vw, 44px);
    }

    .slider-dots {
        bottom: clamp(0.75rem, 2vh, 1.5rem);
    }

    /* تحسين السهم على الشاشات المتوسطة - يبقى ظاهر */
    .scroll-arrow {
        font-size: 1.5rem;
        bottom: 1.5rem;
    }

    .hero-content {
        padding: 1.9rem 1.9rem;
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 0.5rem;
        overflow-y: auto;
    }

    .slider-container {
        flex: 0 0 auto;
        height: auto;
        width: 100%;
        overflow: hidden;
    }

    .hero-brand {
        font-size: clamp(1.8rem, 10vw, 2.5rem);
        line-height: 1.1;
        margin-top: 0;
        margin-bottom: 0.5rem;
    }

    .hero-tagline {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-top: 0;
        margin-bottom: 0;
        padding: 0;
    }

    .hero-tagline br {
        display: none;
    }

    .hero-content .section-header {
        display: block;
        margin-bottom: 0.5rem;
    }

    .section-title {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }

    .section-subtitle {
        font-size: 0.8rem;
    }

    .scroll-arrow {
        margin-top: 0.5rem;
    }



    .section {
        padding: 2.5rem 1rem;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .category-card {
        padding: 0.5rem;
    }

    .category-image {
        height: 200px;
        max-height: 200px;
        padding: 0;
    }

    .category-name {
        font-size: 1.125rem;
    }

    .category-desc {
        font-size: 0.875rem;
        line-height: 1.6;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .feature-card {
        padding: 1.5rem 1rem;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .feature-title {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }

    .feature-desc {
        font-size: 0.875rem;
    }

    .btn-outline-yellow {
        padding: 0.875rem 2rem;
        font-size: 1rem;
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .view-more {
        margin-top: 2rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .hero-slider {
        min-height: auto;
        height: auto;
        max-height: none;
        margin-top: 85px;
        margin-bottom: 2.5rem;
        display: flex;
        flex-direction: column;
    }

    .slider-slides,
    .slide,
    .slide picture {
        height: auto !important;
    }

    .slider-container {
        flex: 0 0 auto;
        height: auto;
        min-height: 0;
        overflow: hidden;
        padding: 0;
    }



    .hero-brand {
        font-size: clamp(1.6rem, 8vw, 2rem);
        margin-bottom: 0.25rem;
        line-height: 1.1;
    }

    .hero-tagline {
        font-size: 0.8rem;
        margin-bottom: 0;
        margin-top: 0;
        line-height: 1.3;
    }



    .scroll-arrow {
        margin-top: 0.25rem;
    }

    /* التأكد من ظهور السهم */
    .scroll-arrow {
        font-size: 1.5rem;
        margin-top: 2rem;

    }

    .slide picture {
        width: 100%;
        height: 100%;
    }

    .slide img {
        object-fit: contain;
        width: 100%;
        height: auto;
        max-height: 55vh;
        min-height: 0;
        display: block;
        margin: 0 auto;
    }


    .slide-content {
        padding: 0.75rem;
    }

    .slide-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .slide-description {
        font-size: clamp(0.875rem, 2.5vw, 1rem);
    }

    .slide-cta {
        font-size: 0.9rem;
    }

    /* Mobile touch optimization */
    .slider-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .slider-nav.prev {
        left: 0.5rem;
    }

    .slider-nav.next {
        right: 0.5rem;
    }

    .dot {
        width: 8px;
        height: 8px;
        border-width: 2px;
        padding: 0;
    }

    .dot.active {
        transform: scale(1.2);
    }

    .slider-dots {
        bottom: 0.75rem;
        gap: 0.375rem;
    }

    .hero {
        padding: 1.5rem 1rem 1rem;
    }

    .hero-brand {
        font-size: clamp(2rem, 18vw, 3rem);
    }

    .hero-tagline {
        font-size: 0.95rem;
    }
}




/* ==================== MOBILE RESPONSIVE - FINAL RADICAL FIX ==================== */

/* Tablet (= 768px) */
@media (max-width: 768px) {

    /* 1. Body/Main Spacing Fix */
    body.home-page main {
        padding-top: 85px !important;
        /* Reduced from 100px to match navbar height closely */
    }

    .hero-slider {
        margin: 0 0 2.5rem 0 !important;
        width: 100%;
        height: auto;
        min-height: auto;
        display: flex !important;
        /* Changed to flex to use gap */
        flex-direction: column;
        gap: 2rem;
        /* Consistent spacing between image and content */
        padding: 0 !important;
    }

    .slider-container {
        /* 2. Container Fix: Content-based height */
        position: relative;
        width: 100%;
        height: auto;
        min-height: auto;
        /* Remove forced height to eliminate bottom gap */
        overflow: hidden;
        background: var(--bg-secondary);
    }

    .slide {
        width: 100%;
        height: auto;
        position: relative;
    }

    .slide img {
        /* 3. Image Fix */
        width: 100%;
        height: auto;
        display: block;
        object-fit: contain !important;
        max-height: 60vh;
    }

    /* Add space above content on small screens (moved from 480px to cover all mobile) */
    .hero-content {
        margin-top: 2rem !important;
    }

    /* Dots Adjustment */
    .slider-dots {
        bottom: 10px;
        background: rgba(0, 0, 0, 0.4);
        padding: 4px 12px;
        border-radius: 20px;
    }
}

/* Mobile (= 480px) */
@media (max-width: 480px) {
    body.home-page main {
        padding-top: 70px !important;
        /* Reduced from 80px */
    }

    .slider-container {
        min-height: auto;
        /* Ensure no forced height here too */
    }

    .slide img {
        max-height: 50vh;
    }

    .hero-content {
        margin-top: 2rem !important;
    }


    .slider-dots {
        bottom: 5px;
        padding: 3px 8px;
    }

    .dot {
        width: 6px;
        height: 6px;
    }
}

/* Remove Extra Spacing After Slider */
@media (max-width: 768px) {
    main>section:first-child {
        margin-top: 0 !important;
    }

    .hero-content {
        margin-top: 1rem !important;
        padding-top: 0 !important;
    }

    .categories-section {
        margin-top: 1rem !important;
    }
}