/* Mobile-first optimizations en touch-friendly design */

/* Bottom Navigation Bar voor mobiel */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e9ecef;
    padding: 8px 0 env(safe-area-inset-bottom, 8px) 0;
    z-index: 1040;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6c757d;
    padding: 6px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    min-width: 50px;
    font-size: 0.7rem;
    font-weight: 500;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: #e83e8c;
    background: rgba(232, 62, 140, 0.1);
    text-decoration: none;
}

.bottom-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.bottom-nav-item .badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Enhanced touch targets */
.btn-touch,
.touch-friendly {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-touch:active {
    transform: scale(0.95);
    background-color: rgba(0, 0, 0, 0.1);
}

/* Card optimizations voor mobiel */
.card-mobile {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 16px;
}

.card-mobile:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Form optimizations */
.form-control-mobile {
    min-height: 48px;
    font-size: 16px; /* Prevent zoom on iOS */
    border-radius: 8px;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    transition: border-color 0.2s ease;
}

.form-control-mobile:focus {
    border-color: #e83e8c;
    box-shadow: 0 0 0 0.2rem rgba(232, 62, 140, 0.25);
}

/* Textarea optimizations */
.form-control-mobile.textarea-mobile {
    min-height: 100px;
    resize: vertical;
}

/* Select optimizations */
.form-select-mobile {
    min-height: 48px;
    font-size: 16px;
    padding: 12px 16px;
    background-size: 16px 12px;
    background-position: right 12px center;
}

/* Checkbox en radio optimizations */
.form-check-mobile {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.form-check-mobile .form-check-input {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.form-check-mobile .form-check-label {
    font-size: 16px;
    line-height: 1.4;
    cursor: pointer;
    flex: 1;
}

/* Input group optimizations */
.input-group-mobile {
    border-radius: 8px;
    overflow: hidden;
}

.input-group-mobile .form-control {
    border: none;
    font-size: 16px;
    min-height: 48px;
}

.input-group-mobile .btn {
    min-height: 48px;
    border: none;
    font-weight: 600;
}

/* Modal optimizations voor mobiel */
@media (max-width: 768px) {
    .modal-dialog-mobile {
        margin: 0;
        max-width: 100%;
        height: 100vh;
        display: flex;
        align-items: flex-end;
    }
    
    .modal-content-mobile {
        border-radius: 16px 16px 0 0;
        border: none;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .modal-header-mobile {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-bottom: 1px solid #e9ecef;
        padding: 16px 20px 12px;
    }
    
    .modal-body-mobile {
        padding: 20px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
}

/* Loading states voor mobiel */
.skeleton-mobile {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

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

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

.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: 12px;
}

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

/* Pull-to-refresh indicator */
.pull-to-refresh {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: top 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
}

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

.pull-to-refresh i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Swipe gestures feedback */
.swipe-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.swipe-indicator.left {
    left: 20px;
}

.swipe-indicator.right {
    right: 20px;
}

.swipe-indicator.active {
    opacity: 1;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 80px; /* Above bottom nav */
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e83e8c;
    color: white;
    border: none;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(232, 62, 140, 0.4);
    z-index: 1030;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    background: #d63384;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(232, 62, 140, 0.5);
}

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

/* Optimized search bar voor mobiel */
.search-bar-mobile {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: white;
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-input-mobile {
    background: #f8f9fa;
    border: none;
    border-radius: 20px;
    padding: 12px 20px 12px 44px;
    font-size: 16px;
    position: relative;
}

.search-input-mobile::placeholder {
    color: #adb5bd;
}

.search-icon-mobile {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 10;
}

/* Badge optimizations */
.badge-mobile {
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Toast notifications voor mobiel */
.toast-mobile {
    position: fixed;
    bottom: 100px; /* Above bottom nav */
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    max-width: 90vw;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

/* Media queries voor progressive enhancement */
@media (max-width: 768px) {
    /* Show bottom navigation */
    .bottom-nav {
        display: block;
    }
    
    /* Add bottom padding to main content */
    body {
        padding-bottom: 70px;
    }
    
    /* Hide desktop navigation elements */
    .navbar-nav .nav-link {
        padding: 12px 16px;
    }
    
    /* Optimize card layout */
    .card {
        margin-bottom: 12px;
        border-radius: 12px;
    }
    
    /* Optimize buttons */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-weight: 600;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 8px 16px;
    }
    
    .btn-lg {
        min-height: 52px;
        padding: 16px 24px;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    /* Smaller margins en padding */
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Optimize typography */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    /* Smaller form elements */
    .form-control-mobile {
        min-height: 44px;
        padding: 10px 14px;
    }
    
    /* Optimize modal */
    .modal-dialog-mobile {
        height: 100vh;
    }
    
    .modal-content-mobile {
        height: 100%;
        border-radius: 0;
    }
}

/* Safe area handling voor devices met notch */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
    
    .fab {
        bottom: calc(80px + env(safe-area-inset-bottom));
    }
    
    .toast-mobile {
        bottom: calc(100px + env(safe-area-inset-bottom));
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .bottom-nav {
        background: #212529;
        border-top-color: #495057;
    }
    
    .bottom-nav-item {
        color: #adb5bd;
    }
    
    .bottom-nav-item:hover,
    .bottom-nav-item.active {
        color: #e83e8c;
        background: rgba(232, 62, 140, 0.2);
    }
    
    .search-bar-mobile {
        background: #212529;
        border-bottom-color: #495057;
    }
    
    .search-input-mobile {
        background: #495057;
        color: white;
    }
    
    .search-input-mobile::placeholder {
        color: #adb5bd;
    }
}

/* Haptic feedback voor supported devices */
@media (hover: none) and (pointer: coarse) {
    .btn-touch:active,
    .card-mobile:active,
    .bottom-nav-item:active {
        /* Trigger haptic feedback via JavaScript */
        position: relative;
    }
}
