/* 
 * Mobile-Specific Components
 * Enhanced mobile UI elements
 */

/* ===== MOBILE BOTTOM NAVIGATION ===== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6b7280;
    flex: 1;
    padding: 8px 4px;
    min-height: 56px;
}

.mobile-bottom-nav-item.active {
    color: #1a56db;
}

.mobile-bottom-nav-icon {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.mobile-bottom-nav-label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===== MOBILE PULL TO REFRESH ===== */
.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.pull-to-refresh.active {
    transform: translateY(0);
}

.refresh-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #1a56db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== MOBILE SWIPEABLE CARDS ===== */
.swipeable-card-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.swipeable-card {
    position: relative;
    transition: transform 0.3s ease;
    user-select: none;
    touch-action: pan-y;
}

.swipeable-card.swiping {
    transition: none;
}

.swipe-actions {
    position: absolute;
    top: 0;
    right: -80px;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 16px;
    transition: right 0.3s ease;
}

.swipeable-card.swiped .swipe-actions {
    right: 0;
}

.swipe-action-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    margin-left: 8px;
    cursor: pointer;
    font-size: 0.875rem;
}

/* ===== MOBILE NOTIFICATIONS ===== */
.mobile-notification {
    position: fixed;
    top: 80px;
    left: 16px;
    right: 16px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.mobile-notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.mobile-notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-notification-icon.info {
    background: #dbeafe;
    color: #1d4ed8;
}

.mobile-notification-icon.success {
    background: #d1fae5;
    color: #059669;
}

.mobile-notification-icon.warning {
    background: #fef3c7;
    color: #d97706;
}

.mobile-notification-icon.error {
    background: #fee2e2;
    color: #dc2626;
}

/* ===== MOBILE LOADING STATES ===== */
.mobile-loading-shimmer {
    background: linear-gradient(
        90deg,
        #f3f4f6 0%,
        #e5e7eb 50%,
        #f3f4f6 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.mobile-skeleton {
    background: #f3f4f6;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.mobile-skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===== MOBILE GESTURE INDICATORS ===== */
.swipe-hint {
    position: relative;
    padding-right: 40px;
}

.swipe-hint::after {
    content: '→';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.25rem;
    animation: swipe-hint 2s infinite;
}

@keyframes swipe-hint {
    0%, 100% {
        transform: translateY(-50%) translateX(0);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-50%) translateX(-8px);
        opacity: 1;
    }
}

.pull-down-hint {
    position: relative;
    padding-top: 40px;
}

.pull-down-hint::before {
    content: '↓';
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: #9ca3af;
    font-size: 1.25rem;
    animation: pull-down-hint 2s infinite;
}

@keyframes pull-down-hint {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 0.5;
    }
    50% {
        transform: translateX(-50%) translateY(8px);
        opacity: 1;
    }
}

/* ===== MOBILE FORM ENHANCEMENTS ===== */
.mobile-select {
    position: relative;
}

.mobile-select select {
    appearance: none;
    padding-right: 48px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

.mobile-date-input {
    position: relative;
}

.mobile-date-input input[type="date"] {
    position: relative;
    padding-right: 48px;
}

.mobile-date-input::after {
    content: '📅';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ===== MOBILE SEARCH BAR ===== */
.mobile-search-container {
    position: relative;
    margin: 16px 0;
}

.mobile-search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    background: white;
}

.mobile-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.mobile-search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
}

/* ===== MOBILE TAB BAR ===== */
.mobile-tab-bar {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 16px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 60px;
    z-index: 999;
}

.mobile-tab-bar::-webkit-scrollbar {
    display: none;
}

.mobile-tab {
    flex-shrink: 0;
    padding: 12px 20px;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-right: 8px;
}

.mobile-tab.active {
    color: #1a56db;
    border-bottom-color: #1a56db;
}

.mobile-tab-badge {
    display: inline-block;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: top;
}

/* ===== MOBILE DIALOGS ===== */
.mobile-dialog {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-dialog.active {
    transform: translateY(0);
}

.mobile-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-dialog-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
}

.mobile-dialog-content {
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== RESPONSIVE UTILITY CLASSES ===== */
/* Hide/Show utilities */
.hide-on-mobile { display: none !important; }
.show-on-mobile { display: block !important; }

@media (min-width: 768px) {
    .hide-on-mobile { display: block !important; }
    .show-on-mobile { display: none !important; }
}

/* Spacing utilities for mobile */
.mobile-mt-1 { margin-top: 0.5rem !important; }
.mobile-mt-2 { margin-top: 1rem !important; }
.mobile-mt-3 { margin-top: 1.5rem !important; }
.mobile-mt-4 { margin-top: 2rem !important; }

.mobile-mb-1 { margin-bottom: 0.5rem !important; }
.mobile-mb-2 { margin-bottom: 1rem !important; }
.mobile-mb-3 { margin-bottom: 1.5rem !important; }
.mobile-mb-4 { margin-bottom: 2rem !important; }

.mobile-p-1 { padding: 0.5rem !important; }
.mobile-p-2 { padding: 1rem !important; }
.mobile-p-3 { padding: 1.5rem !important; }
.mobile-p-4 { padding: 2rem !important; }

/* Text alignment for mobile */
.text-center-mobile { text-align: center !important; }
.text-left-mobile { text-align: left !important; }
.text-right-mobile { text-align: right !important; }

@media (min-width: 768px) {
    .text-center-mobile,
    .text-left-mobile,
    .text-right-mobile {
        text-align: inherit !important;
    }
}

/* Flex utilities for mobile */
.flex-column-mobile {
    flex-direction: column !important;
}

.flex-wrap-mobile {
    flex-wrap: wrap !important;
}

.justify-center-mobile {
    justify-content: center !important;
}

@media (min-width: 768px) {
    .flex-column-mobile,
    .flex-wrap-mobile,
    .justify-center-mobile {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
    }
}