/* CRITICAL LAYOUT FIXES - HIGHEST PRIORITY */
/* This file fixes all layout issues and ensures proper responsive design */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

/* Main Content Layout */
.main-content {
    min-height: calc(100vh - 200px);
    padding-top: 0;
    margin-top: 0;
}

/* Header and Navigation Fixes */
.header {
    position: relative;
    z-index: 1030;
}

.top-bar {
    background: linear-gradient(135deg, #946317, #b8751f);
    padding: 8px 0;
    font-size: 14px;
}

.navbar {
    background-color: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1029;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    color: #946317 !important;
    font-weight: 700;
    text-decoration: none;
}

.navbar-brand:hover {
    color: #946317 !important;
    text-decoration: none;
}

.navbar-brand img {
    height: 50px;
    max-width: 200px;
    object-fit: contain;
}

/* Navigation Links */
.nav-link-hexa {
    color: #2c3e50 !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-link-hexa:hover {
    background-color: rgba(148, 99, 23, 0.1);
    color: #946317 !important;
    text-decoration: none;
    transform: translateY(-2px);
}

.nav-link-hexa.active {
    background-color: rgba(148, 99, 23, 0.15);
    color: #946317 !important;
    font-weight: 600;
}

.nav-link-hexa i {
    margin-left: 0.5rem;
    font-size: 1rem;
    color: #946317;
}

/* Desktop Navigation - HIDE hamburger menu */
@media (min-width: 992px) {
    .navbar-toggler {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    .navbar-collapse {
        display: flex !important;
        flex-basis: auto !important;
    }

    .navbar-nav {
        flex-direction: row !important;
    }
}

/* Mobile Navigation Fixes */
@media (max-width: 991.98px) {
    .navbar-toggler {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        border: 2px solid #946317;
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
        background: transparent;
        color: #946317;
        margin-left: auto;
        min-width: 44px;
        min-height: 44px;
    }
    
    .navbar-toggler:focus {
        outline: none;
        box-shadow: 0 0 0 0.2rem rgba(148, 99, 23, 0.25);
    }
    
    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23946317' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
        width: 1.5em;
        height: 1.5em;
    }
    
    .navbar-collapse {
        background-color: white;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
        margin-top: 1rem;
        border: 1px solid rgba(0, 0, 0, 0.05);
        position: absolute;
        top: 100%;
        left: 15px;
        right: 15px;
        z-index: 1050;
        width: calc(100% - 30px);
    }
    
    .navbar-nav {
        margin-top: 0.5rem;
    }
    
    .nav-item {
        width: 100%;
        margin: 0.25rem 0;
    }
    
    .nav-link-hexa {
        padding: 0.875rem 1rem;
        margin: 0;
        border-radius: 10px;
        width: 100%;
        min-height: 44px;
        justify-content: flex-start;
    }
    
    .nav-link-hexa:hover {
        background-color: rgba(148, 99, 23, 0.1);
        transform: translateX(5px);
    }
}

/* Container and Grid Fixes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 576px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (min-width: 768px) {
    .container {
        padding-left: 30px;
        padding-right: 30px;
    }
}

@media (min-width: 992px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Section Spacing */
section {
    padding: 60px 0;
    overflow: hidden;
}

@media (max-width: 767.98px) {
    section {
        padding: 40px 0;
    }
}

@media (max-width: 575.98px) {
    section {
        padding: 30px 0;
    }
}

/* Footer Fixes */
.footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    margin-top: 60px;
    padding: 60px 0 30px;
}

@media (max-width: 767.98px) {
    .footer {
        margin-top: 40px;
        padding: 40px 0 20px;
    }
}

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

/* Button Fixes */
.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-height: 44px;
}

.btn-alwaqdan {
    background: linear-gradient(135deg, #946317, #b8751f);
    color: white;
    border: none;
}

.btn-alwaqdan:hover {
    background: linear-gradient(135deg, #b8751f, #946317);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(148, 99, 23, 0.3);
}

.btn-outline-alwaqdan {
    background: transparent;
    color: #946317;
    border: 2px solid #946317;
}

.btn-outline-alwaqdan:hover {
    background: #946317;
    color: white;
    border-color: #946317;
}

/* Text and Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Tajawal', 'Arial', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #2c3e50;
}

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Responsive Typography */
@media (max-width: 767.98px) {
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.4rem;
    }
    
    h4 {
        font-size: 1.2rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-left {
    text-align: left !important;
}

.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

/* Accessibility Improvements */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #946317;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
}

.skip-to-content:focus {
    top: 6px;
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .floating-contact-btn {
        display: none !important;
    }
    
    body {
        color: #000 !important;
        background: #fff !important;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
    }
}
