/**
 * Custom Bootstrap Overrides
 * تخصيصات Bootstrap
 */

/* إصلاح الـ Container */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* إصلاح الـ Row */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

/* إصلاح الأعمدة */
.col,
.col-md-2,
.col-md-3,
.col-md-4,
.col-md-6,
.col-md-12 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 768px) {
    .col-md-2 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
    
    .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* تحسين الأزرار */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    color: #fff;
    background-color: #14664c;
    border-color: #14664c;
}

.btn-primary:hover {
    background-color: #0d5940;
    border-color: #0d5940;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* تحسين الـ Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.5rem;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1.5rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: #14664c;
    background-color: #f8f9fa;
}

/* تحسين الفوتر للموبايل */
@media (max-width: 767px) {
    .main-footer {
        overflow-x: hidden;
    }
    
    .footer-top {
        padding: 2rem 0;
    }
    
    .footer-column {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        text-align: center;
        margin-bottom: 2rem;
        padding: 0 15px;
    }
    
    .footer-logo {
        justify-content: center !important;
        margin-bottom: 1rem;
    }
    
    .footer-logo img {
        max-width: 60px;
    }
    
    .footer-desc {
        text-align: center;
        font-size: 0.9rem;
        padding: 0 10px;
    }
    
    .widget-title {
        text-align: center;
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .footer-links {
        list-style: none;
        padding: 0;
        text-align: center;
    }
    
    .footer-links li {
        margin-bottom: 0.5rem;
    }
    
    .contact-info .contact-item {
        justify-content: center;
        margin-bottom: 1rem;
        font-size: 0.9rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-bottom {
        padding: 1rem;
        text-align: center;
    }
    
    .copyright-text {
        font-size: 0.85rem;
    }
}

/* تحسين WhatsApp Button */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    color: white;
}

/* تحسين Back to Top */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: #14664c;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(20, 102, 76, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
}

.back-to-top:hover {
    background: #0d5940;
    transform: translateY(-3px);
}

.back-to-top.show {
    display: flex;
}

/* إصلاح overflow على الموبايل */
@media (max-width: 767px) {
    body {
        overflow-x: hidden;
    }
    
    .container {
        max-width: 100%;
        padding: 0 10px;
        overflow-x: hidden;
    }
    
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .col,
    [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Top Bar على الموبايل */
    .top-bar {
        padding: 0.5rem 0;
        overflow-x: hidden;
    }
    
    .top-bar-content {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .contact-info {
        font-size: 0.85rem;
    }
    
    /* Header على الموبايل */
    .main-header {
        padding: 0.75rem 0;
    }
    
    .header-content {
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    
    .logo img {
        max-height: 45px;
    }
    
    /* Navigation Actions على الموبايل */
    .nav-actions {
        position: fixed;
        top: 70px;
        right: 10px;
        z-index: 2000;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Language Switcher على الموبايل */
    .main-nav .language-switcher {
        position: relative;
    }
    
    .main-nav .current-lang {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        border-radius: 20px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    }
    
    .main-nav .current-lang .lang-name {
        display: none;
    }
    
    .main-nav .current-lang .fa-globe {
        font-size: 1rem;
    }
    
    .main-nav .current-lang .fa-chevron-down {
        font-size: 0.7rem;
    }
    
    .language-dropdown {
        min-width: 140px;
        right: 0;
        left: auto;
    }
    
    .language-option {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .language-option .flag {
        font-size: 1.2rem;
    }
    
    /* Header CTA على الموبايل */
    .header-cta .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        border-radius: 20px;
    }
    
    .header-cta .btn i {
        font-size: 0.9rem;
    }
}
