/* ================================================================
   MOBILE COMPONENTS & ANIMATIONS
   Professional UI Components for Mobile Apps
   ================================================================ */

@media (max-width: 1024px) {
    /* ================================================================
       TOASTS & NOTIFICATIONS
       ================================================================ */
    .mobile-toast {
        position: fixed;
        bottom: 24px;
        left: 12px;
        right: 12px;
        background: linear-gradient(135deg, #16192f 0%, #1a1e3f 100%);
        border: 1px solid rgba(255, 107, 107, 0.2);
        border-radius: 12px;
        padding: 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        z-index: 2001;
        animation: slideInUp 0.3s ease;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        max-width: 380px;
        margin: 0 auto;
    }

    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(100px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .mobile-toast.success {
        border-color: rgba(34, 197, 94, 0.3);
    }

    .mobile-toast.error {
        border-color: rgba(255, 107, 107, 0.3);
    }

    .mobile-toast.warning {
        border-color: rgba(245, 158, 11, 0.3);
    }

    .mobile-toast-icon {
        font-size: 20px;
        flex-shrink: 0;
    }

    .mobile-toast-content {
        flex: 1;
    }

    .mobile-toast-title {
        font-size: 14px;
        font-weight: 600;
        color: #e0e9f3;
        margin: 0;
    }

    .mobile-toast-message {
        font-size: 12px;
        color: #9ca3af;
        margin: 4px 0 0 0;
    }

    .mobile-toast-close {
        background: none;
        border: none;
        color: #6b7280;
        cursor: pointer;
        padding: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.2s ease;
    }

    .mobile-toast-close:active {
        color: #e0e9f3;
    }

    /* ================================================================
       FLOATING ACTION BUTTONS
       ================================================================ */
    .mobile-fab {
        position: fixed;
        bottom: 90px;
        right: 16px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
        border: none;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
        transition: all 0.3s ease;
        z-index: 100;
        -webkit-appearance: none;
        appearance: none;
    }

    .mobile-fab:active {
        transform: scale(0.9);
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    }

    .mobile-fab svg {
        width: 24px;
        height: 24px;
        stroke-width: 2;
    }

    /* ================================================================
       DROPDOWNS & MENUS
       ================================================================ */
    .mobile-dropdown {
        position: relative;
    }

    .mobile-dropdown-menu {
        position: absolute;
        top: 100%;
        right: 0;
        background: linear-gradient(135deg, #16192f 0%, #1a1e3f 100%);
        border: 1px solid rgba(255, 107, 107, 0.15);
        border-radius: 12px;
        min-width: 200px;
        list-style: none;
        margin: 8px 0 0 0;
        padding: 8px 0;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
        animation: slideInDown 0.3s ease;
        z-index: 1000;
    }

    @keyframes slideInDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .mobile-dropdown-item {
        padding: 12px 16px;
        color: #9ca3af;
        cursor: pointer;
        transition: all 0.2s ease;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        font-size: 14px;
        border-left: 3px solid transparent;
    }

    .mobile-dropdown-item:active {
        background: rgba(255, 107, 107, 0.1);
        color: #ff6b6b;
        border-left-color: #ff6b6b;
    }

    .mobile-dropdown-divider {
        height: 1px;
        background: rgba(255, 107, 107, 0.1);
        margin: 4px 0;
    }

    /* ================================================================
       BADGES & LABELS
       ================================================================ */
    .mobile-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 10px;
        background: rgba(255, 107, 107, 0.15);
        color: #ff6b6b;
        border-radius: 20px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.3px;
        text-transform: uppercase;
    }

    .mobile-badge.success {
        background: rgba(34, 197, 94, 0.15);
        color: #22c55e;
    }

    .mobile-badge.warning {
        background: rgba(245, 158, 11, 0.15);
        color: #f59e0b;
    }

    .mobile-badge.info {
        background: rgba(59, 130, 246, 0.15);
        color: #3b82f6;
    }

    /* ================================================================
       SKELETON LOADING SCREENS
       ================================================================ */
    .mobile-skeleton {
        background: linear-gradient(
            90deg,
            rgba(255, 107, 107, 0.05) 25%,
            rgba(255, 107, 107, 0.1) 50%,
            rgba(255, 107, 107, 0.05) 75%
        );
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
        border-radius: 8px;
    }

    @keyframes loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }

    .mobile-skeleton-text {
        height: 12px;
        margin-bottom: 8px;
    }

    .mobile-skeleton-avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
    }

    .mobile-skeleton-card {
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 12px;
    }

    /* ================================================================
       PROFILE CARDS
       ================================================================ */
    .mobile-profile-card {
        background: linear-gradient(135deg, #16192f 0%, #1a1e3f 100%);
        border: 1px solid rgba(255, 107, 107, 0.1);
        border-radius: 16px;
        padding: 20px;
        text-align: center;
        margin-bottom: 16px;
    }

    .mobile-profile-avatar {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        object-fit: cover;
        margin: 0 auto 16px;
        border: 3px solid rgba(255, 107, 107, 0.3);
    }

    .mobile-profile-name {
        font-size: 18px;
        font-weight: 700;
        color: #fff;
        margin: 0 0 4px;
    }

    .mobile-profile-status {
        font-size: 12px;
        color: #6b7280;
        margin: 0 0 12px;
    }

    .mobile-profile-stats {
        display: flex;
        justify-content: space-around;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid rgba(255, 107, 107, 0.1);
    }

    .mobile-profile-stat {
        flex: 1;
    }

    .mobile-profile-stat-value {
        font-size: 18px;
        font-weight: 700;
        color: #ff6b6b;
        display: block;
    }

    .mobile-profile-stat-label {
        font-size: 11px;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        margin-top: 4px;
    }

    /* ================================================================
       SWIPE ACTIONS
       ================================================================ */
    .mobile-swipe-wrapper {
        position: relative;
        overflow: hidden;
        border-radius: 12px;
    }

    .mobile-swipe-actions {
        position: absolute;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        background: linear-gradient(90deg, rgba(255, 107, 107, 0.1), rgba(255, 107, 107, 0.2));
        transition: right 0.3s ease;
        gap: 8px;
        padding-right: 8px;
    }

    .mobile-swipe-wrapper.swiped .mobile-swipe-actions {
        right: 0;
    }

    .mobile-swipe-action-btn {
        width: 44px;
        height: 44px;
        border-radius: 8px;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-swipe-action-btn.delete {
        background: rgba(255, 107, 107, 0.2);
        color: #ff6b6b;
    }

    .mobile-swipe-action-btn.delete:active {
        background: rgba(255, 107, 107, 0.3);
    }

    /* ================================================================
       BOTTOM SHEET MODALS
       ================================================================ */
    .mobile-bottom-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(180deg, #0f1435 0%, #1a1e3f 100%);
        border-radius: 20px 20px 0 0;
        padding: 20px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        animation: slideUp 0.3s ease;
        z-index: 2000;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    .mobile-bottom-sheet-handle {
        width: 36px;
        height: 4px;
        background: rgba(255, 107, 107, 0.3);
        border-radius: 2px;
        margin: 0 auto 16px;
    }

    .mobile-bottom-sheet-title {
        font-size: 18px;
        font-weight: 700;
        color: #fff;
        margin-bottom: 16px;
    }

    /* ================================================================
       TABS & SEGMENTED CONTROL
       ================================================================ */
    .mobile-tabs {
        display: flex;
        gap: 0;
        border-bottom: 1px solid rgba(255, 107, 107, 0.1);
        margin-bottom: 16px;
        position: sticky;
        top: 0;
        background: rgba(10, 14, 39, 0.8);
        backdrop-filter: blur(10px);
        z-index: 10;
    }

    .mobile-tab {
        flex: 1;
        padding: 12px;
        background: none;
        border: none;
        color: #6b7280;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        position: relative;
        transition: color 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .mobile-tab:active,
    .mobile-tab.active {
        color: #ff6b6b;
    }

    .mobile-tab.active::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, #ff6b6b, #ff5252);
    }

    /* ================================================================
       DIVIDERS & SEPARATORS
       ================================================================ */
    .mobile-divider {
        height: 1px;
        background: rgba(255, 107, 107, 0.1);
        margin: 12px 0;
    }

    .mobile-divider-text {
        text-align: center;
        color: #6b7280;
        font-size: 12px;
        margin: 16px 0;
        position: relative;
    }

    .mobile-divider-text::before,
    .mobile-divider-text::after {
        content: '';
        position: absolute;
        top: 50%;
        width: 25%;
        height: 1px;
        background: rgba(255, 107, 107, 0.1);
    }

    .mobile-divider-text::before {
        left: 0;
    }

    .mobile-divider-text::after {
        right: 0;
    }

    /* ================================================================
       ANIMATIONS & TRANSITIONS
       ================================================================ */
    .mobile-fade-in {
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .mobile-scale-in {
        animation: scaleIn 0.3s ease;
    }

    @keyframes scaleIn {
        from {
            opacity: 0;
            transform: scale(0.95);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    .mobile-bounce {
        animation: bounce 0.4s ease;
    }

    @keyframes bounce {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-8px); }
    }

    /* ================================================================
       ACCESSIBILITY IMPROVEMENTS
       ================================================================ */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation: none !important;
            transition: none !important;
        }
    }

    /* Focus for keyboard navigation */
    button:focus-visible,
    a:focus-visible,
    input:focus-visible,
    textarea:focus-visible {
        outline: 2px solid #ff6b6b;
        outline-offset: 2px;
    }

    /* High contrast mode */
    @media (prefers-contrast: more) {
        .mobile-card {
            border-color: rgba(255, 107, 107, 0.3);
        }

        .mobile-btn-primary {
            border: 2px solid #ff5252;
        }
    }

    /* Color inversion for light mode users */
    @media (prefers-color-scheme: light) {
        body {
            background: #f5f5f7;
            color: #1a1a1a;
        }

        .mobile-card {
            background: #ffffff;
            border-color: rgba(0, 0, 0, 0.1);
        }

        input[type="text"],
        input[type="email"],
        input[type="password"],
        textarea {
            background: #f5f5f7;
            color: #1a1a1a;
            border-color: rgba(0, 0, 0, 0.1);
        }
    }
}
