/* ================================
   MOBILE OPTIMIZATION & FIXES
   إصلاحات وتحسينات خاصة بالجوال
   ================================ */

/* ================================
   BASE MOBILE SETTINGS
   ================================ */
@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    /* Better text sizing */
    html {
        font-size: 14px;
    }
}

/* ================================
   HEADER & NAVIGATION - MOBILE
   ================================ */
@media (max-width: 768px) {
    .main-header {
        padding: 10px 0;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    /* Logo adjustments */
    .logo {
        gap: 0.5rem;
    }
    
    .logo img {
        height: 40px;
    }
    
    .logo-text {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .logo-title {
        font-size: 1.2rem !important;
    }
    
    .logo-tagline {
        font-size: 0.7rem !important;
    }
    
    /* Navigation Links */
    .nav-links {
        flex-direction: column;
        position: fixed;
        top: 70px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background: var(--color-white);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--color-light-bg);
    }
    
    .nav-link {
        padding: 15px 20px;
        justify-content: flex-start;
        width: 100%;
    }
    
    .nav-link i {
        font-size: 1.2rem;
        margin-left: 10px;
    }
    
    /* Mobile menu button */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
    }
    
    .hamburger-line {
        width: 25px;
        height: 3px;
        background: var(--color-dark);
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    /* Nav actions */
    .nav-actions {
        gap: 10px;
    }
    
    .theme-toggle,
    .lang-toggle {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* ================================
   HERO SECTION - MOBILE
   ================================ */
@media (max-width: 768px) {
    .hero-new {
        padding: 40px 0 30px;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .hero-main-title {
        font-size: 1.8rem !important;
        line-height: 1.4;
    }
    
    .hero-subtitle-new {
        font-size: 1rem !important;
        margin-bottom: 25px;
    }
    
    .hero-buttons-new {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-hero {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .hero-stats-new {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-item-new {
        padding: 15px;
    }
    
    .stat-icon-new {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-text {
        font-size: 0.85rem;
    }
    
    .hero-image-new {
        order: -1;
    }
    
    .image-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-main-title {
        font-size: 1.5rem !important;
    }
    
    .hero-subtitle-new {
        font-size: 0.9rem !important;
    }
}

/* ================================
   SECTIONS - MOBILE
   ================================ */
@media (max-width: 768px) {
    .page-header {
        padding: 40px 0 30px;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .section-header p {
        font-size: 0.95rem;
    }
}

/* ================================
   FEATURES & CARDS - MOBILE
   ================================ */
@media (max-width: 768px) {
    .features-grid,
    .goals-grid,
    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card,
    .goal-card,
    .content-type-card {
        padding: 25px;
    }
    
    .feature-icon,
    .goal-icon,
    .content-type-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .feature-card h3,
    .goal-card h3 {
        font-size: 1.3rem;
    }
    
    .feature-card p,
    .goal-card p {
        font-size: 0.95rem;
    }
}

/* ================================
   NEWS & ANALYSIS CARDS - MOBILE
   ================================ */
@media (max-width: 768px) {
    .news-grid,
    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .news-card,
    .analysis-card {
        margin-bottom: 15px;
    }
    
    .news-card-image,
    .analysis-card-image {
        height: 200px;
    }
    
    .news-card-content,
    .analysis-card-content {
        padding: 20px;
    }
    
    .news-card-title,
    .analysis-card-title {
        font-size: 1.2rem;
    }
    
    .news-card-description,
    .analysis-card-description {
        font-size: 0.9rem;
    }
}

/* ================================
   CATEGORY FILTERS - MOBILE
   ================================ */
@media (max-width: 768px) {
    .category-filters {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
        flex: 0 0 auto;
    }
    
    .filter-btn i {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .filter-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* ================================
   ANALYSIS/EDUCATION SECTIONS - MOBILE
   ================================ */
@media (max-width: 768px) {
    .analysis-category-section,
    .education-category-section {
        padding: 40px 0;
    }
    
    .category-header {
        margin-bottom: 30px;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }
    
    .category-icon i {
        font-size: 2rem;
    }
    
    .category-header h2 {
        font-size: 1.8rem;
    }
    
    .category-header p {
        font-size: 0.95rem;
    }
    
    .contact-box {
        grid-template-columns: 1fr;
        padding: 25px;
        gap: 25px;
    }
    
    .contact-content h3 {
        font-size: 1.4rem;
    }
    
    .contact-content p {
        font-size: 0.95rem;
    }
    
    .social-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .social-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .contact-image {
        min-height: 150px;
    }
    
    .contact-image i {
        font-size: 5rem;
    }
}

/* ================================
   FOOTER - MOBILE
   ================================ */
@media (max-width: 768px) {
    .footer-compact {
        padding: 25px 0 15px;
    }
    
    .footer-compact-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-links-compact {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    
    .footer-links-compact a {
        font-size: 0.85rem;
    }
    
    .footer-social-compact {
        justify-content: center;
    }
    
    .footer-social-compact a {
        width: 35px;
        height: 35px;
        font-size: 0.95rem;
    }
    
    .footer-bottom-compact {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-bottom-compact p {
        font-size: 0.85rem;
    }
    
    .footer-legal-compact {
        gap: 15px;
    }
    
    .footer-legal-compact a {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .footer-links-compact {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-social-compact {
        flex-wrap: wrap;
    }
    
    .footer-legal-compact {
        flex-direction: column;
        gap: 10px;
    }
}

/* ================================
   TRADING PLATFORM - MOBILE
   ================================ */
@media (max-width: 768px) {
    .trading-platform {
        padding: 20px 0;
    }
    
    .platform-container {
        padding: 15px;
    }
    
    .platform-header {
        padding: 15px;
    }
    
    .platform-header h2 {
        font-size: 1.3rem;
    }
    
    .balance-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .balance-item {
        padding: 12px;
    }
    
    .balance-label {
        font-size: 0.8rem;
    }
    
    .balance-value {
        font-size: 1.2rem;
    }
    
    .trading-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .chart-section,
    .trading-panel {
        padding: 15px;
    }
}

/* ================================
   ABOUT PAGE - MOBILE
   ================================ */
@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .member-card {
        max-width: 100%;
    }
    
    .member-image {
        height: 300px;
    }
    
    .member-info h3 {
        font-size: 1.4rem;
    }
    
    .member-info h4 {
        font-size: 1rem;
    }
    
    .member-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* ================================
   CONTACT PAGE - MOBILE
   ================================ */
@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .contact-form {
        padding: 25px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 1rem;
        padding: 12px;
    }
    
    .contact-info-card {
        padding: 20px;
    }
}

/* ================================
   CTA SECTIONS - MOBILE
   ================================ */
@media (max-width: 768px) {
    .cta {
        padding: 40px 0;
    }
    
    .cta h2 {
        font-size: 1.8rem;
    }
    
    .cta p {
        font-size: 1rem;
    }
    
    .education-cta {
        padding: 40px 0;
    }
    
    .education-cta h2 {
        font-size: 1.8rem;
    }
}

/* ================================
   UTILITIES - MOBILE
   ================================ */
@media (max-width: 768px) {
    /* Hide on mobile */
    .desktop-only {
        display: none !important;
    }
    
    /* Show on mobile */
    .mobile-only {
        display: block !important;
    }
    
    /* Better spacing */
    .mt-mobile {
        margin-top: 20px;
    }
    
    .mb-mobile {
        margin-bottom: 20px;
    }
    
    /* Full width buttons on mobile */
    .btn-mobile-full {
        width: 100%;
        display: block;
        text-align: center;
    }
}

/* ================================
   DARK MODE - MOBILE
   ================================ */
@media (max-width: 768px) {
    body.dark-mode .nav-links {
        background: #21262d;
    }
    
    body.dark-mode .nav-item {
        border-bottom-color: #30363d;
    }
    
    body.dark-mode .hamburger-line {
        background: #c9d1d9;
    }
}

/* ================================
   SMOOTH SCROLLING - MOBILE
   ================================ */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 70px;
    }
}

/* ================================
   TEAM MEMBERS - MOBILE FIX
   ================================ */
@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .member-image-wrapper {
        padding-top: 75%; /* تصغير الارتفاع */
    }
    
    .member-image {
        object-fit: cover;
        object-position: center top; /* التركيز على الرأس */
    }
    
    .member-card {
        max-width: 350px;
        margin: 0 auto;
    }
    
    .member-info {
        padding: 15px;
    }
    
    .member-name {
        font-size: 1.3rem;
    }
    
    .member-position {
        font-size: 0.95rem;
    }
    
    .member-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

/* ================================
   PREVENT ZOOM ON INPUT FOCUS - IOS
   ================================ */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}
