/**
 * RTL Styles for Ibn Mandhour Theme
 * Arabic Right-to-Left Support
 *
 * @package IbnMandhour
 */

/* ==========================================================================
   Base RTL
   ========================================================================== */

html[dir="rtl"],
body.rtl {
    direction: rtl;
    text-align: right;
}

/* ==========================================================================
   Typography
   ========================================================================== */

body.rtl {
    font-family: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
}

body.rtl h1,
body.rtl h2,
body.rtl h3,
body.rtl h4,
body.rtl h5,
body.rtl h6 {
    font-family: 'Cairo', sans-serif;
}

/* ==========================================================================
   Layout Fixes
   ========================================================================== */

body.rtl .container,
body.rtl .container-fluid {
    direction: rtl;
}

/* Row reverse only on desktop */
@media (min-width: 992px) {
    body.rtl .row {
        flex-direction: row-reverse;
    }
}

body.rtl .text-left {
    text-align: right !important;
}

body.rtl .text-right {
    text-align: left !important;
}

body.rtl .float-left {
    float: right !important;
}

body.rtl .float-right {
    float: left !important;
}

/* Margin/Padding Fixes */
body.rtl .ml-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

body.rtl .mr-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

body.rtl .pl-0 {
    padding-right: 0 !important;
}

body.rtl .pr-0 {
    padding-left: 0 !important;
}

/* ==========================================================================
   Header
   ========================================================================== */

body.rtl .header-wrapper {
    flex-direction: row-reverse;
}

body.rtl .header-logo {
    margin-left: auto;
    margin-right: 0;
}

body.rtl .header-right {
    margin-right: auto;
    margin-left: 0;
}

body.rtl .header-menu .navbar-nav {
    flex-direction: row-reverse;
}

body.rtl .contact-list {
    flex-direction: row-reverse;
}

body.rtl .contact-list li {
    margin-left: 30px;
    margin-right: 0;
}

body.rtl .contact-list li i {
    margin-left: 8px;
    margin-right: 0;
}

/* Navigation */
body.rtl .nav-item .dropdown-menu {
    right: 0;
    left: auto;
    text-align: right;
}

body.rtl .dropdown-toggle::after {
    margin-right: 0.5em;
    margin-left: 0;
}

/* Mobile Menu */
body.rtl .mobile-menu-container {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

body.rtl .mobile-menu-container.active {
    transform: translateX(0);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

body.rtl .hero-content {
    text-align: right;
}

body.rtl .hero-buttons {
    justify-content: flex-start;
}

body.rtl .hero-buttons .theme-btn i {
    margin-right: 10px;
    margin-left: 0;
    transform: rotate(180deg);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

body.rtl .theme-btn i,
body.rtl .read-more i {
    margin-right: 8px;
    margin-left: 0;
}

body.rtl .theme-btn i.fa-arrow-left,
body.rtl .read-more i.fa-arrow-left {
    transform: rotate(0);
}

body.rtl .theme-btn i.fa-arrow-right,
body.rtl .read-more i.fa-arrow-right {
    transform: rotate(180deg);
}

/* ==========================================================================
   Cards
   ========================================================================== */

body.rtl .program-card,
body.rtl .news-card,
body.rtl .team-card,
body.rtl .event-card {
    text-align: right;
}

body.rtl .program-icon {
    right: auto;
    left: 20px;
}

body.rtl .post-date,
body.rtl .event-date,
body.rtl .news-date {
    right: auto;
    left: 20px;
}

/* Meta Items */
body.rtl .post-meta .meta-item,
body.rtl .program-meta .meta-item,
body.rtl .event-meta .meta-item,
body.rtl .news-meta .meta-item {
    margin-left: 15px;
    margin-right: 0;
}

body.rtl .meta-item i {
    margin-left: 5px;
    margin-right: 0;
}

/* ==========================================================================
   About Section
   ========================================================================== */

body.rtl .about-content {
    padding-right: 0;
    padding-left: 30px;
}

body.rtl .experience-badge {
    right: auto;
    left: 30px;
}

body.rtl .about-feature-item .icon {
    margin-left: 15px;
    margin-right: 0;
}

/* ==========================================================================
   Team Section
   ========================================================================== */

body.rtl .team-social ul {
    flex-direction: row-reverse;
}

body.rtl .team-social li {
    margin-left: 10px;
    margin-right: 0;
}

/* ==========================================================================
   Testimonials
   ========================================================================== */

body.rtl .testimonial-card {
    text-align: right;
}

body.rtl .quote-icon {
    right: auto;
    left: 20px;
}

body.rtl .client-image {
    margin-left: 15px;
    margin-right: 0;
}

body.rtl .testimonial-rating {
    direction: ltr;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

body.rtl .contact-info-item .icon {
    margin-left: 15px;
    margin-right: 0;
}

body.rtl .form-group label {
    text-align: right;
}

/* ==========================================================================
   Footer
   ========================================================================== */

body.rtl .footer-widgets-wrapper {
    text-align: right;
}

body.rtl .footer-links,
body.rtl .footer-contact-list {
    padding-right: 0;
}

body.rtl .footer-links li a::before {
    content: "\f053";
    margin-left: 10px;
    margin-right: 0;
}

body.rtl .footer-social ul {
    flex-direction: row-reverse;
}

body.rtl .footer-bottom-wrapper {
    flex-direction: row-reverse;
}

body.rtl .footer-contact-list li i {
    margin-left: 10px;
    margin-right: 0;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

body.rtl .sidebar-area {
    padding-right: 0;
    padding-left: 30px;
}

body.rtl .widget ul {
    padding-right: 0;
}

body.rtl .widget li::before {
    left: auto;
    right: 0;
}

body.rtl .recent-post-item .post-thumb {
    margin-left: 15px;
    margin-right: 0;
}

body.rtl .tagcloud a {
    margin-left: 5px;
    margin-right: 0;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

body.rtl .breadcrumb {
    flex-direction: row-reverse;
}

body.rtl .breadcrumb-separator i {
    transform: rotate(180deg);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

body.rtl .pagination,
body.rtl .nav-links {
    flex-direction: row-reverse;
}

body.rtl .page-numbers.prev i {
    transform: rotate(180deg);
}

body.rtl .page-numbers.next i {
    transform: rotate(180deg);
}

/* ==========================================================================
   Post Navigation
   ========================================================================== */

body.rtl .post-navigation .prev-post {
    text-align: right;
}

body.rtl .post-navigation .next-post {
    text-align: left;
}

body.rtl .nav-label i.fa-arrow-right {
    transform: rotate(180deg);
}

body.rtl .nav-label i.fa-arrow-left {
    transform: rotate(180deg);
}

/* ==========================================================================
   Social Links
   ========================================================================== */

body.rtl .social-links {
    flex-direction: row-reverse;
}

body.rtl .social-links li {
    margin-left: 10px;
    margin-right: 0;
}

body.rtl .share-links {
    flex-direction: row-reverse;
}

body.rtl .share-label {
    margin-left: 15px;
    margin-right: 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */

body.rtl input,
body.rtl textarea,
body.rtl select {
    text-align: right;
}

body.rtl .input-group {
    flex-direction: row-reverse;
}

body.rtl .input-group .form-control {
    border-radius: 0 8px 8px 0;
}

body.rtl .input-group .theme-btn {
    border-radius: 8px 0 0 8px;
}

/* ==========================================================================
   Lists
   ========================================================================== */

body.rtl ul,
body.rtl ol {
    padding-right: 0;
    padding-left: 20px;
}

body.rtl li {
    text-align: right;
}

/* ==========================================================================
   Icons
   ========================================================================== */

body.rtl .fa-chevron-right::before {
    content: "\f053";
}

body.rtl .fa-chevron-left::before {
    content: "\f054";
}

body.rtl .fa-angle-right::before {
    content: "\f104";
}

body.rtl .fa-angle-left::before {
    content: "\f105";
}

/* ==========================================================================
   Swiper RTL
   ========================================================================== */

body.rtl .swiper {
    direction: rtl;
}

body.rtl .swiper-button-next {
    right: auto;
    left: 10px;
    transform: rotate(180deg);
}

body.rtl .swiper-button-prev {
    left: auto;
    right: 10px;
    transform: rotate(180deg);
}

/* ==========================================================================
   Phone Number Display (LTR for numbers in RTL)
   ========================================================================== */

body.rtl .author-icon .content h5,
body.rtl .author-icon .content h5 a,
body.rtl a[href^="tel:"] {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
}

/* Fix phone icon - SVG with integrated circle */
.about-author .author-icon .icon,
.activities-content .about-author .author-icon .icon,
.about-activities-wrapper .activities-content .about-author .author-icon .icon,
.about-activities-wrapper.style-2 .activities-content .about-author .author-icon .icon,
.about-wrapper .about-content .about-author .author-icon .icon,
.about-wrapper-2 .about-content .about-author .author-icon .icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    padding: 0 !important;
    position: relative !important;
}

/* Remove the ::before pseudo-element circle */
.about-author .author-icon .icon::before,
.activities-content .about-author .author-icon .icon::before,
.about-activities-wrapper .activities-content .about-author .author-icon .icon::before,
.about-activities-wrapper.style-2 .activities-content .about-author .author-icon .icon::before,
.about-wrapper .about-content .about-author .author-icon .icon::before,
.about-wrapper-2 .about-content .about-author .author-icon .icon::before {
    display: none !important;
    content: none !important;
}

.about-author .author-icon .icon svg {
    display: block;
    width: 60px;
    height: 60px;
}

/* ==========================================================================
   CTA Section
   ========================================================================== */

body.rtl .cta-content {
    text-align: right;
}

body.rtl .cta-buttons {
    text-align: left;
}

body.rtl .cta-phone {
    text-align: left;
}

/* ==========================================================================
   Feature Cards
   ========================================================================== */

body.rtl .feature-card .icon {
    margin-left: 15px;
    margin-right: 0;
}

body.rtl .feature-card .content {
    text-align: right;
}

/* ==========================================================================
   Counter Section
   ========================================================================== */

body.rtl .counter-item {
    text-align: center;
}

/* ==========================================================================
   Error Page
   ========================================================================== */

body.rtl .error-content {
    text-align: center;
}

body.rtl .error-buttons {
    justify-content: center;
}

/* ==========================================================================
   Comments
   ========================================================================== */

body.rtl .comment-author img {
    margin-left: 15px;
    margin-right: 0;
}

body.rtl .comment-reply-link {
    float: left;
}

body.rtl .comment-list .children {
    padding-right: 30px;
    padding-left: 0;
}

/* ==========================================================================
   Author Box
   ========================================================================== */

body.rtl .author-box .author-avatar {
    margin-left: 20px;
    margin-right: 0;
}

/* ==========================================================================
   Responsive RTL Fixes
   ========================================================================== */

@media (max-width: 991px) {
    body.rtl .sidebar-area {
        padding-left: 0;
    }

    body.rtl .about-content {
        padding-left: 0;
        margin-top: 30px;
    }

    body.rtl .row {
        flex-direction: column;
    }
}

@media (max-width: 767px) {
    body.rtl .header-wrapper {
        flex-wrap: wrap;
    }

    body.rtl .footer-bottom-wrapper {
        flex-direction: column;
        text-align: center;
    }

    body.rtl .cta-buttons {
        text-align: center;
        margin-top: 20px;
    }
}

/* ==========================================================================
   Enhanced Responsive Design
   ========================================================================== */

/* Mobile First - Base Styles */
@media (max-width: 575.98px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .section-padding {
        padding: 40px 0;
    }

    .section-title h2 {
        font-size: 24px;
        line-height: 1.4;
    }

    .section-title span {
        font-size: 14px;
    }

    /* Hero Mobile */
    .hero-section {
        padding: 60px 0 40px;
    }

    .hero-section .hero-content h1 {
        font-size: 26px;
        line-height: 1.4;
    }

    .hero-section .hero-content p {
        font-size: 14px;
    }

    .hero-image img {
        max-width: 280px;
        margin: 0 auto;
    }

    /* Header Mobile */
    .header-top-section {
        display: none;
    }

    .header-main .logo img {
        max-height: 45px;
    }

    .header-button {
        display: none;
    }

    /* Programs Mobile */
    .program-box-items-2 {
        margin-bottom: 20px;
    }

    /* Team Mobile */
    .team-card-items {
        max-width: 280px;
        margin: 0 auto 20px;
    }

    /* Contact Mobile */
    .contact-wrapper {
        padding: 30px 20px;
    }

    /* Footer Mobile */
    .footer-widgets-wrapper {
        padding: 40px 0;
    }

    .single-footer-widget {
        margin-bottom: 30px;
        text-align: center;
    }

    .footer-bottom .footer-wrapper {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .footer-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Social Preview Mobile */
    .social-preview-card {
        margin-bottom: 20px;
    }

    .preview-thumbnails {
        gap: 5px;
    }

    .preview-thumb {
        border-radius: 6px;
    }

    /* Buttons Mobile */
    .theme-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    /* About Section Mobile */
    .about-author {
        flex-direction: column;
        gap: 20px;
    }

    .author-icon {
        width: 100%;
        justify-content: center;
    }

    /* Counter Mobile */
    .counter-items {
        margin-bottom: 20px;
    }

    .counter-items h2 {
        font-size: 32px;
    }
}

/* Small tablets */
@media (min-width: 576px) and (max-width: 767.98px) {
    .section-title h2 {
        font-size: 28px;
    }

    .hero-section .hero-content h1 {
        font-size: 32px;
    }

    .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 991.98px) {
    .section-title h2 {
        font-size: 32px;
    }

    .hero-section .hero-content h1 {
        font-size: 38px;
    }

    .header-top-section .contact-list {
        font-size: 13px;
    }

    body.rtl .row {
        flex-direction: row;
    }
}

/* Large tablets / Small desktops */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }

    .hero-section .hero-content h1 {
        font-size: 42px;
    }
}

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

/* Large Desktop */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .theme-btn,
    .social-icon a,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
    }

    .preview-thumb:hover img {
        transform: none;
    }

    .social-preview-card:hover {
        transform: none;
    }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .preloader-fast {
        display: none !important;
    }
}

/* Print Styles */
@media print {
    .preloader-fast,
    .header-section,
    .footer-section,
    .social-preview-section {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }
}

/* ==========================================================================
   Logo Visibility
   ========================================================================== */

.header-main .logo img,
.header-logo img {
    max-height: 60px;
    width: auto;
    min-width: 180px;
}


#scrollUp {
    background: #D4AF37;
    color: #1e3a5f;
}

#scrollUp:hover {
    background: #fff;
}

/* ==========================================================================
   Team Section Enhancements
   ========================================================================== */

.team-content .team-desc {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    margin-bottom: 10px;
}

.team-box-items .team-content h3 {
    margin-bottom: 5px;
}

.team-box-items .team-content p {
    color: var(--theme);
    font-weight: 600;
    margin-bottom: 0;
}

/* ==========================================================================
   Social Media Preview Section
   ========================================================================== */

.social-preview-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.social-preview-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.social-preview-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.social-preview-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #1877f2 0%, #0d65d9 100%);
    color: #fff;
}

.tiktok-card .social-preview-header {
    background: linear-gradient(135deg, #000 0%, #25f4ee 50%, #fe2c55 100%);
}

.social-icon-large {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.social-info h4 {
    margin: 0 0 5px;
    font-size: 18px;
    color: #fff;
}

.social-info span {
    opacity: 0.9;
    font-size: 14px;
}

.social-preview-body {
    padding: 20px;
}

.preview-thumbnails {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.preview-thumb {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
}

.preview-thumb.vertical {
    aspect-ratio: 9/16;
}

.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.preview-thumb:hover img {
    transform: scale(1.1);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-thumb:hover .play-overlay {
    opacity: 1;
}

.video-views {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.preview-text {
    color: #666;
    font-size: 14px;
    margin: 0;
    text-align: center;
}

.social-preview-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #eee;
}

.facebook-btn {
    background: #1877f2 !important;
    border-color: #1877f2 !important;
}

.facebook-btn:hover {
    background: #0d65d9 !important;
}

.tiktok-btn {
    background: linear-gradient(135deg, #25f4ee 0%, #fe2c55 100%) !important;
    border: none !important;
}

.tiktok-btn:hover {
    background: linear-gradient(135deg, #fe2c55 0%, #25f4ee 100%) !important;
}

.social-preview-footer .theme-btn i {
    margin-left: 10px;
}

/* ==========================================================================
   Hide Broken Shape Images
   ========================================================================== */

/* Hide decorative shapes that may not load */
img[alt="shape-img"] {
    display: none !important;
}

/* Or show only if image loads successfully */
.shape-1 img,
.shape-2 img,
.left-shape img,
.right-shape img,
.zebra-shape img,
.sun-shape img,
.bottom-shape img,
.line-shape img,
.box-shape img,
.love-shape img,
.frame-shape img,
.pencil-shape img,
.circle-shape img,
.radius-shape img,
.value-shape img,
.bg-shape-1 img {
    display: none !important;
}

/* ==========================================================================
   Menu Icons
   ========================================================================== */

.main-menu > nav > ul > li > a > i.fal {
    margin-left: 5px;
    font-size: 14px;
    color: var(--theme);
}

/* Hide any arrow/caret that appears as square */
.main-menu ul li.menu-item-has-children > a::after {
    display: none;
}

/* ==========================================================================
   Navigation Dropdown Menu RTL
   ========================================================================== */

/* WordPress generates .sub-menu, theme CSS uses .submenu */
.main-menu ul li .sub-menu,
.main-menu ul li .submenu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 220px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    visibility: hidden;
    opacity: 0;
    border-radius: 0 0 10px 10px;
    z-index: 9999;
    transform: translateY(10px);
    transition: all 0.3s ease-in-out;
}

.main-menu ul li:hover > .sub-menu,
.main-menu ul li:hover > .submenu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.main-menu ul li .sub-menu li,
.main-menu ul li .submenu li {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.main-menu ul li .sub-menu li a,
.main-menu ul li .submenu li a {
    position: relative;
    z-index: 11;
    font-size: 15px;
    font-weight: 500;
    color: var(--header) !important;
    padding: 10px 20px;
    display: block;
    width: 100%;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.main-menu ul li .sub-menu li:last-child a,
.main-menu ul li .submenu li:last-child a {
    border-bottom: none;
}

.main-menu ul li .sub-menu li a:hover,
.main-menu ul li .submenu li a:hover {
    background: var(--theme);
    color: #fff !important;
    padding-right: 25px;
}

/* Nested submenu (level 3) */
.main-menu ul li .sub-menu li .sub-menu,
.main-menu ul li .submenu li .submenu {
    right: 100%;
    left: auto;
    top: 0;
    visibility: hidden;
    opacity: 0;
}

.main-menu ul li .sub-menu li:hover > .sub-menu,
.main-menu ul li .submenu li:hover > .submenu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Arrow indicator for items with children */
.main-menu ul li.menu-item-has-children > a::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
    font-size: 12px;
    transition: transform 0.3s;
}

.main-menu ul li.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

/* Submenu item arrow */
.main-menu ul li .sub-menu li.menu-item-has-children > a::after,
.main-menu ul li .submenu li.menu-item-has-children > a::after {
    content: '\f104';
    position: absolute;
    left: 15px;
    right: auto;
}

/* Mobile menu dropdown */
@media (max-width: 1199px) {
    .main-menu ul li .sub-menu,
    .main-menu ul li .submenu {
        position: static;
        box-shadow: none;
        padding: 0;
        padding-right: 15px;
        visibility: visible;
        opacity: 1;
        transform: none;
        background: transparent;
        display: none;
    }

    .main-menu ul li .sub-menu.show,
    .main-menu ul li .submenu.show {
        display: block;
    }

    .main-menu ul li .sub-menu li a,
    .main-menu ul li .submenu li a {
        padding: 8px 15px;
        font-size: 14px;
    }
}

/* ==========================================================================
   MOBILE RESPONSIVE - COMPLETE REWRITE
   ========================================================================== */

/* Global Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

/* ==========================================================================
   MOBILE MENU - Hamburger Icon
   ========================================================================== */

/* Hide main menu on mobile/tablet */
@media (max-width: 1199px) {
    .main-menu {
        display: none !important;
    }

    .mean__menu-wrapper {
        display: none !important;
    }

    /* Show hamburger button */
    .header__hamburger {
        display: block !important;
    }

    .sidebar__toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 45px;
        height: 45px;
        background: #1e3a5f;
        border-radius: 8px;
        color: #fff;
        font-size: 20px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .sidebar__toggle:hover {
        background: #D4AF37;
    }

    /* Header Layout Mobile */
    .header-main {
        padding: 10px 0 !important;
    }

    .header-main .logo img {
        max-height: 45px !important;
    }

    .header-right {
        gap: 10px;
    }

    .header-button,
    .search-trigger {
        display: none !important;
    }

    .header-top-section {
        display: none !important;
    }
}

/* Offcanvas Menu Styles */
.fix-area {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    z-index: 99999;
    transition: right 0.4s ease;
    box-shadow: -5px 0 30px rgba(0,0,0,0.2);
    overflow-y: auto;
}

.fix-area.active,
.offcanvas__info.active {
    right: 0 !important;
}

.offcanvas__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.offcanvas__overlay.active {
    opacity: 1;
    visibility: visible;
}

.offcanvas__content {
    padding: 30px 25px;
}

.offcanvas__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.offcanvas__logo img {
    max-height: 50px;
}

.offcanvas__close button {
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.offcanvas__close button:hover {
    background: #D4AF37;
    color: #fff;
}

/* Mobile Menu Items */
.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu ul li {
    border-bottom: 1px solid #eee;
}

.mobile-menu ul li a {
    display: block;
    padding: 15px 0;
    color: #1e3a5f;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mobile-menu ul li a:hover {
    color: #D4AF37;
}

.mobile-menu ul li ul {
    padding-right: 20px;
}

.mobile-menu ul li ul li a {
    font-size: 14px;
    font-weight: 400;
    padding: 10px 0;
}

/* ==========================================================================
   TABLET STYLES (768px - 991px)
   ========================================================================== */

@media (max-width: 991px) {
    .container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }

    .section-padding {
        padding: 60px 0;
    }

    /* Reset row direction on mobile */
    .row {
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }

    /* Hide decorative shapes */
    .shape-img,
    .frame-shape,
    .tree-shape,
    .zebra-shape,
    [class*="shape"] img,
    img[alt="shape-img"] {
        display: none !important;
    }
}

/* ==========================================================================
   MOBILE STYLES (< 768px)
   ========================================================================== */

@media (max-width: 767px) {
    /* Hero Section */
    .hero-section {
        padding: 100px 0 50px !important;
        min-height: auto !important;
    }

    .hero-section .row {
        flex-direction: column !important;
    }

    .hero-section .col-lg-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .hero-content {
        text-align: center !important;
        padding: 0 10px;
    }

    .hero-content h1 {
        font-size: 26px !important;
        line-height: 1.4 !important;
    }

    .hero-content p {
        font-size: 15px !important;
    }

    .hero-image {
        text-align: center !important;
        margin-bottom: 30px;
    }

    .hero-image img {
        max-width: 280px !important;
        margin: 0 auto !important;
    }

    /* Section Titles */
    .section-title {
        text-align: center !important;
        padding: 0 15px;
    }

    .section-title h2 {
        font-size: 24px !important;
    }

    /* Page Header */
    .page-header-modern {
        padding-top: 100px !important;
        padding-bottom: 40px !important;
    }

    .page-header-modern h1 {
        font-size: 22px !important;
    }

    /* Footer */
    .site-footer .row {
        flex-direction: column !important;
    }

    .site-footer [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        text-align: center !important;
        margin-bottom: 25px !important;
    }

    .site-footer .footer-social {
        justify-content: center !important;
    }

    .site-footer .footer-contact li {
        justify-content: center !important;
    }
}

/* ==========================================================================
   HORIZONTAL SCROLL CARDS ON MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    /* Generic horizontal scroll container */
    .program-section-2 .row,
    .team-section .row,
    .news-section-2 .row,
    .pricing-section .row,
    .counter-section .row,
    .feature-value-section .row,
    .work-process-section-2 .row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 15px;
        padding: 10px 15px 20px !important;
        margin: 0 !important;
    }

    .program-section-2 .row::-webkit-scrollbar,
    .team-section .row::-webkit-scrollbar,
    .news-section-2 .row::-webkit-scrollbar,
    .pricing-section .row::-webkit-scrollbar,
    .counter-section .row::-webkit-scrollbar,
    .feature-value-section .row::-webkit-scrollbar,
    .work-process-section-2 .row::-webkit-scrollbar {
        display: none;
    }

    /* Cards fixed width */
    .program-section-2 .row > [class*="col-"],
    .team-section .row > [class*="col-"],
    .news-section-2 .row > [class*="col-"],
    .pricing-section .row > [class*="col-"],
    .feature-value-section .row > [class*="col-"],
    .work-process-section-2 .row > [class*="col-"] {
        flex: 0 0 280px !important;
        width: 280px !important;
        max-width: 280px !important;
        min-width: 280px !important;
        scroll-snap-align: start;
        padding: 0 !important;
        margin: 0 !important;
    }

    .counter-section .row > [class*="col-"] {
        flex: 0 0 140px !important;
        width: 140px !important;
        max-width: 140px !important;
        min-width: 140px !important;
    }

    /* Scroll indicator */
    .program-section-2::after,
    .team-section::after,
    .news-section-2::after {
        content: '← اسحب للمزيد →';
        display: block;
        text-align: center;
        color: #888;
        font-size: 13px;
        padding: 15px 0 5px;
    }

    /* Feature Value Section - Better mobile cards */
    .feature-value-section {
        padding: 50px 0 !important;
    }

    .feature-value-section .section-title {
        padding: 0 15px;
        margin-bottom: 20px;
    }

    .feature-value-section .section-title h2 {
        font-size: 22px !important;
        line-height: 1.4;
    }

    .feature-value-section .section-title p {
        font-size: 14px !important;
    }

    .feature-value-items {
        background: #fff;
        border-radius: 16px;
        padding: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
        height: 100%;
    }

    .value-icon-items {
        display: flex;
        align-items: flex-start;
        gap: 15px;
        padding: 15px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .value-icon-items:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .value-icon-items:first-child {
        padding-top: 0;
    }

    .value-icon-items .icon {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        flex-shrink: 0;
    }

    .value-icon-items .content h5 {
        font-size: 15px;
        margin-bottom: 5px;
        color: #1e3a5f;
    }

    .value-icon-items .content p {
        font-size: 13px;
        line-height: 1.6;
        color: #666;
        margin: 0;
    }

    .value-icon-items.style-2 {
        flex-direction: row-reverse;
        text-align: right;
    }

    .feature-value-image {
        display: none !important;
    }

    /* Hide middle image column on mobile */
    .feature-value-section .col-xl-4.col-lg-6:nth-child(2) {
        display: none !important;
    }

    .feature-value-section .row > [class*="col-"] {
        flex: 0 0 300px !important;
        width: 300px !important;
        max-width: 300px !important;
        min-width: 300px !important;
    }
}

/* ==========================================================================
   SMALL MOBILE (< 480px)
   ========================================================================== */

@media (max-width: 480px) {
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .section-padding {
        padding: 40px 0 !important;
    }

    .hero-content h1 {
        font-size: 22px !important;
    }

    .section-title h2 {
        font-size: 20px !important;
    }

    .theme-btn {
        padding: 12px 20px !important;
        font-size: 14px !important;
    }

    .hero-image img {
        max-width: 220px !important;
    }

    /* Cards smaller on very small screens */
    .program-section-2 .row > [class*="col-"],
    .team-section .row > [class*="col-"],
    .news-section-2 .row > [class*="col-"] {
        flex: 0 0 260px !important;
        width: 260px !important;
        max-width: 260px !important;
        min-width: 260px !important;
    }
}

/* ==========================================================================
   ENHANCED MOBILE EXPERIENCE
   ========================================================================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better touch targets */
@media (max-width: 991px) {
    a, button, .theme-btn, [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Mobile Cards Enhancement */
@media (max-width: 767px) {
    /* Program Cards */
    .program-box-items-2 {
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        overflow: hidden;
        transition: transform 0.3s ease;
    }

    .program-box-items-2:active {
        transform: scale(0.98);
    }

    .program-box-items-2 .program-image img {
        width: 100%;
        height: 180px;
        object-fit: cover;
    }

    .program-box-items-2 .program-content {
        padding: 20px;
    }

    .program-box-items-2 .program-content h4 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    /* Team Cards */
    .team-card-items,
    .team-box-items {
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        padding: 20px;
        text-align: center;
    }

    .team-card-items .team-image img,
    .team-box-items .team-image img {
        width: 120px;
        height: 120px;
        border-radius: 50%;
        object-fit: cover;
        margin: 0 auto 15px;
        border: 4px solid #D4AF37;
    }

    .team-card-items .team-content h4,
    .team-box-items .team-content h3 {
        font-size: 16px;
        color: #1e3a5f;
        margin-bottom: 5px;
    }

    .team-card-items .team-content span,
    .team-box-items .team-content p {
        font-size: 13px;
        color: #D4AF37;
    }

    /* News Cards */
    .news-card-items {
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        overflow: hidden;
    }

    .news-card-items .news-image img {
        width: 100%;
        height: 160px;
        object-fit: cover;
    }

    .news-card-items .news-content {
        padding: 20px;
    }

    .news-card-items .news-content h4 {
        font-size: 16px;
        line-height: 1.4;
    }

    /* Counter Items */
    .counter-items {
        background: linear-gradient(135deg, #1e3a5f, #2c5282);
        border-radius: 12px;
        padding: 20px 15px;
        text-align: center;
        color: #fff;
    }

    .counter-items h2 {
        font-size: 32px;
        color: #D4AF37;
        margin-bottom: 5px;
    }

    .counter-items p {
        font-size: 12px;
        color: rgba(255,255,255,0.9);
        margin: 0;
    }

    /* Feature Cards */
    .feature-card,
    .feature-card-items {
        background: #fff;
        border-radius: 16px;
        padding: 25px 20px;
        text-align: center;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    }

    .feature-card .icon,
    .feature-card-items .icon {
        width: 70px;
        height: 70px;
        background: linear-gradient(135deg, #D4AF37, #f0d078);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 15px;
    }

    .feature-card .icon i,
    .feature-card-items .icon i {
        font-size: 28px;
        color: #fff;
    }

    .feature-card h4,
    .feature-card-items h4 {
        font-size: 16px;
        color: #1e3a5f;
        margin-bottom: 10px;
    }

    .feature-card p,
    .feature-card-items p {
        font-size: 13px;
        color: #666;
        line-height: 1.6;
    }

    /* Pricing Cards */
    .pricing-card-items {
        background: #fff;
        border-radius: 16px;
        padding: 30px 20px;
        text-align: center;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        border: 2px solid transparent;
    }

    .pricing-card-items.active,
    .pricing-card-items:first-child {
        border-color: #D4AF37;
    }

    .pricing-card-items .pricing-header h4 {
        font-size: 20px;
        color: #1e3a5f;
    }

    .pricing-card-items .price h2 {
        font-size: 36px;
        color: #D4AF37;
    }

    /* Process Items */
    .process-work-items,
    .work-process-items {
        background: #fff;
        border-radius: 16px;
        padding: 25px 20px;
        text-align: center;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    }

    .process-work-items .icon,
    .work-process-items .icon {
        width: 80px;
        height: 80px;
        background: linear-gradient(135deg, #1e3a5f, #2c5282);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 15px;
    }

    .process-work-items h4,
    .work-process-items h4 {
        font-size: 16px;
        color: #1e3a5f;
    }

    /* Testimonials */
    .testimonial-card-items {
        background: #fff;
        border-radius: 16px;
        padding: 25px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    }

    .testimonial-card-items .client-img img {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        object-fit: cover;
    }

    .testimonial-card-items p {
        font-size: 14px;
        line-height: 1.7;
        color: #555;
    }

    /* About Section */
    .about-activities-section-2 .row {
        flex-direction: column !important;
    }

    .about-activities-section-2 [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .about-image-items {
        margin-bottom: 30px;
    }

    .about-image-items img {
        border-radius: 16px;
        width: 100%;
    }

    .about-content {
        text-align: center;
    }

    .about-content h2 {
        font-size: 24px;
    }

    .about-content p {
        font-size: 14px;
        line-height: 1.8;
    }

    /* CTA Section */
    .cta-section,
    .cta-banner-section {
        text-align: center;
        padding: 40px 20px;
    }

    .cta-section h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .cta-section p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .cta-section .theme-btn {
        width: 100%;
        max-width: 280px;
    }

    /* Buttons */
    .theme-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 14px 28px;
        font-size: 15px;
        font-weight: 600;
        border-radius: 10px;
        transition: all 0.3s ease;
    }

    .theme-btn:active {
        transform: scale(0.97);
    }

    /* Section spacing */
    section {
        overflow-x: hidden;
    }

    .section-padding {
        padding: 50px 0;
    }

    .section-title {
        margin-bottom: 30px;
    }

    .section-title span {
        font-size: 13px;
        display: inline-block;
        background: rgba(212,175,55,0.15);
        color: #D4AF37;
        padding: 6px 16px;
        border-radius: 20px;
        margin-bottom: 10px;
    }

    .section-title h2 {
        font-size: 24px;
        line-height: 1.4;
        color: #1e3a5f;
    }

    .section-title p {
        font-size: 14px;
        color: #666;
        max-width: 100%;
        margin: 10px auto 0;
    }
}

/* ==========================================================================
   STICKY CTA BUTTON MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    .mobile-cta-sticky {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 12px 20px;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        z-index: 9999;
        display: flex;
        gap: 10px;
    }

    .mobile-cta-sticky .theme-btn {
        flex: 1;
        text-align: center;
    }

    .mobile-cta-sticky .btn-call {
        width: 50px;
        height: 50px;
        background: #25D366;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 22px;
    }

    /* Add padding to body to account for sticky CTA */
    body {
        padding-bottom: 80px;
    }
}

/* ==========================================================================
   ANIMATIONS MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    /* Disable heavy animations on mobile */
    .wow {
        animation: none !important;
        visibility: visible !important;
    }

    /* Simple fade for cards */
    .program-box-items-2,
    .team-card-items,
    .news-card-items,
    .feature-card,
    .pricing-card-items {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   LOADING PERFORMANCE
   ========================================================================== */

/* Lazy load images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded,
img[loading="lazy"][src] {
    opacity: 1;
}

/* Prevent layout shift */
img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

@media (max-width: 767px) {
    /* Focus states */
    a:focus,
    button:focus,
    .theme-btn:focus {
        outline: 2px solid #D4AF37;
        outline-offset: 2px;
    }

    /* Skip to content link */
    .skip-link {
        position: absolute;
        top: -100%;
        left: 50%;
        transform: translateX(-50%);
        background: #1e3a5f;
        color: #fff;
        padding: 12px 24px;
        border-radius: 0 0 8px 8px;
        z-index: 100000;
        transition: top 0.3s ease;
    }

    .skip-link:focus {
        top: 0;
    }
}
