/* ================================================================
   PROFESSIONAL MOBILE DESIGN v2.0
   Modern, Premium, Touch-Optimized UI
   Color Scheme: Dark with Accent Colors
   ================================================================ */

/* ================================================================
   RESET & GLOBAL STYLES
   ================================================================ */
@media (max-width: 1024px) {
    * {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    html, body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
        background: #0a0e27;
        color: #e0e9f3;
        -webkit-font-smoothing: antialiased;
        -webkit-touch-callout: none;
    }

    input, button, textarea, select {
        font-family: inherit;
        font-size: 16px;
        border-radius: 12px;
    }

    /* ================================================================
       PROFESSIONAL HEADER WITH GRADIENT
       ================================================================ */
    .mobile-app-header {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: linear-gradient(135deg, #0f1435 0%, #1a1e3f 100%);
        z-index: 1001;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        padding-top: max(8px, env(safe-area-inset-top));
        box-sizing: border-box;
        border-bottom: 1px solid rgba(255, 107, 107, 0.15);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .mobile-header-left {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 1;
    }

    .mobile-menu-btn {
        background: none;
        border: none;
        color: #e0e9f3;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border-radius: 10px;
        transition: all 0.3s ease;
        margin-right: 4px;
    }

    .mobile-menu-btn:active {
        background: rgba(255, 107, 107, 0.15);
        transform: scale(0.95);
    }

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

    .mobile-app-title {
        font-size: 20px;
        font-weight: 700;
        color: #ffffff;
        letter-spacing: -0.3px;
        text-shadow: 0 2px 4px rgba(255, 107, 107, 0.2);
    }

    .mobile-app-title span {
        color: #ff6b6b;
        font-weight: 800;
    }

    .mobile-header-right {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Notification Bell */
    .mobile-notif-bell {
        position: relative;
        background: none;
        border: none;
        color: #9ca3af;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border-radius: 10px;
        transition: all 0.3s ease;
    }

    .mobile-notif-bell:active {
        background: rgba(255, 107, 107, 0.15);
        color: #ff6b6b;
        transform: scale(0.95);
    }

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

    .mobile-notif-dot {
        position: absolute;
        top: 6px;
        right: 6px;
        width: 10px;
        height: 10px;
        background: #ff6b6b;
        border-radius: 50%;
        border: 2px solid #0f1435;
        box-shadow: 0 0 8px rgba(255, 107, 107, 0.6);
        animation: pulse 2s infinite;
    }

    @keyframes pulse {
        0%, 100% { transform: scale(1); opacity: 1; }
        50% { transform: scale(1.1); opacity: 0.8; }
    }

    /* Profile Avatar */
    .mobile-header-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid rgba(255, 107, 107, 0.3);
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .mobile-header-avatar:active {
        border-color: #ff6b6b;
        transform: scale(0.95);
        box-shadow: 0 0 12px rgba(255, 107, 107, 0.4);
    }

    /* ================================================================
       MAIN CONTENT AREA - FULLSCREEN WITH SAFE AREAS
       ================================================================ */
    .main-container,
    .main {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 68px !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }

    body.mobile-chat-open .main-container {
        top: 0 !important;
        bottom: 0 !important;
    }

    /* ================================================================
       BOTTOM NAVIGATION - PROFESSIONAL TAB BAR
       ================================================================ */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 68px;
        background: linear-gradient(180deg, #0f1435 0%, #1a1e3f 100%);
        border-top: 1px solid rgba(255, 107, 107, 0.15);
        z-index: 1001;
        display: flex;
        justify-content: space-around;
        align-items: flex-start;
        padding: 8px 0;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        box-sizing: border-box;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 50px;
        cursor: pointer;
        transition: all 0.3s ease;
        background: none;
        border: none;
        color: #6b7280;
        padding: 0;
        position: relative;
        border-radius: 12px;
        margin: 0 4px;
    }

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

    .mobile-nav-item svg {
        width: 24px;
        height: 24px;
        stroke-width: 2;
        margin-bottom: 4px;
        transition: all 0.3s ease;
    }

    .mobile-nav-item span {
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.3px;
        transition: all 0.3s ease;
    }

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

    .mobile-nav-item.active svg {
        filter: drop-shadow(0 0 6px rgba(255, 107, 107, 0.4));
    }

    .mobile-nav-item.active span {
        font-weight: 700;
    }

    .mobile-nav-indicator {
        position: absolute;
        bottom: -8px;
        width: 4px;
        height: 4px;
        background: #ff6b6b;
        border-radius: 50%;
        opacity: 0;
        transition: all 0.3s ease;
    }

    .mobile-nav-item.active .mobile-nav-indicator {
        opacity: 1;
    }

    /* ================================================================
       SIDEBAR & DRAWER - PROFESSIONAL PULLOUT
       ================================================================ */
    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100%;
        background: linear-gradient(180deg, #0a0e27 0%, #1a1e3f 100%);
        z-index: 999;
        transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        padding-top: max(20px, env(safe-area-inset-top));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-sidebar.open {
        left: 0;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .mobile-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-sidebar.open + .mobile-sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-sidebar-header {
        padding: 16px;
        border-bottom: 1px solid rgba(255, 107, 107, 0.15);
        margin-bottom: 8px;
    }

    .mobile-sidebar-user {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-sidebar-avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid rgba(255, 107, 107, 0.3);
    }

    .mobile-sidebar-info h3 {
        font-size: 14px;
        font-weight: 700;
        color: #fff;
        margin: 0;
    }

    .mobile-sidebar-info p {
        font-size: 12px;
        color: #6b7280;
        margin: 2px 0 0 0;
    }

    .mobile-sidebar-menu {
        padding: 8px 0;
    }

    .mobile-sidebar-item {
        padding: 12px 16px;
        color: #9ca3af;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 12px;
        transition: all 0.3s ease;
        border-left: 3px solid transparent;
        font-size: 14px;
        font-weight: 500;
    }

    .mobile-sidebar-item svg {
        width: 20px;
        height: 20px;
        stroke-width: 2;
    }

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

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

    /* ================================================================
       CARDS & CONTENT CONTAINERS
       ================================================================ */
    .mobile-card {
        background: linear-gradient(135deg, #16192f 0%, #1a1e3f 100%);
        border: 1px solid rgba(255, 107, 107, 0.1);
        border-radius: 12px;
        padding: 16px;
        margin: 12px 12px;
        transition: all 0.3s ease;
    }

    .mobile-card:active {
        transform: translateY(-2px);
        border-color: rgba(255, 107, 107, 0.3);
        box-shadow: 0 8px 20px rgba(255, 107, 107, 0.15);
    }

    .mobile-card-title {
        font-size: 15px;
        font-weight: 700;
        color: #fff;
        margin-bottom: 8px;
    }

    .mobile-card-subtitle {
        font-size: 13px;
        color: #6b7280;
    }

    /* ================================================================
       BUTTONS - PROFESSIONAL & ACCESSIBLE
       ================================================================ */
    .mobile-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 20px;
        border: none;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        min-height: 44px;
        -webkit-user-select: none;
        user-select: none;
        outline: none;
    }

    .mobile-btn-primary {
        background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    }

    .mobile-btn-primary:active {
        transform: scale(0.98);
        box-shadow: 0 2px 6px rgba(255, 107, 107, 0.2);
    }

    .mobile-btn-secondary {
        background: rgba(255, 107, 107, 0.1);
        color: #ff6b6b;
        border: 1px solid rgba(255, 107, 107, 0.3);
    }

    .mobile-btn-secondary:active {
        background: rgba(255, 107, 107, 0.2);
        transform: scale(0.98);
    }

    .mobile-btn-ghost {
        background: none;
        color: #9ca3af;
        border: none;
    }

    .mobile-btn-ghost:active {
        color: #ff6b6b;
        background: rgba(255, 107, 107, 0.05);
    }

    /* ================================================================
       INPUT FIELDS - MODERN DESIGN
       ================================================================ */
    .mobile-input,
    .mobile-textarea {
        width: 100%;
        padding: 12px 14px;
        background: rgba(255, 107, 107, 0.05);
        border: 1px solid rgba(255, 107, 107, 0.2);
        border-radius: 10px;
        color: #e0e9f3;
        font-size: 16px;
        transition: all 0.3s ease;
        box-sizing: border-box;
        -webkit-appearance: none;
    }

    .mobile-input::placeholder,
    .mobile-textarea::placeholder {
        color: #6b7280;
    }

    .mobile-input:focus,
    .mobile-textarea:focus {
        outline: none;
        background: rgba(255, 107, 107, 0.08);
        border-color: rgba(255, 107, 107, 0.4);
        box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
    }

    .mobile-textarea {
        resize: vertical;
        min-height: 100px;
        font-family: inherit;
    }

    /* ================================================================
       MESSAGING & CHAT BUBBLES
       ================================================================ */
    .mobile-message-container {
        padding: 8px 12px;
        margin: 4px 0;
    }

    .mobile-message-group {
        display: flex;
        flex-direction: column;
        margin-bottom: 12px;
    }

    .mobile-message-own {
        align-items: flex-end;
    }

    .mobile-message-other {
        align-items: flex-start;
    }

    .mobile-message-bubble {
        max-width: 85%;
        padding: 10px 14px;
        border-radius: 14px;
        word-wrap: break-word;
        font-size: 14px;
        line-height: 1.4;
        animation: slideIn 0.3s ease;
    }

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

    .mobile-message-own .mobile-message-bubble {
        background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
        color: white;
        border-bottom-right-radius: 4px;
    }

    .mobile-message-other .mobile-message-bubble {
        background: rgba(255, 107, 107, 0.15);
        color: #e0e9f3;
        border-bottom-left-radius: 4px;
    }

    .mobile-message-time {
        font-size: 11px;
        color: #6b7280;
        margin-top: 4px;
        margin-left: 4px;
        margin-right: 4px;
    }

    /* ================================================================
       LISTS & ITEMS
       ================================================================ */
    .mobile-list {
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .mobile-list-item {
        padding: 12px 16px;
        border-bottom: 1px solid rgba(255, 107, 107, 0.08);
        display: flex;
        align-items: center;
        justify-content: space-between;
        transition: all 0.3s ease;
    }

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

    .mobile-list-item:active {
        background: rgba(255, 107, 107, 0.08);
    }

    .mobile-list-item-content {
        flex: 1;
    }

    .mobile-list-item-title {
        font-size: 14px;
        font-weight: 600;
        color: #e0e9f3;
        margin-bottom: 2px;
    }

    .mobile-list-item-subtitle {
        font-size: 12px;
        color: #6b7280;
    }

    /* ================================================================
       STATUS BADGES & INDICATORS
       ================================================================ */
    .mobile-status-badge {
        display: inline-block;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        border: 2px solid #0a0e27;
    }

    .mobile-status-online {
        background: #22c55e;
        box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
    }

    .mobile-status-offline {
        background: #6b7280;
    }

    .mobile-status-away {
        background: #f59e0b;
    }

    /* ================================================================
       RESPONSIVE PADDING & SPACING
       ================================================================ */
    .mobile-page-content {
        padding: 16px;
        max-width: 100%;
    }

    .mobile-section {
        margin-bottom: 24px;
    }

    .mobile-section-title {
        font-size: 13px;
        font-weight: 700;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding: 12px 16px 8px;
        margin: 0;
    }

    /* ================================================================
       MODALS & OVERLAYS
       ================================================================ */
    .mobile-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 2000;
        display: none;
        align-items: flex-end;
    }

    .mobile-modal-overlay.active {
        display: flex;
    }

    .mobile-modal {
        width: 100%;
        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: 90vh;
        overflow-y: auto;
        animation: slideUp 0.3s ease;
    }

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

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

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

    /* ================================================================
       LOADING & EMPTY STATES
       ================================================================ */
    .mobile-empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 48px 16px;
        text-align: center;
    }

    .mobile-empty-icon {
        font-size: 48px;
        margin-bottom: 16px;
        opacity: 0.5;
    }

    .mobile-empty-title {
        font-size: 16px;
        font-weight: 600;
        color: #e0e9f3;
        margin-bottom: 8px;
    }

    .mobile-empty-text {
        font-size: 13px;
        color: #6b7280;
    }

    /* ================================================================
       UTILITY CLASSES
       ================================================================ */
    .mobile-hidden {
        display: none !important;
    }

    .mobile-visible-only {
        display: none !important;
    }

    @media (max-width: 768px) {
        .mobile-visible-only {
            display: block !important;
        }
    }

    .mobile-safe-area {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* ================================================================
   DESKTOP: HIDE MOBILE ELEMENTS
   ================================================================ */
@media (min-width: 1025px) {
    .mobile-app-header,
    .mobile-bottom-nav,
    .mobile-sidebar,
    .mobile-sidebar-overlay {
        display: none !important;
    }
}
