/**
 * Mobile-First UX Enhancements
 * Comprehensive mobile optimization for better user experience
 */

/* ============================================
   GLOBAL MOBILE IMPROVEMENTS
   ============================================ */

/* Better touch targets - minimum 44x44px */
@media (max-width: 768px) {
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .btn-lg {
        padding: 0.875rem 2rem;
        font-size: 1.1rem;
        min-height: 48px;
    }
}

/* ============================================
   NAVIGATION MOBILE ENHANCEMENTS
   ============================================ */

@media (max-width: 991px) {
    .navbar {
        padding: 0.75rem 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .navbar-brand {
        font-size: 1.35rem;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.5rem;
        min-width: 48px;
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
    }
    
    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }
    
    .navbar-nav {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.875rem 1rem !important;
        font-size: 1rem;
        border-radius: 8px;
        transition: all 0.2s ease;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .nav-link:hover,
    .nav-link:focus {
        background-color: rgba(0, 102, 204, 0.08);
        color: var(--primary-color) !important;
    }
    
    .nav-link:active {
        background-color: rgba(0, 102, 204, 0.15);
    }
}

/* ============================================
   HERO SECTION MOBILE
   ============================================ */

@media (max-width: 768px) {
    .hero-section {
        padding: 1.5rem 0 2rem 0 !important;
        min-height: auto !important;
    }
    
    /* Reorder: Image first, then text on mobile */
    .hero-content-wrapper {
        display: flex;
        flex-direction: column;
    }
    
    .hero-image-col {
        order: -1; /* Image appears first */
        margin-bottom: 1.5rem;
        padding-top: 0.5rem;
    }
    
    .hero-text-col {
        order: 2; /* Text appears second */
    }
    
    .hero-section h1 {
        font-size: 2rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .hero-section .lead {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .hero-section .text-muted {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    .hero-section .btn-lg {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .hero-section .d-flex {
        flex-direction: column;
    }
    
    .hero-section .d-flex .btn {
        width: 100%;
    }
    
    .profile-hero-image {
        width: 220px !important;
        height: 220px !important;
        margin: 0 auto 1rem auto;
        display: block;
    }
    
    .profile-hero-wrapper {
        margin-bottom: 0 !important;
    }
    
    .profile-placeholder {
        width: 200px !important;
        height: 200px !important;
    }
    
    .profile-placeholder svg {
        width: 200px !important;
        height: 200px !important;
    }
    
    .profile-placeholder svg text {
        font-size: 32px !important;
    }
}

/* ============================================
   SECTION TITLES MOBILE
   ============================================ */

@media (max-width: 768px) {
    .section-title {
        font-size: 1.5rem !important;
        margin-bottom: 1.25rem;
        padding-bottom: 0.5rem;
    }
    
    section {
        padding: 2.5rem 0 !important;
        scroll-margin-top: 60px;
    }
}

/* ============================================
   TIMELINE MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 768px) {
    .timeline-simple {
        padding: 0;
    }
    
    .timeline-entry {
        margin-bottom: 2.5rem !important;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .timeline-entry:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0 !important;
    }
    
    .timeline-left {
        text-align: left !important;
        padding-right: 0 !important;
        margin-bottom: 0.75rem;
    }
    
    .year-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.85rem;
        display: inline-block;
    }
    
    .timeline-title-simple {
        font-size: 1.15rem !important;
        margin-bottom: 0.25rem;
        line-height: 1.3;
    }
    
    .timeline-label {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }
    
    .timeline-content-simple {
        padding: 1.25rem !important;
        border-radius: 8px;
        margin: 0;
    }
    
    .timeline-content-simple p {
        font-size: 0.9rem;
        line-height: 1.7;
        margin-bottom: 1rem;
    }
    
    .achievement-box {
        padding: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .achievement-box i {
        font-size: 1.25rem;
    }
    
    .achievement-box div {
        font-size: 0.85rem;
    }
    
    .timeline-content-simple .badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        margin: 0.25rem 0.25rem 0.25rem 0;
    }
}

/* ============================================
   EXPERTISE CARDS MOBILE
   ============================================ */

@media (max-width: 768px) {
    .expertise-card {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem;
        text-align: left;
    }
    
    .expertise-icon {
        margin-bottom: 1rem;
    }
    
    .expertise-card h4 {
        font-size: 1.15rem;
        margin-bottom: 0.75rem;
    }
    
    .expertise-card p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

/* ============================================
   TRAVEL CARDS MOBILE
   ============================================ */

@media (max-width: 768px) {
    .travel-card {
        padding: 1.25rem !important;
        margin-bottom: 1.25rem;
    }
    
    .travel-header {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .travel-places .badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.7rem;
        margin: 0.25rem;
    }
    
    .travel-insight {
        padding: 1.5rem !important;
    margin-top: 1.5rem;
    }
    
    .travel-insight p {
        font-size: 0.9rem;
        line-height: 1.7;
    }
}

/* ============================================
   AI SECTION MOBILE
   ============================================ */

@media (max-width: 768px) {
    .ai-visual {
        padding: 2rem 1.5rem !important;
        margin-top: 1.5rem;
    }
    
    .ai-visual i {
        font-size: 3rem !important;
    }
    
    .ai-visual h4 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .ai-visual p {
        font-size: 0.9rem;
    }
}

/* ============================================
   HELP CARDS MOBILE
   ============================================ */

@media (max-width: 768px) {
    .help-card {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem;
        text-align: left;
    }
    
    .help-card i {
        font-size: 2rem !important;
        margin-bottom: 1rem;
    }
    
    .help-card h4 {
        font-size: 1.15rem;
        margin-bottom: 0.75rem;
    }
    
    .help-card p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

/* ============================================
   CONTACT FORM MOBILE ENHANCEMENTS
   ============================================ */

@media (max-width: 768px) {
    .contact-form {
        padding: 0;
    }
    
    .contact-form .form-label {
        font-size: 0.95rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: var(--text-color);
    }
    
    .contact-form .form-control,
    .contact-form .form-control-lg {
        font-size: 1rem !important;
        padding: 0.875rem 1rem !important;
        border-radius: 8px;
        border: 2px solid var(--border-color);
        min-height: 48px;
        touch-action: manipulation;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .contact-form .form-control:focus,
    .contact-form .form-control-lg:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15);
        outline: none;
    }
    
    .contact-form textarea {
        min-height: 150px !important;
        resize: vertical;
        line-height: 1.6;
    }
    
    .contact-form .btn-lg {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1.05rem;
        border-radius: 8px;
        min-height: 52px;
        font-weight: 600;
        letter-spacing: 0.5px;
    }
    
    .contact-form small {
        font-size: 0.85rem;
        display: block;
        margin-top: 0.5rem;
    }
    
    .social-links {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .social-links .btn {
        width: 100%;
        padding: 0.875rem 1.5rem;
        min-height: 48px;
    }
}

/* ============================================
   ALERTS MOBILE
   ============================================ */

@media (max-width: 768px) {
    .alert {
        padding: 1rem 1.25rem;
        border-radius: 8px;
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    .alert .btn-close {
        padding: 0.75rem;
        min-width: 44px;
        min-height: 44px;
    }
}

/* ============================================
   CONTAINER SPACING MOBILE
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ============================================
   TYPOGRAPHY MOBILE
   ============================================ */

@media (max-width: 768px) {
    body {
        font-size: 16px;
        line-height: 1.6;
        -webkit-text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
    }
    
    h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.75rem !important;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    h4 {
        font-size: 1.25rem !important;
    }
    
    .lead {
        font-size: 1.05rem !important;
    }
    
    p {
        font-size: 1rem;
        line-height: 1.7;
    }
}

/* ============================================
   BUTTONS & LINKS MOBILE
   ============================================ */

@media (max-width: 768px) {
    .btn {
        border-radius: 8px;
        font-weight: 500;
        transition: all 0.2s ease;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .btn-lg {
        font-size: 1.05rem;
        padding: 1rem 2rem;
    }
    
    a {
        -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
    }
}

/* ============================================
   SCROLL BEHAVIOR MOBILE
   ============================================ */

@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    body {
        overflow-x: hidden;
    }
    
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

/* ============================================
   FORM VALIDATION MOBILE
   ============================================ */

@media (max-width: 768px) {
    .form-control:invalid:not(:placeholder-shown),
    .form-control:invalid:focus:not(:placeholder-shown) {
        border-color: #dc3545;
    }
    
    .form-control:valid:not(:placeholder-shown) {
        border-color: #28a745;
    }
    
    .form-text {
        font-size: 0.85rem;
        margin-top: 0.5rem;
    }
}

/* ============================================
   UTILITY CLASSES MOBILE
   ============================================ */

@media (max-width: 768px) {
    .mb-5 {
        margin-bottom: 2.5rem !important;
    }
    
    .mt-5 {
        margin-top: 2.5rem !important;
    }
    
    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
}

/* ============================================
   FOOTER MOBILE
   ============================================ */

@media (max-width: 768px) {
    footer {
        padding: 1.5rem 0 !important;
        font-size: 0.9rem;
        text-align: center;
    }
}

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

@media (max-width: 768px) {
    /* Better focus indicators for touch devices */
    *:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    /* Remove focus outline on tap for buttons */
    .btn:active:focus,
    .btn:focus:not(:focus-visible) {
        outline: none;
    }
    
    /* Ensure sufficient color contrast */
    .text-muted {
        color: #495057 !important;
    }
}

