/* Professional UI Enhancements */
:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --primary-light: #6ea8fe;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
}

/* Enhanced Navigation Styling */
.navbar {
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease-in-out;
    position: relative;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.15);
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

/* Enhanced Button Styling */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-lg);
    transition: all 0.2s ease-in-out;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-lg);
    transition: all 0.2s ease-in-out;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Enhanced Card Styling */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease-in-out;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* Enhanced Form Styling */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Enhanced Footer Styling */
footer {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid var(--border-color);
}

footer h4, footer h6 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

footer a:hover {
    color: var(--primary-color);
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* Enhanced Badge Styling */
.badge {
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-outline-primary {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    background-color: transparent;
}

/* Enhanced Alert Styling */
.alert {
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.alert-primary {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    border-left: 4px solid #198754;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border-left: 4px solid #ffc107;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-left: 4px solid #dc3545;
}

/* Enhanced Table Styling */
.table {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Enhanced Modal Styling */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-title {
    font-weight: 700;
    color: var(--text-primary);
}

/* Enhanced Dropdown Styling */
.dropdown-menu {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-color);
}

/* Enhanced Progress Bar Styling */
.progress {
    height: 0.75rem;
    border-radius: var(--border-radius);
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--primary-color);
    transition: width 0.6s ease;
}

/* Enhanced Pagination Styling */
.pagination .page-link {
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    margin: 0 0.125rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Enhanced Breadcrumb Styling */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    font-weight: 500;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

/* Enhanced List Group Styling */
.list-group-item {
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    transition: all 0.2s ease-in-out;
}

.list-group-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
    border-color: var(--primary-color);
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Enhanced Spinner Styling */
.spinner-border {
    color: var(--primary-color);
}

/* Enhanced Tooltip Styling */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background-color: var(--text-primary);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
}

/* Enhanced Popover Styling */
.popover {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.popover-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    font-weight: 600;
    color: var(--text-primary);
}

/* User Dropdown Styles for Home Layout */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 8px;
}

.user-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.user-email {
    color: #e3f2fd;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.user-dropdown-menu {
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
}

.user-dropdown-menu .business-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #0d6efd;
}

.user-dropdown-menu .business-link i {
    margin-left: auto;
    font-size: 12px;
}

.user-dropdown-menu .logout-item {
    color: #dc3545;
    font-weight: 500;
}

.user-dropdown-menu .logout-item:hover {
    background-color: #f8d7da;
    color: #721c24;
}

/* Responsive adjustments for user dropdown */
@media (max-width: 768px) {
    .user-details {
        display: none;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .user-dropdown-menu {
        min-width: 200px;
    }
}

/* Recommended Section Styles */
#businessCardsContainer::-webkit-scrollbar {
    display: none;
}

.business-card {
    transition: transform 0.2s ease-in-out;
}

.business-card:hover {
    transform: translateY(-5px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .business-card {
        width: 280px !important;
    }
    
    #scrollLeft, #scrollRight {
        display: none !important;
    }
    
    #businessCardsContainer {
        padding: 0 15px;
    }
}

@media (max-width: 576px) {
    .business-card {
        width: 250px !important;
    }
}

/* Card image styling */
.business-card .card img {
    border-radius: 8px 8px 0 0;
}

.business-card .card {
    border-radius: 8px;
    transition: box-shadow 0.2s ease-in-out;
    min-height: 400px; /* Increased height for more content */
}

/* New to Massage Sewa section - cleaner design */
#newBusinessCardsContainer .business-card .card {
    min-height: 320px; /* Shorter height for cleaner look */
}

#newBusinessCardsContainer .business-card .card-body {
    padding: 1rem;
}

.business-card .card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

/* Business card content styling */
.business-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Badge styling for special features */
.business-card .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Website button styling */
.business-card .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Scroll button positioning */
#scrollLeft {
    left: -25px;
}

#scrollRight {
    right: -25px;
}

@media (max-width: 768px) {
    #scrollLeft {
        left: 10px;
    }
    
    #scrollRight {
        right: 10px;
    }
}

/* Search Box Styles */
.search-box-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding: 0 15px;
}

.search-box-container {
    width: 100%;
    max-width: 1200px;
    position: relative;
    z-index: 100;
}

.search-form {
    width: 100%;
}

.search-bar {
    display: flex;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    overflow: visible; /* allow dropdowns to overflow */
    border: 2px solid #f3f4f6;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-bar:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: #e5e7eb;
    transform: translateY(-2px);
}

.search-field {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-right: 1px solid #f1f5f9;
    position: relative;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
}

#treatmentField {
    position: relative;
    z-index: 1000;
}

.search-field:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.search-field:last-of-type {
    border-right: none;
}

.search-field:focus-within {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #0ea5e9;
}

.search-icon {
    color: #64748b;
    margin-right: 16px;
    font-size: 18px;
    width: 18px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.search-field:focus-within .search-icon {
    color: #0ea5e9;
}

.search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #1e293b;
    width: 100%;
    padding: 0;
    font-weight: 500;
    transition: all 0.2s ease;
}

.search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
    transition: color 0.2s ease;
}

.search-input:focus::placeholder {
    color: #64748b;
}

.search-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    padding: 20px 36px;
    font-weight: 700;
    font-size: 16px;
    border-radius: 0 16px 16px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.3);
}

.search-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.search-button:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #0a58ca 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.search-button:hover::before {
    left: 100%;
}

.search-button:active {
    transform: translateY(0);
}

.search-button:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

/* Dropdown styles for treatment categories */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-top: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    border-radius: 0 0 12px 12px;
    max-height: 360px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    width: 100%;
}

.search-dropdown.show {
    display: block;
}

.search-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    color: #000000;
}

.search-dropdown-item:hover {
    background: #f8fafc;
}

.search-dropdown-item .icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #c7d2fe;
    color: #4338ca;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
}

.search-dropdown-item .label {
    color: #000000;
    font-weight: 500;
}

.search-dropdown-section-title {
    font-weight: 700;
    color: #000000;
    padding: 12px 16px 4px 16px;
}

.search-dropdown-empty {
    padding: 14px 16px;
    color: #000000;
}

/* Location auto-detect button */
.location-detect-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    transition: background 0.2s ease;
}

.location-detect-btn:hover {
    background: var(--primary-hover);
}

.location-detect-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Calendar and time picker styles */
.date-picker, .time-picker {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-top: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    border-radius: 0 0 12px 12px;
    z-index: 9999;
    display: none;
    width: 100%;
    padding: 16px;
    color: #000000;
}

.date-picker.show, .time-picker.show {
    display: block;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 12px;
}

.calendar-day {
    padding: 8px;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
    color: #000000;
}

.calendar-day:hover {
    background: #f1f5f9;
}

.calendar-day.selected {
    background: var(--primary-color);
    color: white;
}

.calendar-day.other-month {
    color: #94a3b8;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.time-slot {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    color: #000000;
}

.time-slot:hover {
    background: #f1f5f9;
    border-color: var(--primary-color);
}

.time-slot.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.ampm-selector {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.ampm-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    color: #000000;
}

.ampm-btn:hover {
    background: #f1f5f9;
    border-color: var(--primary-color);
}

.ampm-btn.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Enhanced responsive design for search box */
@media (max-width: 1400px) {
    .search-box-container {
        max-width: 1000px;
    }
}

/* Search Results Map layout */
.results-container {
    height: calc(100vh - 180px);
    min-height: 600px;
}

.results-list {
    height: calc(100vh - 220px);
    overflow-y: auto;
    min-height: 500px;
}

.results-map-col {
    position: relative;
    height: calc(100vh - 180px);
    min-height: 600px;
}

.results-map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* Service items styling */
.service-item {
    border-bottom: 1px solid #f1f5f9;
}

.service-item:last-child {
    border-bottom: none;
}

.service-item:hover {
    background-color: #f8fafc;
    border-radius: 4px;
}

@media (max-width: 992px) {
    .results-container {
        height: auto;
        display: block;
        min-height: auto;
    }
    .results-list {
        height: auto;
        max-height: 50vh;
        min-height: auto;
    }
    .results-map-col {
        height: 60vh;
        min-height: 400px;
    }
    .results-map {
        position: static;
        height: 100%;
    }
}

@media (max-width: 1200px) {
    .search-box-container {
        max-width: 900px;
    }
}

@media (max-width: 992px) {
    .search-bar {
        flex-direction: column;
        border-radius: 16px;
        gap: 0;
    }
    
    .search-field {
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
        padding: 18px 20px;
    }
    
    .search-field:last-of-type {
        border-bottom: none;
    }
    
    .search-button {
        border-radius: 0 0 16px 16px;
        padding: 18px 32px;
    }
}

@media (max-width: 768px) {
    .search-box-wrapper {
        padding: 0 10px;
    }
    
    .search-field {
        padding: 16px 18px;
    }
    
    .search-input {
        font-size: 15px;
    }
    
    .search-icon {
        font-size: 16px;
        margin-right: 12px;
    }
    
    .search-button {
        padding: 16px 28px;
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    .search-box-wrapper {
        padding: 0 5px;
    }
    
    .search-field {
        padding: 14px 16px;
    }
    
    .search-icon {
        font-size: 15px;
        margin-right: 10px;
    }
    
    .search-input {
        font-size: 14px;
    }
    
    .search-button {
        padding: 14px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .search-field {
        padding: 12px 14px;
    }
    
    .search-input {
        font-size: 13px;
    }
    
    .search-button {
        padding: 12px 20px;
        font-size: 13px;
    }
}