/* ============================================
   APPOINTMENT STEPS - SHARED STYLES
   Modern, Responsive, Touch-Friendly Design
   ============================================ */

:root {
    --primary-color: #9E8A78;
    --primary-hover: #8a7868;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* ============================================
   PROGRESS STEPS
   ============================================ */

.progress-steps {
    position: relative;
    padding: var(--spacing-lg) 0;
    margin-bottom: var(--spacing-xl);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.progress-steps::-webkit-scrollbar {
    height: 4px;
}

.progress-steps::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* Container for steps */
.progress-steps>.d-flex,
.progress-steps .d-flex {
    position: relative;
    min-width: 100%;
    padding: 0;
    gap: 0;
}

/* Connecting line between steps - Base gray line */
.progress-steps>.d-flex::before,
.progress-steps .d-flex::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step {
    text-align: center;
    flex: 1;
    position: relative;
    z-index: 1;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-sm);
    font-weight: 700;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 2;
}

.step.active .step-circle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(158, 138, 120, 0.3);
}

.step.completed .step-circle {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

/* Green line connecting completed steps */
.step.completed::after {
    content: '';
    position: absolute;
    top: 24px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: var(--success-color);
    z-index: 1;
}

/* Hide line after last step */
.step:last-child::after {
    display: none;
}

@keyframes checkmark {
    0% {
        transform: scale(0.8);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.step-text {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.3;
    display: block;
    max-width: 90px;
    text-align: center;
    word-wrap: break-word;
}

.step.active .step-text {
    color: var(--primary-color);
    font-weight: 700;
}

.step.completed .step-text {
    color: var(--success-color);
    font-weight: 600;
}

/* Mobile: Smaller circles and hide some text */
@media (max-width: 576px) {
    .step-text {
        font-size: 9px;
        max-width: 60px;
    }

    .step-circle {
        width: 36px;
        height: 36px;
        font-size: 14px;
        border-width: 2px;
    }

    .progress-steps>.d-flex,
    .progress-steps .d-flex {
        min-width: 100%;
    }

    .progress-steps>.d-flex::before,
    .progress-steps .d-flex::before {
        top: 18px;
    }

    .step.completed::after {
        top: 18px;
    }
    
    .step {
        min-width: 50px;
    }
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */

.appointment-card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.appointment-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.appointment-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(to bottom, rgba(158, 138, 120, 0.03), white);
}

.service-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
}

.service-title {
    font-size: 18px;
    font-weight: 700;
    color: #212529;
    margin-bottom: var(--spacing-sm);
}

.service-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.service-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.service-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.service-duration {
    font-size: 14px;
    color: var(--text-muted);
}

/* ============================================
   BARBER CARDS
   ============================================ */

.barber-card {
    cursor: pointer;
    padding: var(--spacing-lg);
    text-align: center;
    position: relative;
}

.barber-selected-status {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 2;
}

.barber-card.selected .barber-selected-status {
    opacity: 1;
    transform: translateY(0);
}

.barber-avatar-container {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-md);
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--light-bg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.barber-card.selected .barber-avatar-container {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(158, 138, 120, 0.3);
}

.barber-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.barber-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.barber-specialty {
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: var(--spacing-sm);
}

.barber-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: var(--spacing-md);
}

.barber-skills .badge {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
}

/* ============================================
   TIME SLOTS
   ============================================ */

.time-slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--spacing-md);
}

.time-slot {
    position: relative;
}

.time-slot-input {
    display: none;
}

.time-slot-label {
    display: block;
    padding: var(--spacing-md);
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    font-weight: 600;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.time-slot-label:hover {
    border-color: var(--primary-color);
    background: rgba(158, 138, 120, 0.05);
    transform: translateY(-2px);
}

.time-slot-input:checked+.time-slot-label {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(158, 138, 120, 0.3);
}

.time-slot-input:checked+.time-slot-label .badge {
    background: white !important;
    color: var(--primary-color) !important;
}

.time-slot-input:disabled+.time-slot-label {
    background: var(--light-bg);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Mobile: Smaller time slots */
@media (max-width: 576px) {
    .time-slots-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: var(--spacing-sm);
    }

    .time-slot-label {
        padding: var(--spacing-sm);
        min-height: 50px;
        font-size: 14px;
    }
}

/* ============================================
   FORMS
   ============================================ */

.form-control,
.form-select {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    font-size: 15px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(158, 138, 120, 0.1);
}

.form-label {
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: #212529;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 15px;
    min-height: 44px;
    /* Touch-friendly */
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(158, 138, 120, 0.3);
}

.btn-outline-secondary {
    border: 2px solid var(--border-color);
    background: white;
    color: #212529;
}

.btn-outline-secondary:hover {
    background: var(--light-bg);
    border-color: var(--text-muted);
}

/* Mobile: Full-width buttons */
@media (max-width: 576px) {
    .btn {
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }

    .mt-4.d-flex.justify-content-between {
        flex-direction: column-reverse !important;
    }
}

/* ============================================
   SELECTED INFO CARD
   ============================================ */

.selected-info .card {
    border: none;
    box-shadow: var(--shadow-md);
}

.selected-info .card-header {
    background: var(--primary-color) !important;
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.selected-info .table {
    margin-bottom: 0;
}

.selected-info .table td,
.selected-info .table th {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--light-bg);
}

.selected-info .table tfoot {
    border-top: 2px solid var(--border-color);
}

/* ============================================
   RESPONSIVE GRID
   ============================================ */

/* Service grid - responsive columns */
.service-grid {
    display: grid;
    gap: var(--spacing-lg);
}

/* Desktop: 3 columns max */
@media (min-width: 1024px) {
    .service-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 1 column, max 500px */
@media (max-width: 767px) {
    .service-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
}

/* Barber grid - responsive columns */
.barber-grid {
    display: grid;
    gap: var(--spacing-lg);
}

@media (min-width: 768px) {
    .barber-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .barber-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

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

.bg-primary {
    background-color: var(--primary-color) !important;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ============================================
   PAYMENT METHOD CARDS
   ============================================ */

.payment-option {
    padding: var(--spacing-lg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.payment-option:hover {
    border-color: var(--primary-color);
    background: rgba(158, 138, 120, 0.02);
}

.payment-option input:checked~label {
    font-weight: 700;
}

.payment-option:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(158, 138, 120, 0.05);
}

.payment-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}