/* COMPLETE RESPONSIVE DESIGN SOLUTION */
/* Perfect responsiveness for all devices - Mobile, Tablet, Desktop */

/* Base Responsive Setup */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

/* Container Responsive System */
.container {
    width: 100%;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Mobile First - Extra Small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Typography */
    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    /* Sections */
    section {
        padding: 30px 0;
    }
    
    /* Buttons */
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Hero Section */
    .alwaqdan-hero {
        min-height: 60vh;
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    /* Cards */
    .service-card-hexa,
    .stats-card-hexa,
    .project-card-alwaqdan {
        margin-bottom: 1.5rem;
        padding: 1.5rem;
    }
    
    /* Grid System */
    .row {
        margin-left: -5px;
        margin-right: -5px;
    }
    
    .col,
    [class*="col-"] {
        padding-left: 5px;
        padding-right: 5px;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    html {
        font-size: 15px;
    }
    
    .container {
        max-width: 540px;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Typography */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    /* Sections */
    section {
        padding: 40px 0;
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        width: auto;
        display: inline-flex;
    }
    
    /* Hero Section */
    .alwaqdan-hero {
        min-height: 70vh;
        padding: 50px 0;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-buttons {
        flex-direction: row;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    /* Cards */
    .service-card-hexa,
    .stats-card-hexa,
    .project-card-alwaqdan {
        padding: 2rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    html {
        font-size: 16px;
    }
    
    .container {
        max-width: 720px;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* Typography */
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    /* Sections */
    section {
        padding: 50px 0;
    }
    
    /* Hero Section */
    .alwaqdan-hero {
        min-height: 80vh;
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    /* Navigation */
    .navbar {
        padding: 1rem 0;
    }
    
    /* Cards Grid */
    .service-card-hexa,
    .stats-card-hexa {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    /* Two column layout for tablets */
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    /* Typography */
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.5rem;
    }
    
    /* Sections */
    section {
        padding: 60px 0;
    }
    
    /* Hero Section */
    .alwaqdan-hero {
        min-height: 90vh;
        padding: 80px 0;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    /* Navigation */
    .navbar {
        padding: 1.25rem 0;
    }
    
    /* Cards */
    .service-card-hexa,
    .stats-card-hexa,
    .project-card-alwaqdan {
        padding: 2.5rem;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .service-card-hexa:hover,
    .stats-card-hexa:hover,
    .project-card-alwaqdan:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    /* Typography */
    h1 {
        font-size: 3.5rem;
    }
    
    h2 {
        font-size: 3rem;
    }
    
    /* Sections */
    section {
        padding: 80px 0;
    }
    
    /* Hero Section */
    .alwaqdan-hero {
        min-height: 100vh;
        padding: 100px 0;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    /* Enhanced hover effects for desktop */
    .service-card-hexa:hover {
        transform: translateY(-10px) scale(1.02);
    }
    
    .stats-card-hexa:hover {
        transform: translateY(-8px) scale(1.05);
    }
    
    .project-card-alwaqdan:hover {
        transform: translateY(-8px);
    }
}

/* Ultra wide screens (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Prevent excessive width on ultra-wide screens */
    .hero-content {
        max-width: 80%;
    }
    
    /* Enhanced spacing for ultra-wide */
    section {
        padding: 100px 0;
    }
}

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

.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Responsive Images for Different Screens */
@media (max-width: 575.98px) {
    .hero-image-container {
        display: none;
    }
    
    .project-image img {
        height: 200px;
        object-fit: cover;
        width: 100%;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .project-image img {
        height: 250px;
        object-fit: cover;
        width: 100%;
    }
}

@media (min-width: 992px) {
    .project-image img {
        height: 300px;
        object-fit: cover;
        width: 100%;
    }
}

/* Responsive Text Alignment */
@media (max-width: 767.98px) {
    .text-md-start,
    .text-md-end {
        text-align: center !important;
    }
    
    .text-md-right {
        text-align: center !important;
    }
}

/* Responsive Spacing */
@media (max-width: 575.98px) {
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .mt-5 {
        margin-top: 2rem !important;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Responsive Grid Gaps */
@media (max-width: 767.98px) {
    .row {
        --bs-gutter-x: 1rem;
    }
}

@media (min-width: 768px) {
    .row {
        --bs-gutter-x: 1.5rem;
    }
}

/* Responsive Flexbox */
@media (max-width: 575.98px) {
    .d-flex {
        flex-direction: column !important;
    }
    
    .justify-content-between {
        justify-content: center !important;
    }
    
    .align-items-center {
        align-items: stretch !important;
    }
}

/* Print Styles */
@media print {
    .container {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    section {
        padding: 20px 0 !important;
    }
    
    .navbar,
    .footer,
    .floating-contact-btn {
        display: none !important;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar-brand img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .alwaqdan-hero {
        min-height: 100vh;
        padding: 20px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    section {
        padding: 30px 0;
    }
}
