/* ========================================
   PETOTELBUL - MOBILE UX ENHANCEMENTS
   ======================================== */

/* ===== MOBILE-FIRST RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    /* Touch-friendly button sizes */
    .btn-mobile {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
        font-size: 16px;
        border-radius: 12px;
    }

    /* Mobile navigation improvements */
    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        z-index: 1000;
        padding: 8px 0;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 8px 12px;
        text-decoration: none;
        color: #6b7280;
        transition: all 0.3s ease;
        min-height: 60px;
        justify-content: center;
    }

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

    .mobile-nav-item i {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .mobile-nav-item span {
        font-size: 12px;
        font-weight: 500;
    }

    /* Mobile card improvements */
    .mobile-card {
        margin: 8px;
        border-radius: 16px;
        padding: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    /* Mobile form improvements */
    .mobile-form {
        padding: 16px;
    }

    .mobile-input {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        border-radius: 12px;
        border: 2px solid #e5e7eb;
        margin-bottom: 16px;
        transition: all 0.3s ease;
    }

    .mobile-input:focus {
        border-color: #ff6b35;
        box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
        outline: none;
    }

    .mobile-textarea {
        min-height: 120px;
        resize: vertical;
    }

    /* Mobile button improvements */
    .mobile-btn {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        font-weight: 600;
        border-radius: 12px;
        border: none;
        margin-bottom: 12px;
        transition: all 0.3s ease;
    }

    .mobile-btn-primary {
        background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
        color: white;
    }

    .mobile-btn-primary:active {
        transform: scale(0.98);
    }

    /* Mobile modal improvements */
    .mobile-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 2000;
        display: flex;
        align-items: flex-end;
        justify-content: center;
    }

    .mobile-modal-content {
        background: white;
        border-radius: 20px 20px 0 0;
        width: 100%;
        max-height: 80vh;
        overflow-y: auto;
        padding: 20px;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .mobile-modal.show .mobile-modal-content {
        transform: translateY(0);
    }

    /* Mobile list improvements */
    .mobile-list {
        background: white;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-list-item {
        padding: 16px;
        border-bottom: 1px solid #f3f4f6;
        display: flex;
        align-items: center;
        gap: 12px;
        transition: background-color 0.2s ease;
    }

    .mobile-list-item:active {
        background-color: #f9fafb;
    }

    .mobile-list-item:last-child {
        border-bottom: none;
    }

    /* Mobile search improvements */
    .mobile-search {
        position: sticky;
        top: 0;
        background: white;
        padding: 16px;
        border-bottom: 1px solid #e5e7eb;
        z-index: 100;
    }

    .mobile-search-input {
        width: 100%;
        padding: 12px 16px;
        font-size: 16px;
        border: 2px solid #e5e7eb;
        border-radius: 25px;
        background: #f9fafb;
        transition: all 0.3s ease;
    }

    .mobile-search-input:focus {
        border-color: #ff6b35;
        background: white;
        box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
        outline: none;
    }

    /* Mobile grid improvements */
    .mobile-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }

    .mobile-grid-2 {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    /* Mobile spacing */
    .mobile-padding {
        padding: 16px;
    }

    .mobile-margin {
        margin: 16px;
    }

    /* Mobile text improvements */
    .mobile-text-lg {
        font-size: 18px;
        line-height: 1.6;
    }

    .mobile-text-xl {
        font-size: 20px;
        line-height: 1.5;
    }

    .mobile-text-2xl {
        font-size: 24px;
        line-height: 1.4;
    }

    /* Mobile header improvements */
    .mobile-header {
        position: sticky;
        top: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        z-index: 100;
        padding: 16px;
    }

    .mobile-header-title {
        font-size: 20px;
        font-weight: 700;
        color: #1f2937;
        text-align: center;
    }

    /* Mobile footer improvements */
    .mobile-footer {
        padding: 20px 16px;
        background: #f9fafb;
        border-top: 1px solid #e5e7eb;
    }

    /* Mobile loading improvements */
    .mobile-loading {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
    }

    .mobile-loading-spinner {
        width: 40px;
        height: 40px;
        border: 4px solid #f3f4f6;
        border-top: 4px solid #ff6b35;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin-bottom: 16px;
    }

    /* Mobile error states */
    .mobile-error {
        background: #fef2f2;
        border: 1px solid #fecaca;
        color: #dc2626;
        padding: 16px;
        border-radius: 12px;
        margin: 16px;
        text-align: center;
    }

    .mobile-success {
        background: #f0fdf4;
        border: 1px solid #bbf7d0;
        color: #16a34a;
        padding: 16px;
        border-radius: 12px;
        margin: 16px;
        text-align: center;
    }

    /* Mobile swipe gestures */
    .swipeable {
        touch-action: pan-x;
        user-select: none;
    }

    .swipe-indicator {
        position: absolute;
        top: 50%;
        right: 16px;
        transform: translateY(-50%);
        color: #9ca3af;
        font-size: 20px;
        opacity: 0.5;
    }

    /* Mobile pull-to-refresh */
    .pull-to-refresh {
        position: relative;
        overflow: hidden;
    }

    .pull-to-refresh-indicator {
        position: absolute;
        top: -60px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        gap: 8px;
        color: #6b7280;
        font-size: 14px;
        transition: top 0.3s ease;
    }

    .pull-to-refresh-indicator.active {
        top: 20px;
    }

    /* Mobile tab bar */
    .mobile-tab-bar {
        display: flex;
        background: white;
        border-top: 1px solid #e5e7eb;
        padding: 8px 0;
    }

    .mobile-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 8px;
        text-decoration: none;
        color: #6b7280;
        transition: color 0.3s ease;
    }

    .mobile-tab.active {
        color: #ff6b35;
    }

    .mobile-tab i {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .mobile-tab span {
        font-size: 12px;
        font-weight: 500;
    }

    /* Mobile floating action button */
    .mobile-fab {
        position: fixed;
        bottom: 80px;
        right: 20px;
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 24px;
        box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
        z-index: 1000;
        transition: all 0.3s ease;
    }

    .mobile-fab:active {
        transform: scale(0.95);
    }

    /* Mobile drawer */
    .mobile-drawer {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        background: white;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-drawer.show {
        transform: translateX(0);
    }

    .mobile-drawer-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-drawer-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* Mobile keyboard handling */
    .keyboard-adjust {
        transition: padding-bottom 0.3s ease;
    }

    .keyboard-adjust.keyboard-open {
        padding-bottom: 300px;
    }

    /* Mobile safe area handling */
    .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);
    }
}

/* ===== TABLET OPTIMIZATIONS ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .tablet-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 20px;
    }

    .tablet-card {
        padding: 20px;
        border-radius: 16px;
    }

    .tablet-button {
        padding: 14px 20px;
        font-size: 16px;
    }
}

/* ===== LARGE MOBILE OPTIMIZATIONS ===== */
@media (min-width: 481px) and (max-width: 768px) {
    .large-mobile-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 16px;
    }

    .large-mobile-card {
        padding: 16px;
        border-radius: 14px;
    }
}

/* ===== TOUCH INTERACTIONS ===== */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.touch-feedback {
    transition: all 0.1s ease;
}

.touch-feedback:active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* ===== MOBILE ANIMATIONS ===== */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.mobile-slide-up {
    animation: slideUp 0.3s ease forwards;
}

.mobile-slide-down {
    animation: slideDown 0.3s ease forwards;
}

.mobile-fade-in-scale {
    animation: fadeInScale 0.3s ease forwards;
}

/* ===== MOBILE UTILITIES ===== */
.mobile-only {
    display: block;
}

.desktop-only {
    display: none;
}

@media (min-width: 769px) {
    .mobile-only {
        display: none;
    }
    
    .desktop-only {
        display: block;
    }
}

/* ===== MOBILE PERFORMANCE ===== */
.mobile-optimized {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===== MOBILE ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .mobile-animation {
        animation: none;
        transition: none;
    }
}

/* ===== MOBILE DARK MODE ===== */
@media (prefers-color-scheme: dark) {
    .mobile-card {
        background: #1f2937;
        color: white;
    }
    
    .mobile-input {
        background: #374151;
        border-color: #4b5563;
        color: white;
    }
    
    .mobile-input:focus {
        border-color: #ff6b35;
        background: #4b5563;
    }
    
    .mobile-nav {
        background: rgba(31, 41, 55, 0.95);
        border-top-color: rgba(75, 85, 99, 0.3);
    }
    
    .mobile-nav-item {
        color: #d1d5db;
    }
    
    .mobile-nav-item.active {
        color: #ff6b35;
    }
}
