/**
 * Barber Stripe Payment Styles
 * Dark theme matching Nyata AI design
 */

/* ============================================
   MODAL CONTAINER
   ============================================ */
.barber-payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.barber-payment-modal.visible {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   PAYMENT CONTAINER
   ============================================ */
.barber-payment-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #8B4513;
    border-radius: 20px;
    padding: 30px;
    max-width: 420px;
    width: 100%;
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.barber-payment-container.success {
    border-color: #4CAF50;
    text-align: center;
}

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

/* ============================================
   HEADER
   ============================================ */
.payment-header {
    text-align: center;
    margin-bottom: 25px;
}

.payment-icon,
.success-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.payment-header h3 {
    color: #FFD700;
    font-size: 1.5em;
    margin: 0 0 8px 0;
}

.payment-header p {
    color: #aaa;
    margin: 0;
    font-size: 0.95em;
}

/* ============================================
   BOOKING SUMMARY
   ============================================ */
.booking-summary {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
}

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

.summary-item .value {
    color: #fff;
    font-weight: 500;
}

.status-pending {
    color: #FFD700 !important;
}

/* ============================================
   PRICE BREAKDOWN
   ============================================ */
.price-breakdown {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: #aaa;
    font-size: 0.95em;
}

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

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

/* ============================================
   INFO NOTE
   ============================================ */
.payment-info-note {
    display: flex;
    gap: 10px;
    background: rgba(139, 69, 19, 0.15);
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.payment-info-note .info-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.payment-info-note p {
    margin: 0;
    color: #ccc;
    font-size: 0.85em;
    line-height: 1.4;
}

/* ============================================
   PAYMENT FORM
   ============================================ */
.payment-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #FFD700;
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Card Element Container */
.card-element-container {
    background: #0a0a15;
    border: 2px solid #333;
    border-radius: 10px;
    padding: 15px;
    transition: border-color 0.2s ease;
}

.card-element-container:focus-within {
    border-color: #8B4513;
}

.card-element-container.StripeElement--focus {
    border-color: #FFD700;
}

.card-element-container.StripeElement--invalid {
    border-color: #ef4444;
}

/* Card Errors */
.card-errors {
    color: #ef4444;
    font-size: 0.85em;
    margin-top: 8px;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card-errors.visible {
    opacity: 1;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-submit-payment {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-submit-payment:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-submit-payment:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-submit-payment #button-text.hidden,
.btn-submit-payment #spinner.hidden {
    display: none;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Cancel Button */
.btn-cancel-payment {
    width: 100%;
    padding: 12px;
    border: 1px solid #555;
    border-radius: 10px;
    background: transparent;
    color: #888;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-cancel-payment:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Done Button (success state) */
.btn-done {
    padding: 14px 40px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s;
}

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

/* ============================================
   SECURITY BADGE
   ============================================ */
.payment-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #666;
    font-size: 0.8em;
    margin-bottom: 15px;
}

.payment-security .lock-icon {
    font-size: 1em;
}

/* ============================================
   LOADING STATE
   ============================================ */
.payment-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    color: white;
}

.payment-loading .spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.payment-loading p {
    color: #ccc;
    font-size: 1em;
}

/* ============================================
   ERROR STATE
   ============================================ */
.payment-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-error .error-icon {
    font-size: 1.5em;
}

.payment-error p {
    margin: 0;
    color: #fca5a5;
    font-size: 0.9em;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .barber-payment-modal {
        padding: 10px;
    }
    
    .barber-payment-container {
        padding: 20px;
        border-radius: 16px;
    }
    
    .payment-header h3 {
        font-size: 1.3em;
    }
    
    .payment-icon,
    .success-icon {
        font-size: 2.5em;
    }
    
    .btn-submit-payment {
        padding: 14px;
        font-size: 1em;
    }
}

/* ============================================
   SCROLLBAR (for modal content)
   ============================================ */
.barber-payment-container::-webkit-scrollbar {
    width: 6px;
}

.barber-payment-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

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

/* ============================================
   TEST MODE INDICATOR
   ============================================ */
.test-mode-banner {
    background: #FF9800;
    color: #000;
    text-align: center;
    padding: 8px;
    font-size: 0.8em;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
    margin: -30px -30px 20px -30px;
}

/* ============================================
   BOOKING STATUS INDICATORS (for dashboard)
   ============================================ */
.payment-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
}

.payment-status.pending {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.payment-status.authorized {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.payment-status.captured {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.payment-status.cancelled {
    background: rgba(158, 158, 158, 0.2);
    color: #9E9E9E;
}

.payment-status.refunded {
    background: rgba(156, 39, 176, 0.2);
    color: #9C27B0;
}

.payment-status.failed {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

/* ============================================
   APPLE PAY / GOOGLE PAY WALLET STYLES
   ============================================ */
.wallet-payment-section {
    margin-bottom: 16px;
}

.payment-request-btn-container {
    min-height: 48px;
    border-radius: 8px;
    overflow: hidden;
}

.wallet-loading {
    text-align: center;
    padding: 14px;
    color: #9CA3AF;
    font-size: 14px;
}

.wallet-loading i {
    margin-right: 8px;
}

.wallet-available-note {
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: #10B981;
    font-weight: 500;
}

.no-wallet-note {
    text-align: center;
    padding: 14px;
    color: #9CA3AF;
    font-size: 14px;
}

.no-wallet-note i {
    margin-right: 8px;
    color: #6366F1;
}

/* Payment Divider */
.payment-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #6B7280;
    font-size: 13px;
}

.payment-divider::before,
.payment-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent);
}

.payment-divider span {
    padding: 0 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Card Payment Button */
.btn-card-payment {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #374151 0%, #1F2937 100%);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-card-payment:hover {
    background: linear-gradient(135deg, #4B5563 0%, #374151 100%);
    transform: translateY(-2px);
}

/* Test Mode Styles */
.test-mode-banner {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 16px;
}

.btn-test-payment {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.btn-test-payment:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* Highlight booking fee */
.price-row.highlight {
    background: rgba(99, 102, 241, 0.15);
    margin: 8px -10px;
    padding: 8px 10px;
    border-radius: 8px;
    border-left: 3px solid #6366F1;
}

/* Success note styling */
.success-note {
    background: rgba(16, 185, 129, 0.15) !important;
    border-left-color: #10B981 !important;
}

/* Booking confirmed in chat */
.barber-booking-confirmed {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #10B981;
    border-radius: 16px;
    padding: 20px;
    margin: 10px 0;
}

.barber-booking-confirmed .confirmed-header {
    font-size: 18px;
    font-weight: 700;
    color: #10B981;
    margin-bottom: 12px;
}

.barber-booking-confirmed .confirmed-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: #E5E7EB;
}

.barber-booking-confirmed .confirmed-note {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
    color: #9CA3AF;
}

/* Status pending pulse */
.status-pending {
    color: #F59E0B;
    animation: pendingPulse 2s ease-in-out infinite;
}

@keyframes pendingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}