/**
* MOBILE ENHANCEMENTS
* Premium mobile experience and touch optimizations
* 2025/2026 Mobile-First Design
*/

/* ============================================
  TOUCH OPTIMIZATIONS
  ============================================ */
.touch-optimized {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
    touch-action: manipulation;
}

button,
a,
input,
select,
textarea {
    min-height: 44px; /* iOS touch target minimum */
    min-width: 44px;
}

/* ============================================
  MOBILE NAVIGATION
  ============================================ */
.mobile-nav-enhanced {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
    display: none;
}

body.dark-mode .mobile-nav-enhanced {
    background: rgba(0, 0, 0, 0.95);
    border-top-color: var(--dark-border-color);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 8px;
    text-decoration: none;
    color: var(--text-color-light);
    transition: all 0.3s ease;
    font-size: 0.75rem;
    gap: 4px;
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

.mobile-nav-item.active {
    color: #667eea;
}

.mobile-nav-item:active {
    transform: scale(0.95);
    opacity: 0.7;
}

/* ============================================
  SWIPE GESTURES
  ============================================ */
.swipeable {
    touch-action: pan-y;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.swipeable-item {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* ============================================
  PULL TO REFRESH
  ============================================ */
.pull-to-refresh {
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pull-to-refresh-indicator {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.pull-to-refresh-indicator.active {
    opacity: 1;
    animation: spin 1s linear infinite;
}

/* ============================================
  MOBILE CARDS
  ============================================ */
.mobile-card {
    margin: 12px;
    border-radius: 16px;
    background: var(--background-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

body.dark-mode .mobile-card {
    background: var(--dark-background-color);
}

/* ============================================
  MOBILE FORMS
  ============================================ */
@media (max-width: 768px) {
    .form-enhanced {
        padding: 20px 16px;
        margin: 0 12px;
    }

    .form-input-enhanced,
    .form-textarea-enhanced,
    .form-select-enhanced {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .form-footer {
        flex-direction: column-reverse;
    }

    .form-footer button {
        width: 100%;
        margin-bottom: 12px;
    }
}

/* ============================================
  SAFE AREAS (NOTCH SUPPORT)
  ============================================ */
.safe-area-top {
    padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-left {
    padding-left: env(safe-area-inset-left);
}

.safe-area-right {
    padding-right: env(safe-area-inset-right);
}

/* ============================================
  MOBILE MODALS
  ============================================ */
@media (max-width: 768px) {
    .modal,
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .modal-content {
        height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-header {
        border-radius: 0;
    }

    .modal-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
  MOBILE BUTTONS
  ============================================ */
@media (max-width: 768px) {
    .btn-premium {
        width: 100%;
        padding: 16px;
        font-size: 1rem;
    }

    .btn-premium-outline {
        width: 100%;
    }
}

/* ============================================
  MOBILE TYPOGRAPHY
  ============================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.5rem;
        line-height: 1.4;
    }

    p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* ============================================
  MOBILE SPACING
  ============================================ */
@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    section {
        padding: 40px 0;
    }
}

/* ============================================
  ORIENTATION CHANGES
  ============================================ */
@media (orientation: landscape) and (max-height: 500px) {
    .mobile-nav-enhanced {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 40px 0;
    }
}

/* ============================================
  MOBILE ANIMATIONS
  ============================================ */
@media (max-width: 768px) {
    .particle,
    .morphing-shape,
    .abstract-graphic {
        display: none; /* Hide for performance */
    }

    .fade-in,
    .slide-in-left,
    .slide-in-right {
        animation-duration: 0.3s; /* Faster on mobile */
    }
}

/* ============================================
  ACCESSIBILITY
  ============================================ */
@media (prefers-reduced-motion: reduce) {
    .mobile-nav-item:active {
        transform: none;
    }

    .pull-to-refresh-indicator {
        animation: none;
    }
}

