/* Responsive Styles for Mobile and Tablet */

/* Navbar - خلفية ووضوح (مثل Native) */
#navbar {
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#navbar.scrolled,
#navbar.scrolled-nav {
    background-color: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(10px);
}
#navbar .nav-link,
#navbar .logo-text,
#navbar .menu-icon {
    color: rgba(255, 255, 255, 0.9);
}
#navbar .nav-link:hover,
#navbar .nav-link.active {
    color: #F5A623 !important;
}
#navbar button.nav-link {
    background: none;
    border: none;
    cursor: pointer;
}

/* Base Responsive Rules */
@media (max-width: 640px) {
    /* Small Mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Text Sizes */
    h1 {
        font-size: 1.75rem;
    }
    
    /* Exclude hero slider titles from global h1 styles */
    .hero-slider h1,
    .hero-slider .slide-title,
    #heroSlider h1,
    #heroSlider .slide-title,
    .slide-title {
        font-size: inherit !important;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Buttons */
    button, .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    /* Large Mobile / Small Tablet */
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Tablet */
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Image Responsiveness */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent Horizontal Scroll */
body {
    overflow-x: hidden;
    width: 100%;
}

/* Form Elements */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Cards and Grids */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr !important;
    }
    
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
}

/* Navigation */
@media (max-width: 768px) {
    nav {
        padding: 0.75rem 1rem;
    }
    
    .nav-link {
        padding: 0.5rem 0;
    }
}

/* Hero Section */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
}

/* Tables */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    thead {
        display: none;
    }
    
    tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        padding: 1rem;
    }
    
    tbody td {
        display: block;
        text-align: right;
        padding: 0.5rem 0;
        border: none;
    }
    
    tbody td::before {
        content: attr(data-label) ": ";
        font-weight: bold;
        display: inline-block;
        width: 40%;
    }
}

/* Modals and Overlays */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-width: 95%;
        margin: 1rem auto;
    }
}

/* Touch Targets */
@media (max-width: 768px) {
    a, button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Spacing Adjustments */
@media (max-width: 768px) {
    .py-24 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .py-20 {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
    
    .py-16 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .mb-16 {
        margin-bottom: 2rem;
    }
    
    .mb-12 {
        margin-bottom: 1.5rem;
    }
}

/* Flexbox Adjustments */
@media (max-width: 768px) {
    .flex-row {
        flex-direction: column;
    }
    
    .flex-col-reverse {
        flex-direction: column-reverse;
    }
}

/* Text Alignment */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center;
    }
}

/* Mobile Submenu Styles (like native) */
.mobile-submenu {
    max-height: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease-out;
    opacity: 0;
    overflow: hidden;
}
.mobile-submenu:not(.hidden) {
    max-height: 1000px;
    opacity: 1;
}
.mobile-submenu-toggle {
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
}

