/* ========================================
   Component Library - Airbnb Style
   ======================================== */

/* ========================================
   Filter Pills
   ======================================== */

.filter-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-container::-webkit-scrollbar {
    display: none;
}

.filter-btn, .category-filter {
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background: white;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-btn:hover, .category-filter:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.filter-btn.active, .category-filter.active {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

.filter-btn i {
    font-size: var(--text-lg);
}

/* ========================================
   Carousel Component
   ======================================== */

.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform var(--transition-base);
    cursor: grab;
}

.carousel-track:active {
    cursor: grabbing;
}

.carousel-slide {
    min-width: 100%;
    transition: opacity var(--transition-base);
}

.carousel-btn-prev,
.carousel-btn-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 10;
    transition: all var(--transition-fast);
    opacity: 0;
}

.carousel:hover .carousel-btn-prev,
.carousel:hover .carousel-btn-next {
    opacity: 1;
}

.carousel-btn-prev {
    left: var(--space-md);
}

.carousel-btn-next {
    right: var(--space-md);
}

.carousel-btn-prev:hover,
.carousel-btn-next:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-lg);
}

.carousel-btn-prev:disabled,
.carousel-btn-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-dots {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-sm);
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.carousel-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

/* ========================================
   Image Gallery Modal
   ======================================== */

.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.gallery-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.gallery-close:hover {
    transform: scale(1.2);
}

.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-prev {
    left: var(--space-xl);
}

.gallery-next {
    right: var(--space-xl);
}

.gallery-prev:hover,
.gallery-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: var(--space-2xl) var(--space-xl) var(--space-lg);
    text-align: center;
}

.gallery-counter {
    position: absolute;
    top: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: var(--text-sm);
    background: rgba(0, 0, 0, 0.5);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
}

/* ========================================
   Guest Counter Component
   ======================================== */

.guest-selector {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.guest-label {
    flex: 1;
}

.guest-label-title {
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--text-primary);
}

.guest-label-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.guest-controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.guest-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--text-lg);
    color: var(--text-secondary);
}

.guest-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.guest-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.guest-count {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   Price Summary Card
   ======================================== */

.price-summary {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    position: sticky;
    top: 100px;
    box-shadow: var(--shadow-md);
}

.price-summary-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.price-summary-amount {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
}

.price-summary-unit {
    font-size: var(--text-base);
    color: var(--text-secondary);
}

.price-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    font-size: var(--text-base);
}

.price-summary-label {
    color: var(--text-secondary);
}

.price-summary-value {
    color: var(--text-primary);
    font-weight: 500;
}

.price-summary-total {
    display: flex;
    justify-content: space-between;
    padding-top: var(--space-lg);
    margin-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
    font-size: var(--text-xl);
    font-weight: 700;
}

/* ========================================
   Tab Component
   ======================================== */

.tabs {
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-xl);
}

.tab-list {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
}

.tab-btn {
    padding: var(--space-md) 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* ========================================
   Progress Steps
   ======================================== */

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-3xl);
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-light);
    z-index: 0;
}

.progress-bar-fill {
    position: absolute;
    top: 20px;
    left: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-base);
    z-index: 1;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.step-indicator.active .step-circle {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.step-indicator.completed .step-circle {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.step-indicator.completed .step-circle::before {
    content: '✓';
}

.step-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.step-indicator.active .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

/* ========================================
   Badge Component
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-warning {
    background: #FFF3E0;
    color: #E65100;
}

.badge-info {
    background: #E3F2FD;
    color: #1565C0;
}

.badge-primary {
    background: #FCE4EC;
    color: var(--primary-dark);
}

/* ========================================
   Tooltip
   ======================================== */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: var(--text-primary);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    white-space: nowrap;
    opacity: 0;
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: var(--z-tooltip);
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    border: 6px solid transparent;
    border-top-color: var(--text-primary);
    opacity: 0;
    transition: all var(--transition-fast);
    pointer-events: none;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* ========================================
   Loading Spinner
   ======================================== */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-large {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* ========================================
   Modal
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: var(--space-xl);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: none;
    border: none;
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-header {
    margin-bottom: var(--space-xl);
}

.modal-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.modal-footer {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-light);
}

/* ========================================
   Form Elements
   ======================================== */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: white;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 56, 92, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #FF5252;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.error-message {
    display: block;
    margin-top: var(--space-xs);
    font-size: var(--text-sm);
    color: #FF5252;
}

.form-checkbox,
.form-radio {
    margin-right: var(--space-sm);
}

/* ========================================
   Rating Component
   ======================================== */

.rating {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-star {
    color: #FFB400;
    font-size: var(--text-base);
}

.rating-star.empty {
    color: var(--border-color);
}

.rating-value {
    font-weight: 600;
    color: var(--text-primary);
    margin-left: var(--space-xs);
}

.rating-count {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* ========================================
   Divider
   ======================================== */

.divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-xl) 0;
}

.divider-text {
    position: relative;
    text-align: center;
    margin: var(--space-xl) 0;
}

.divider-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-light);
}

.divider-text span {
    position: relative;
    background: white;
    padding: 0 var(--space-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .price-summary {
        position: static;
    }
    
    .guest-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .guest-controls {
        justify-content: space-between;
    }
    
    .progress-steps {
        flex-wrap: wrap;
    }
    
    .step-label {
        font-size: var(--text-xs);
    }
    
    .modal-content {
        padding: var(--space-lg);
    }
    
    .gallery-prev {
        left: var(--space-sm);
    }
    
    .gallery-next {
        right: var(--space-sm);
    }
}

