/**
 * Barber Marketplace Styles v3.0
 * Styles for flexible booking, service type selection, and location features
 */

/* ============================================
   MARKETPLACE CONTAINER
   ============================================ */
.barber-marketplace-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 15px 0;
    border: 2px solid #8B4513;
}

/* ============================================
   SERVICE TYPE SELECTOR
   ============================================ */
.service-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.service-type-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid #333;
    border-radius: 12px;
    background: #0a0a15;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    text-align: center;
    position: relative;
}

.service-type-btn:hover {
    border-color: #8B4513;
    color: #fff;
}

.service-type-btn.active {
    border-color: #FFD700;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: #fff;
}

.home-visit-badge {
    display: block;
    font-size: 0.75em;
    color: #4CAF50;
    margin-top: 5px;
}

.service-type-btn.active .home-visit-badge {
    color: #90EE90;
}

/* ============================================
   ADDRESS INPUT (HOME VISITS)
   ============================================ */
.address-input-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #333;
}

.address-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #0a0a15;
    color: white;
    font-size: 1em;
    margin-bottom: 10px;
}

.address-input::placeholder {
    color: #666;
}

.use-location-btn {
    width: 100%;
    padding: 10px;
    border: 1px dashed #8B4513;
    border-radius: 8px;
    background: transparent;
    color: #8B4513;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.use-location-btn:hover {
    background: rgba(139, 69, 19, 0.1);
}

.use-location-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.address-notes {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #0a0a15;
    color: white;
    font-size: 0.9em;
    min-height: 50px;
    resize: vertical;
}

.address-notes::placeholder {
    color: #555;
}

/* ============================================
   DATE SELECTOR
   ============================================ */
.date-selector {
    margin-bottom: 20px;
}

.selector-label {
    color: #FFD700;
    margin-bottom: 12px;
    font-weight: 500;
}

.date-scroll-container {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
    -webkit-overflow-scrolling: touch;
}

.date-options {
    display: flex;
    gap: 10px;
    padding-bottom: 10px;
}

.date-btn {
    flex-shrink: 0;
    width: 70px;
    padding: 12px 8px;
    border: 2px solid #333;
    border-radius: 12px;
    background: #0a0a15;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.date-btn:hover {
    border-color: #8B4513;
    transform: translateY(-2px);
}

.date-btn.selected {
    border-color: #FFD700;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: #fff;
}

.date-day {
    display: block;
    font-size: 0.75em;
    color: #888;
    margin-bottom: 4px;
}

.date-btn.selected .date-day {
    color: #FFD700;
}

.date-num {
    display: block;
    font-size: 1.4em;
    font-weight: bold;
}

.date-month {
    display: block;
    font-size: 0.7em;
    color: #666;
    margin-top: 2px;
}

.date-btn.selected .date-month {
    color: #ccc;
}

/* ============================================
   SLOT SELECTOR
   ============================================ */
.slot-selector {
    margin-bottom: 20px;
}

.slot-options {
    display: flex;
    gap: 10px;
}

.slot-btn {
    flex: 1;
    padding: 15px 10px;
    border: 2px solid #333;
    border-radius: 12px;
    background: #0a0a15;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 1em;
}

.slot-btn:hover {
    border-color: #8B4513;
    transform: translateY(-2px);
}

.slot-btn.selected {
    border-color: #FFD700;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: #fff;
}

.slot-btn small {
    display: block;
    font-size: 0.75em;
    color: #888;
    margin-top: 4px;
}

.slot-btn.selected small {
    color: #ccc;
}

/* ============================================
   BARBER CARDS V3
   ============================================ */
.barber-results-v3 {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.loading-barbers {
    text-align: center;
    color: #888;
    padding: 30px;
}

.no-barbers {
    text-align: center;
    color: #888;
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.barber-card-v3 {
    background: linear-gradient(135deg, #0a0a15 0%, #1a1a2e 100%);
    border: 2px solid #333;
    border-radius: 16px;
    padding: 18px;
    transition: border-color 0.2s;
}

.barber-card-v3:hover {
    border-color: #8B4513;
}

.barber-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.barber-info .barber-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 4px;
}

.barber-info .barber-rating {
    color: #FFD700;
    font-size: 0.9em;
}

.barber-badges {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.distance-badge {
    background: #2196F3;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75em;
}

.approval-badge {
    background: #FF9800;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75em;
}

.instant-badge {
    background: #4CAF50;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75em;
}

.barber-shop-info {
    color: #87CEEB;
    font-size: 1.05em;
    margin-bottom: 6px;
}

.barber-card-v3 .barber-address,
.barber-card-v3 .barber-specialty {
    color: #999;
    font-size: 0.9em;
    margin: 4px 0;
}

/* Pricing breakdown */
.barber-pricing-v3 {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin: 15px 0;
}

.price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    color: #ccc;
    font-size: 0.9em;
}

.price-row.booking-fee {
    color: #FFD700;
    padding-top: 8px;
    border-top: 1px dashed #333;
}

.price-row.total {
    font-weight: bold;
    color: #4CAF50;
    padding-top: 8px;
    border-top: 1px solid #333;
    font-size: 1em;
}

.savings-badge {
    background: #4CAF50;
    color: white;
    text-align: center;
    padding: 6px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.85em;
    font-weight: bold;
}

/* Actions */
.barber-actions-v3 {
    margin-top: 15px;
}

.btn-request-booking {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    font-size: 1.05em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-request-booking:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.4);
}

.secondary-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-secondary {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    background: #333;
    color: white;
    text-decoration: none;
    text-align: center;
    font-size: 0.9em;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #444;
}

/* ============================================
   MODAL V3
   ============================================ */
.barber-modal-v3 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.barber-modal-content-v3 {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #8B4513;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

/* Waiting for approval */
.waiting-approval {
    color: white;
}

.waiting-icon {
    font-size: 3em;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.waiting-approval h3 {
    color: #FFD700;
    margin-bottom: 10px;
}

.booking-details {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    line-height: 1.8;
}

.waiting-note {
    color: #888;
    font-size: 0.9em;
    margin-top: 15px;
}

.btn-cancel-request {
    margin-top: 20px;
    padding: 10px 25px;
    border: 1px solid #666;
    border-radius: 8px;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-request:hover {
    border-color: #f44336;
    color: #f44336;
}

/* Booking rejected */
.booking-rejected {
    color: white;
}

.rejected-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.booking-rejected h3 {
    color: #f44336;
    margin-bottom: 10px;
}

.rejection-reason {
    background: rgba(244, 67, 54, 0.1);
    border-left: 3px solid #f44336;
    padding: 10px 15px;
    margin: 15px 0;
    text-align: left;
    font-style: italic;
    color: #ccc;
}

.btn-find-another {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    font-weight: bold;
    cursor: pointer;
}

/* Payment ready */
.payment-ready {
    color: white;
}

.payment-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.payment-ready h3 {
    color: #4CAF50;
    margin-bottom: 10px;
}

.payment-summary {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.summary-row:last-child {
    border-bottom: none;
}

.btn-pay-now {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-pay-now:hover {
    transform: translateY(-2px);
}

/* Payment processing */
.payment-processing {
    color: white;
    padding: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #333;
    border-top-color: #8B4513;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

/* Payment cancelled */
.payment-cancelled {
    color: white;
}

.cancelled-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.btn-try-again {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 10px;
}

.btn-cancel-booking {
    width: 100%;
    padding: 10px;
    border: 1px solid #666;
    border-radius: 8px;
    background: transparent;
    color: #888;
    cursor: pointer;
}

/* Payment fallback */
.payment-fallback {
    color: white;
}

.fallback-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.fallback-note {
    color: #888;
    font-size: 0.9em;
    margin: 15px 0;
}

.btn-test-confirm {
    padding: 10px 20px;
    border: 1px dashed #666;
    border-radius: 8px;
    background: transparent;
    color: #666;
    cursor: pointer;
}

/* ============================================
   BOOKING CONFIRMED V3
   ============================================ */
.booking-confirmed-v3 {
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 100%);
    border: 2px solid #4CAF50;
    border-radius: 16px;
    padding: 20px;
    margin: 15px 0;
}

.confirmed-header {
    font-size: 1.4em;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 15px;
    text-align: center;
}

.confirmed-details {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.confirmed-details p {
    margin: 8px 0;
    color: #fff;
}

.confirmed-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-directions,
.btn-call {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
}

.btn-directions {
    background: #4CAF50;
    color: white;
}

.btn-call {
    background: #333;
    color: white;
}

.on-the-way-section {
    background: rgba(255, 215, 0, 0.1);
    border: 1px dashed #FFD700;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.on-the-way-section p {
    color: #FFD700;
    margin-bottom: 10px;
}

.btn-on-my-way {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-on-my-way:hover {
    transform: translateY(-2px);
}

.confirmed-note {
    color: #90EE90;
    font-size: 0.9em;
    text-align: center;
}

/* ============================================
   ON MY WAY CONFIRMED
   ============================================ */
.on-my-way-confirmed {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #4CAF50;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.omw-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.on-my-way-confirmed h3 {
    color: #4CAF50;
    margin-bottom: 10px;
}

.on-my-way-confirmed p {
    color: #ccc;
    margin: 5px 0;
}

.location-sharing-active {
    color: #2196F3 !important;
    font-weight: 500;
}

.btn-stop-sharing {
    margin-top: 15px;
    padding: 10px 20px;
    border: 1px solid #666;
    border-radius: 8px;
    background: transparent;
    color: #888;
    cursor: pointer;
}

/* ============================================
   ERROR STATES
   ============================================ */
.booking-error-v3 {
    background: linear-gradient(135deg, #4a1a1a 0%, #5a2d2d 100%);
    border: 2px solid #f44336;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.error-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.booking-error-v3 p {
    color: #ffcdd2;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .barber-marketplace-container {
        padding: 15px;
        margin: 10px 0;
    }
    
    .service-type-selector {
        flex-direction: column;
    }
    
    .slot-options {
        flex-direction: column;
    }
    
    .slot-btn {
        padding: 12px;
    }
    
    .barber-card-header {
        flex-direction: column;
    }
    
    .barber-badges {
        flex-direction: row;
        margin-top: 10px;
    }
    
    .confirmed-actions {
        flex-direction: column;
    }
    
    .secondary-actions {
        flex-direction: column;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.date-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.date-scroll-container::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 3px;
}

.date-scroll-container::-webkit-scrollbar-thumb {
    background: #8B4513;
    border-radius: 3px;
}

.date-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #A0522D;
}