/* ===========================================
   MOBILE APP EXPERIENCE - مؤسستي
   تجربة الموبايل زي الأبليكيشن
=========================================== */

/* ============ VARIABLES ============ */
:root {
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --bottom-nav-height: 65px;
}

/* ============ SMOOTH SCROLLING ============ */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ============ HIDE SCROLLBAR (App-like) ============ */
@media (max-width: 768px) {
    body {
        scrollbar-width: none;
        -ms-overflow-style: none;
        overscroll-behavior-y: contain;
    }
    body::-webkit-scrollbar {
        display: none;
    }
}

/* ============ TOUCH OPTIMIZATIONS ============ */
@media (max-width: 992px) {
    a, button, .btn, .service-card, .feature-card, .testimonial-card, .faq-question {
        -webkit-tap-highlight-color: rgba(243, 156, 18, 0.15);
        touch-action: manipulation;
    }
    
    /* Larger touch targets */
    .btn, .btn-primary, .btn-outline, .btn-accent, .btn-white {
        min-height: 50px;
        padding: 14px 28px;
    }
}

/* ============ BOTTOM NAVIGATION BAR ============ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    padding: 8px 0;
    padding-bottom: calc(8px + var(--safe-area-bottom));
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #888;
    font-size: 11px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 55px;
    position: relative;
}

.bottom-nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: #f39c12;
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-radius: 0 0 3px 3px;
}

/* WhatsApp button in center */
.bottom-nav-item.whatsapp-nav {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white !important;
    border-radius: 50%;
    width: 58px;
    height: 58px;
    margin-top: -30px;
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.45);
    padding: 0;
    min-width: 58px;
}

.bottom-nav-item.whatsapp-nav i {
    font-size: 28px;
    margin-bottom: 0;
}

.bottom-nav-item.whatsapp-nav span {
    display: none;
}

.bottom-nav-item.whatsapp-nav:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .bottom-nav {
        display: block;
    }
    
    /* Add padding to body for bottom nav */
    body {
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 10px);
    }
    
    /* Hide floating WhatsApp */
    .float-whatsapp {
        display: none !important;
    }
    
    /* Adjust back to top */
    .back-to-top {
        bottom: calc(var(--bottom-nav-height) + 25px);
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    /* Adjust floating notification */
    .floating-notification {
        bottom: calc(var(--bottom-nav-height) + 20px);
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

/* ============ IMPROVED HEADER MOBILE ============ */
@media (max-width: 768px) {
    .top-bar {
        padding: 10px 0;
    }
    
    .top-bar .container {
        justify-content: center;
    }
    
    .top-bar-right {
        gap: 15px;
    }
    
    .social-icons {
        display: none;
    }
    
    .header-main {
        padding: 12px 0;
    }
    
    .logo img {
        height: 50px;
    }
    
    .menu-toggle {
        width: 46px;
        height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        background: rgba(44, 62, 80, 0.08);
        font-size: 24px;
    }
}

/* ============ IMPROVED MOBILE MENU ============ */
@media (max-width: 992px) {
    .mobile-menu {
        width: 80%;
        max-width: 300px;
        background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
        padding: 90px 25px 30px;
        border-radius: 0 25px 25px 0;
    }
    
    .mobile-menu a {
        padding: 18px 15px;
        font-size: 16px;
        border-radius: 12px;
        margin-bottom: 5px;
        border-bottom: none;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .mobile-menu a:hover,
    .mobile-menu a.active {
        background: rgba(243, 156, 18, 0.15);
        color: #f39c12;
    }
    
    .mobile-menu a i {
        width: 24px;
        text-align: center;
        color: #f39c12;
    }
    
    .mobile-menu .close-menu {
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        top: 25px;
        font-size: 24px;
    }
    
    .menu-overlay {
        backdrop-filter: blur(5px);
        background: rgba(0, 0, 0, 0.6);
    }
}

/* ============ HERO MOBILE ============ */
@media (max-width: 768px) {
    .hero {
        min-height: 85vh;
        padding: 40px 0;
    }
    
    .hero h1 {
        font-size: 28px;
        line-height: 1.4;
    }
    
    .hero p {
        font-size: 15px;
    }
    
    .hero-badge {
        padding: 10px 20px;
        font-size: 12px;
    }
    
    .hero-btns {
        gap: 12px;
    }
    
    .hero-btns .btn {
        width: 100%;
        justify-content: center;
        padding: 16px 20px;
        font-size: 15px;
    }
}

/* ============ STATS MOBILE ============ */
@media (max-width: 768px) {
    .stats {
        margin-top: -50px;
    }
    
    .stats-grid {
        border-radius: 15px;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-item {
        padding: 25px 15px;
    }
    
    .stat-item:not(:last-child)::after {
        display: none;
    }
    
    .stat-number {
        font-size: 32px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .stat-icon {
        font-size: 28px;
    }
}

/* ============ SERVICES MOBILE ============ */
@media (max-width: 768px) {
    .services {
        padding: 60px 0;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .section-header h2 {
        font-size: 26px;
    }
    
    .section-header p {
        font-size: 14px;
    }
    
    .services-grid {
        gap: 15px;
    }
    
    .service-card {
        padding: 30px 20px;
        border-radius: 15px;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 26px;
        border-radius: 15px;
    }
    
    .service-card h3 {
        font-size: 17px;
    }
    
    .service-card p {
        font-size: 13px;
    }
}

/* ============ FEATURES MOBILE ============ */
@media (max-width: 768px) {
    .features {
        padding: 60px 0;
    }
    
    .features-grid {
        gap: 15px;
    }
    
    .feature-card {
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    .feature-card i {
        font-size: 36px;
    }
    
    .feature-card h3 {
        font-size: 16px;
    }
}

/* ============ TESTIMONIALS MOBILE ============ */
@media (max-width: 768px) {
    .testimonials-section {
        padding: 60px 0;
    }
    
    .testimonials-header h2 {
        font-size: 24px;
    }
    
    .testimonial-card {
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    .testimonial-text {
        font-size: 14px;
    }
}

/* ============ FAQ MOBILE ============ */
@media (max-width: 768px) {
    .faq-section {
        padding: 60px 0;
    }
    
    .faq-header h2 {
        font-size: 24px;
    }
    
    .faq-item {
        border-radius: 12px;
    }
    
    .faq-question {
        padding: 18px 20px;
        font-size: 14px;
    }
    
    .faq-answer-content {
        font-size: 13px;
        padding: 0 20px 18px;
    }
}

/* ============ CTA MOBILE ============ */
@media (max-width: 768px) {
    .cta {
        padding: 60px 0;
    }
    
    .cta-box {
        padding: 35px 20px;
        border-radius: 20px;
    }
    
    .cta-content h2 {
        font-size: 24px;
    }
    
    .cta-content p {
        font-size: 14px;
    }
    
    .cta-btns {
        width: 100%;
    }
    
    .cta-btns .btn-accent,
    .cta-btns .btn-white {
        width: 100%;
        justify-content: center;
        padding: 16px 20px;
    }
}

/* ============ FOOTER MOBILE ============ */
@media (max-width: 768px) {
    footer {
        padding: 50px 0 20px;
        padding-bottom: calc(20px + var(--bottom-nav-height));
    }
    
    .footer-grid {
        gap: 35px;
    }
    
    .footer-about img {
        height: 50px;
    }
    
    .footer-about p {
        font-size: 13px;
    }
    
    .footer-links h4,
    .footer-contact h4 {
        font-size: 16px;
        margin-bottom: 18px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}

/* ============ POPUP MOBILE ============ */
@media (max-width: 768px) {
    .marketing-popup {
        margin: 15px;
        border-radius: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .popup-header {
        padding: 30px 20px 25px;
    }
    
    .popup-header h3 {
        font-size: 22px;
    }
    
    .popup-body {
        padding: 25px 20px;
    }
    
    .countdown-timer {
        gap: 10px;
    }
    
    .countdown-number {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .popup-cta .btn-popup {
        width: 100%;
        justify-content: center;
        padding: 16px 30px;
    }
}

/* ============ VIDEO SECTION MOBILE ============ */
@media (max-width: 768px) {
    .video-section {
        padding: 60px 0;
    }
    
    .video-container {
        border-radius: 15px;
        margin: 0 15px;
    }
    
    .play-btn {
        width: 80px;
        height: 80px;
    }
    
    .play-btn i {
        font-size: 32px;
    }
}

/* ============ OFFER SECTION MOBILE ============ */
@media (max-width: 768px) {
    .offer-section {
        padding: 50px 0;
    }
    
    .offer-content h2 {
        font-size: 26px;
    }
    
    .offer-content .discount {
        font-size: 42px;
    }
    
    .offer-content p {
        font-size: 16px;
    }
}

/* ============ GUARANTEE MOBILE ============ */
@media (max-width: 768px) {
    .guarantee-section {
        padding: 50px 0;
    }
    
    .guarantee-icon {
        width: 65px;
        height: 65px;
        font-size: 32px;
    }
    
    .guarantee-content h3 {
        font-size: 22px;
    }
    
    .guarantee-content p {
        font-size: 15px;
    }
}

/* ============ DEMO SECTION MOBILE ============ */
@media (max-width: 768px) {
    .demo-section {
        padding: 60px 0;
    }
    
    .demo-content h2 {
        font-size: 24px;
    }
    
    .demo-content p {
        font-size: 14px;
    }
    
    .demo-image img {
        border-radius: 15px;
    }
}

/* ============ FOUNDER SECTION MOBILE ============ */
@media (max-width: 768px) {
    .founder-section {
        padding: 60px 0;
    }
    
    .founder-container {
        flex-direction: column;
        gap: 40px;
    }
    
    .founder-image-wrapper {
        flex: none;
        width: 100%;
    }
    
    .founder-image-frame {
        width: 250px;
        height: 300px;
    }
}

/* ============ CARDS SWIPE EFFECT ============ */
@media (max-width: 768px) {
    .services-grid,
    .features-grid,
    .testimonials-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .service-card,
    .feature-card,
    .testimonial-card {
        width: 100%;
    }
}

/* ============ LOADING ANIMATION ============ */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #2c3e50;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s, visibility 0.4s;
}

.page-loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.page-loading .loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(243, 156, 18, 0.2);
    border-top-color: #f39c12;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ PULL DOWN INDICATOR ============ */
.pull-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    z-index: 9998;
    transform: translateY(-100%);
    transition: transform 0.3s;
}

/* ============ ACTIVE STATE FOR TOUCH ============ */
@media (max-width: 768px) {
    .btn:active,
    .service-card:active,
    .feature-card:active,
    .testimonial-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .bottom-nav-item:active {
        transform: scale(0.9);
    }
    
    .bottom-nav-item.whatsapp-nav:active {
        transform: scale(0.92);
    }
}
