/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Light mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #000000;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --button-bg: #e0e0e0;
    --button-text: #000000;
    --button-outline-border: #999999;
    --input-bg: #ffffff;
    --tab-inactive: #999999;
    --tab-active: #000000;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark mode */
        --bg-primary: #000000;
        --bg-secondary: #1a1a1a;
        --text-primary: #ffffff;
        --text-secondary: #999999;
        --border-color: #333333;
        --button-bg: #333333;
        --button-text: #ffffff;
        --button-outline-border: #666666;
        --input-bg: #1a1a1a;
        --tab-inactive: #666666;
        --tab-active: #ffffff;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

#app {
    min-height: 100vh;
}

/* Auth Styles */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.auth-tab {
    background: none;
    border: none;
    color: var(--tab-inactive);
    font-size: 18px;
    font-weight: 500;
    padding: 5px 0;
    cursor: pointer;
    flex: 1;
    transition: color 0.2s;
}

.auth-tab.active {
    color: var(--tab-active);
    border-bottom: 2px solid var(--tab-active);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.hint {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Button Styles - ALL GRAYSCALE */
.btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    border: 1px solid transparent;
}

.btn:active {
    opacity: 0.7;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--button-outline-border);
    color: var(--text-primary);
}

.btn-full {
    width: 100%;
}

/* Service Pills - ALL GRAYSCALE */
.service-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.service-pill {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.service-pill.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.service-pill:active {
    opacity: 0.7;
}

.selected-services {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    min-height: 40px;
}

.service-tag {
    background: var(--button-bg);
    color: var(--button-text);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
}

/* Verification Screen */
.verification-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
}

.verification-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.verification-container h2 {
    margin-bottom: 10px;
}

.verification-container .email {
    font-weight: 600;
    margin: 15px 0 10px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.verification-container .small {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.verification-container .btn {
    margin: 10px 0;
}

/* Divider */
.auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 30px);
    height: 1px;
    background: var(--border-color);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-divider span {
    background: var(--bg-primary);
    padding: 0 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

.terms-text {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 30px;
}

/* ========== HOME TAB STYLES ========== */
.home-container {
    padding-bottom: 80px;
    min-height: 100vh;
    background: var(--bg-primary);
}

.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 15px;
}

.notification-bell {
    position: relative;
    padding: 5px;
    cursor: pointer;
}

.bell-icon {
    font-size: 20px;
    filter: grayscale(100%);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Pull to Refresh */
.ptr-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 0;
    overflow: hidden;
    transition: transform 0.2s;
    color: var(--text-secondary);
    font-size: 14px;
}

.ptr-indicator.refreshing {
    height: 60px;
}

.ptr-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.1s;
}

.ptr-indicator.refreshing .ptr-spinner {
    animation: spin 0.8s linear infinite;
}

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

/* Provider Grid */
.providers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
}

.provider-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid var(--border-color);
}

.provider-card:active {
    transform: scale(0.98);
}

.provider-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.provider-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.provider-info {
    padding: 10px;
}

.provider-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.provider-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stars {
    color: var(--text-primary);
}

.provider-services {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.provider-distance {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}

.provider-distance:hover {
    text-decoration: underline;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state.hidden {
    display: none;
}

/* Bottom Sheet */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1000;
}

.bottom-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    max-height: 80vh;
    overflow-y: auto;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.sheet-handle {
    width: 32px;
    height: 3px;
    background: var(--border-color);
    border-radius: 3px;
    margin: 10px auto;
}

.sheet-content {
    padding: 0 20px 20px;
}

.quick-view-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.quick-view-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.quick-view-info h2 {
    font-size: 18px;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.quick-view-rating,
.quick-view-distance {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.quick-view-services {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.quick-view-bio {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
}

.quick-view-portfolio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 20px;
}

.portfolio-thumb {
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.portfolio-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quick-view-actions {
    display: flex;
    gap: 10px;
}

.quick-view-actions .btn {
    flex: 1;
    font-size: 14px;
    padding: 10px;
}

/* Notification Panel */
.notification-panel {
    position: fixed;
    top: 60px;
    right: 10px;
    left: 10px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    z-index: 100;
    max-width: 400px;
    margin: 0 auto;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.notification-header h3 {
    font-size: 16px;
    color: var(--text-primary);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.notification-item.unread {
    background: var(--bg-secondary);
}

.notification-content {
    font-size: 14px;
    color: var(--text-primary);
}

.notification-time {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 8px 0 12px;
    z-index: 100;
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    color: var(--tab-inactive);
    transition: color 0.2s;
}

.tab-btn.active {
    color: var(--tab-active);
}

.tab-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-icon svg {
    width: 24px;
    height: 24px;
}

.tab-label {
    font-size: 11px;
    font-weight: 500;
}

/* Dark mode variables - ensure these exist */
:root {
    --tab-inactive: #999999;
    --tab-active: #000000;
}

@media (prefers-color-scheme: dark) {
    :root {
        --tab-inactive: #666666;
        --tab-active: #ffffff;
    }
}

.tab-content {
    min-height: 100vh;
    padding-bottom: 70px;
}

/* Profile Completion Screen */
.profile-completion-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.completion-header {
    text-align: center;
    margin-bottom: 40px;
}

.completion-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.completion-header p {
    color: var(--text-secondary);
}

.completion-form {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
}

.completion-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 16px;
    resize: vertical;
    font-family: inherit;
}

.completion-form textarea:focus {
    outline: none;
    border-color: var(--text-secondary);
}

/* ========== PROFILE TAB STYLES ========== */
.profile-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px;
}

.profile-header {
    margin-bottom: 20px;
}

.profile-business-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-stats-row {
    display: flex;
    align-items: flex-start;  /* Changed from 'center' to 'flex-start' */
    gap: 20px;
    margin-bottom: 20px;
}

/* New container for business name and stats */
.profile-info-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-business-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0;  /* Ensure no extra top margin */
    line-height: 1.2;
}

.stats-grid {
    display: flex;
    gap: 15px;
    justify-content: flex-start;  /* Align stats to the left */
}

.profile-picture {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--button-bg);
    color: var(--button-text);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    border: 2px solid var(--bg-primary);
}

.stats-grid {
    display: flex;
    flex: 1;
    gap: 15px;
    justify-content: space-around;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-item.clickable {
    cursor: pointer;
}

.stat-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.profile-bio {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    text-align: left;
}

.profile-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.contact-icon {
    font-size: 16px;
    filter: grayscale(100%);
}

.contact-text {
    color: var(--text-primary);
}

.profile-section {
    margin-top: 25px;
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Add button styling - matches other buttons */
.section-header .btn-small {
    background: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.section-header .btn-small:active {
    opacity: 0.7;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.services-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.service-pill-static {
    background: var(--button-bg);
    color: var(--button-text);
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.service-pill-static.pending {
    opacity: 0.6;
    font-style: italic;
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin: 25px 0;
}

.profile-actions .btn {
    flex: 1;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    background: var(--bg-primary);
}

.portfolio-item {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-secondary);
    cursor: pointer;
    overflow: hidden;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delete-overlay {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.portfolio-item:hover .delete-overlay,
.portfolio-item:active .delete-overlay {
    opacity: 1;
}

.empty-portfolio {
    grid-column: span 3;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 8px;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

/* ========== SEARCH TAB STYLES ========== */
.search-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.search-map {
    height: 45vh;
    width: 100%;
    border-radius: 12px;
    margin: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1;
}

.search-controls {
    height: auto;  /* Changed from fixed height */
    padding: 8px 15px;  /* Reduced padding */
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 2;
}

.search-input-container {
    margin-bottom: 8px;  /* Reduced margin */
}

.search-input {
    width: 100%;
    padding: 8px 12px;  /* Reduced padding */
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.radius-control {
    display: flex;
    align-items: center;
    gap: 8px;  /* Reduced gap */
}

.radius-icon {
    font-size: 14px;  /* Smaller icon */
    filter: grayscale(100%);
}

.radius-value {
    font-size: 13px;  /* Smaller text */
    color: var(--text-primary);
    min-width: 45px;  /* Slightly smaller */
}

.radius-slider {
    flex: 1;
    height: 3px;  /* Thinner slider */
    -webkit-appearance: none;
    background: var(--border-color);
    border-radius: 2px;
}

.radius-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;  /* Smaller thumb */
    height: 16px;  /* Smaller thumb */
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
}

.provider-drawer {
    height: 45vh;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    z-index: 3;
}

.drawer-handle {
    width: 32px;
    height: 3px;
    background: var(--border-color);
    border-radius: 3px;
    margin: 10px auto;
}

.provider-list {
    padding: 0 15px 15px;
}

.provider-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.provider-list-item:active {
    background: var(--bg-secondary);
}

.list-item-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.list-item-info {
    flex: 1;
}

.list-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.list-item-details {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
}

.empty-list {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
}

.drawer-loading {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.drawer-loading.hidden {
    display: none;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Map Markers */
.provider-marker-container {
    background: transparent;
    border: none;
}

.provider-marker {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.marker-pin {
    width: 20px;
    height: 20px;
    background: #FF0000; /* Only allowed color - red pin */
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.rating-badge {
    background: white;
    color: black;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 10px;
    white-space: nowrap;
    margin-top: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.user-location-marker {
    background: transparent;
    border: none;
}

.user-dot {
    width: 12px;
    height: 12px;
    background: #0000FF; /* Blue dot for user */
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Map Popup */
.map-popup {
    text-align: center;
    padding: 5px;
}

.map-popup strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.popup-btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    margin-top: 8px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.popup-btn:active {
    opacity: 0.7;
}

/* Directions Toggle Button */
.directions-toggle-btn {
    position: absolute;
    top: 60px;
    right: 20px;
    background: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.directions-toggle-btn:active {
    opacity: 0.7;
}

/* Leaflet Routing Machine Override */
.leaflet-routing-container {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 10px !important;
    max-height: 200px !important;
    overflow-y: auto !important;
}

.leaflet-routing-alt {
    border-bottom: 1px solid var(--border-color) !important;
}

.leaflet-routing-alt h2 {
    color: var(--text-primary) !important;
    font-size: 14px !important;
}

.leaflet-routing-alt tr:hover {
    background: var(--bg-secondary) !important;
}

/* ========== MESSAGES TAB STYLES ========== */
.messages-container {
    min-height: 100vh;
    background: var(--bg-primary);
    padding-bottom: 70px;
}

.messages-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.messages-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.conversations-list {
    padding: 10px 0;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.conversation-item:active {
    background: var(--bg-secondary);
}

.conversation-item.unread {
    background: var(--bg-secondary);
}

.conversation-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.conversation-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.conversation-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.conversation-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.preview-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.message-status {
    font-size: 12px;
    margin-left: 8px;
    color: var(--text-secondary);
}

.message-status.read {
    color: #FF0000; /* Red when read - only allowed color */
}

/* Chat View */
.chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-back-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0 5px;
}

.chat-header-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-secondary);
}

.chat-date-separator {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin: 15px 0;
    position: relative;
}

.chat-date-separator::before,
.chat-date-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 70px);
    height: 1px;
    background: var(--border-color);
}

.chat-date-separator::before {
    left: 0;
}

.chat-date-separator::after {
    right: 0;
}

.message-row {
    display: flex;
    margin-bottom: 4px;
}

.message-row.mine {
    justify-content: flex-end;
}

.message-row.theirs {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
}

.message-bubble.mine {
    background: var(--button-bg);
    color: var(--button-text);
    border-bottom-right-radius: 4px;
}

.message-bubble.theirs {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 10px;
}

.message-time {
    color: var(--text-secondary);
}

.message-status {
    font-size: 10px;
    color: var(--text-secondary);
}

.message-status.read {
    color: #FF0000; /* Red when read */
}

.chat-input-container {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.chat-send-btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.chat-send-btn:active {
    opacity: 0.7;
}

/* Empty States */
.empty-state-messages {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-messages .empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    filter: grayscale(100%);
}

.empty-state-messages h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state-messages p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    max-width: 250px;
}

.empty-state-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state-chat .empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    filter: grayscale(100%);
}

.empty-state-chat p {
    margin-bottom: 5px;
}

.empty-state-chat .empty-hint {
    font-size: 12px;
    opacity: 0.7;
}

.conversations-loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.conversations-loading.hidden {
    display: none;
}

/* ========== EDIT PROFILE STYLES ========== */
.edit-profile-container {
    min-height: 100vh;
    background: var(--bg-primary);
    padding-bottom: 30px;
}

.edit-profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
}

.back-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0 5px;
}

.edit-profile-header h1 {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.save-btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.edit-profile-form {
    padding: 20px;
}

.edit-picture-section {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.edit-picture {
    position: relative;
    width: 100px;
    height: 100px;
}

.edit-picture img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.change-picture-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--button-bg);
    color: var(--button-text);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.cooldown-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.current-services {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    min-height: 40px;
}

.remove-service {
    margin-left: 4px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.7;
}

.remove-service:hover {
    opacity: 1;
}

.add-service {
    display: flex;
    gap: 8px;
}

.add-service input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
}

.add-service-btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.location-picker-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.account-actions {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delete-account {
    border-color: #ff0000 !important;
    color: #ff0000 !important;
}

/* ========== LOCATION PICKER STYLES ========== */
.location-picker-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
}

.location-picker-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    z-index: 10;
}

.location-picker-header h1 {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.location-map {
    flex: 1;
    width: 100%;
    z-index: 1;
}

.location-search {
    padding: 15px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 5;
}

.location-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
}

.location-search-input:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.location-details {
    padding: 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    z-index: 5;
}

.location-address {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    cursor: default;
}

.location-address:focus {
    outline: none;
}

.location-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
}

.pin {
    width: 30px;
    height: 30px;
    background: #FF0000;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: bounce 0.5s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Leaflet map customizations */
.leaflet-control-attribution {
    font-size: 8px;
    background: rgba(255,255,255,0.7);
    padding: 2px 5px;
    border-radius: 3px;
}

/* Custom Red Pin for Location Picker */
.custom-pin {
    background: transparent;
    border: none;
}

.red-pin {
    width: 30px;
    height: 30px;
    background: #FF0000;
    border: 3px solid white;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: bounce 0.5s;
}

.red-pin::after {
    content: '';
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 7px;
    left: 7px;
}

@keyframes bounce {
    0%, 100% { transform: rotate(-45deg) translateY(0); }
    50% { transform: rotate(-45deg) translateY(-10px); }
}

/* Save button states */
.btn.saved {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.btn.saved:active {
    opacity: 0.7;
}
