/* ========================================
   COMPLETE MOBILE FIXES - ALL FUNCTIONALITY
   ======================================== */

/* ===== MOBILE HEADER FIXES ===== */
@media (max-width: 768px) {
    .user-header {
        height: 60px;
    }
    
    .user-header .navbar {
        padding: 0 1rem;
    }
    
    .user-header .navbar-toggler {
        display: flex !important;
        width: 32px;
        height: 32px;
    }
    
    .user-header .navbar-nav.d-none.d-lg-flex {
        display: none !important;
    }
    
    .user-header .navbar-toggler.d-lg-none {
        display: flex !important;
    }
}

@media (max-width: 576px) {
    .user-header .navbar {
        padding: 0 0.75rem;
    }
    
    .user-header .brand-text {
        font-size: 0.8rem;
    }
    
    .user-header .navbar-toggler {
        width: 28px;
        height: 28px;
    }
}

/* ===== LOGO AND HEADER FIXES ===== */
.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo-section .logo-image {
    order: 1;
}

.logo-section .logo-icon {
    order: 1;
}

.logo-section .logo-text {
    order: 2;
}

.logo-image {
    height: 50px;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
    display: block;
    max-width: 200px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.logo-text h1 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin: 0;
}

/* Ensure logo is always visible when it exists */
.logo-section:has(.logo-image) .logo-icon {
    display: none !important;
}

.logo-section:not(:has(.logo-image)) .logo-icon {
    display: flex !important;
}

@media (max-width: 768px) {
    .logo-text h1 {
        font-size: 1.4rem;
    }
    
    .logo-text p {
        font-size: 0.8rem;
    }
    
    .logo-image {
        height: 40px;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .logo-text h1 {
        font-size: 1.2rem;
    }
    
    .logo-text p {
        font-size: 0.75rem;
    }
    
    .logo-image {
        height: 35px;
    }
    
    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* ===== BUTTON COLOR FIXES ===== */
.btn-primary {
    color: white !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    color: white !important;
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-2px);
}

.btn-primary:disabled {
    color: rgba(255, 255, 255, 0.7) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: none;
}

.btn-outline-light {
    color: white !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    background: transparent !important;
}

.btn-outline-light:hover,
.btn-outline-light:focus,
.btn-outline-light:active {
    color: #333 !important;
    background: white !important;
    border-color: white !important;
}

/* ===== MOBILE SIDEBAR FIXES ===== */
@media (max-width: 768px) {
    .user-sidebar {
        width: 100%;
        max-width: 320px;
        transform: translateX(-100%);
        z-index: 1040;
        transition: transform 0.3s ease;
        position: fixed;
        top: 60px;
        left: 0;
        height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .user-sidebar.show {
        transform: translateX(0);
    }
    
    .user-sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    .sidebar-close {
        display: block !important;
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        color: #6b7280;
        font-size: 1.25rem;
        cursor: pointer;
        padding: 8px;
        border-radius: 6px;
        z-index: 1050;
        transition: all 0.3s ease;
    }
    
    .sidebar-close:hover {
        color: #1f2937;
        background: #e5e7eb;
    }
    
    .sidebar-header {
        padding: 20px;
        position: relative;
        padding-right: 3rem;
    }
    
    .sidebar-nav .nav-link {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    
    .sidebar-user-info {
        padding: 0 20px 20px;
    }
}

/* ===== SEARCH SECTION MOBILE FIXES ===== */
@media (max-width: 768px) {
    .search-section {
        padding: 2rem 1rem !important;
    }
    
    .search-card {
        padding: 1.5rem;
    }
    
    .search-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-actions .btn {
        width: 100%;
        margin: 0 !important;
    }
}

@media (max-width: 576px) {
    .search-section {
        padding: 1.5rem 0.75rem !important;
    }
    
    .search-card {
        padding: 1rem;
    }
    
    .search-header h3 {
        font-size: 1.5rem;
    }
    
    .search-header p {
        font-size: 0.9rem;
    }
}

/* ===== SERVICE AND CATEGORY IMAGE FIXES ===== */
.service-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
}

.service-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.service-image:hover {
    transform: scale(1.05);
}

.service-icon {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 3rem;
}

.category-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

@media (max-width: 768px) {
    .service-image,
    .service-icon {
        height: 160px;
    }
    
    .category-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* ===== LOCATION SERVICES FIXES ===== */
.location-services {
    background: #f8f9fa;
    padding: 3rem 0;
}

.location-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.location-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .location-services {
        padding: 2rem 0;
    }
    
    .location-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .location-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* ===== FORM VALIDATION FIXES ===== */
.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

/* ===== MOBILE MENU TOGGLE FIXES ===== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .header-content {
        justify-content: flex-start;
        gap: 1rem;
    }
    
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .header-nav {
        display: none !important;
    }
    
    /* User Panel Header Mobile Fixes */
    .header-container {
        justify-content: flex-start;
        gap: 1rem;
    }
    
    .header-toggle-sidebar {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 100;
    }
    
    .header-actions {
        position: relative;
    }
}

/* ===== MOBILE NAVIGATION SHOW/HIDE ===== */
.header-nav.show {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem;
    border-radius: 0 0 12px 12px;
    z-index: 1000;
    gap: 1rem;
}

.header-nav.show a {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.header-nav.show a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 768px) {
    .d-md-none {
        display: none !important;
    }
    
    .d-md-block {
        display: block !important;
    }
    
    .text-md-center {
        text-align: center !important;
    }
    
    .mb-md-3 {
        margin-bottom: 1rem !important;
    }
    
    .py-md-4 {
        padding: 2rem 0 !important;
    }
    
    /* User Panel Header Mobile Fixes */
    .header-container {
        justify-content: flex-start;
        gap: 1rem;
    }
    
    .header-toggle-sidebar {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 100;
    }
    
    .header-actions {
        position: relative;
    }
}

@media (max-width: 576px) {
    .header-content {
        padding: 0 0.75rem;
    }
    
    .mobile-menu-toggle {
        right: 0.75rem;
        font-size: 1.3rem;
        padding: 6px;
    }
    
    /* User Panel Header Small Mobile Fixes */
    .header-container {
        padding: 0 0.75rem;
    }
    
    .header-toggle-sidebar {
        right: 0.75rem;
        font-size: 1.3rem;
        padding: 6px;
    }
    
    .d-sm-none {
        display: none !important;
    }
    
    .d-sm-block {
        display: block !important;
    }
    
    .text-sm-center {
        text-align: center !important;
    }
    
    .mb-sm-3 {
        margin-bottom: 1rem !important;
    }
    
    .py-sm-4 {
        padding: 1.5rem 0 !important;
    }
}

/* ===== ANIMATION FIXES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== LOADING STATE FIXES ===== */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* ===== SCROLLBAR FIXES ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== PRINT FIXES ===== */
@media print {
    .mobile-menu-toggle,
    .search-section,
    .mobile-fixes {
        display: none !important;
    }
}

/* ===== ADDITIONAL BUTTON FIXES ===== */
.btn-outline-secondary {
    color: #6c757d !important;
    border-color: #6c757d !important;
    background: transparent !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    color: white !important;
    background: #6c757d !important;
    border-color: #6c757d !important;
}

.service-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 25px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.service-btn:hover,
.service-btn:focus,
.service-btn:active {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
}

.vendor-btn {
    background: transparent !important;
    color: #6c757d !important;
    border: 2px solid #6c757d !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 25px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.vendor-btn:hover,
.vendor-btn:focus,
.vendor-btn:active {
    background: #6c757d !important;
    color: white !important;
    transform: translateY(-2px) !important;
}

/* ===== HEADER LAYOUT FIXES ===== */
.header-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 1rem;
}

/* User Panel Header Layout Fixes */
.header-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 1rem;
}

.header-toggle-sidebar {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.header-toggle-sidebar:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ===== HEADER SCROLL EFFECTS ===== */
.clean-header {
    transition: all 0.3s ease;
}

.clean-header.scrolled {
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ===== CATEGORY SCROLLING FIXES ===== */
.categories-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.categories-container {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
}

.category-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    min-width: 100px;
    border: 2px solid transparent;
}

.category-pill:hover,
.category-pill.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.5);
}

.category-pill.active .category-icon {
    background: rgba(255, 255, 255, 0.3);
}

.category-name {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.active-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* ===== RESPONSIVE CATEGORY FIXES ===== */
@media (max-width: 768px) {
    .categories-container {
        gap: 0.75rem;
    }
    
    .category-pill {
        min-width: 80px;
        padding: 0.75rem;
    }
    
    .category-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .categories-container {
        gap: 0.5rem;
    }
    
    .category-pill {
        min-width: 70px;
        padding: 0.5rem;
    }
    
    .category-name {
        font-size: 0.75rem;
    }
}
