/* ============================================
   Iksafar Travel - Components
   ============================================ */

/* ---------- Cards ---------- */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary { background: var(--primary); color: var(--text-light); }
.badge-secondary { background: var(--secondary); color: var(--primary); }
.badge-accent { background: var(--accent); color: var(--text-light); }
.badge-success { background: #22c55e; color: white; }
.badge-warning { background: #f59e0b; color: white; }
.badge-danger { background: #ef4444; color: white; }

/* ---------- Rating Stars ---------- */
.stars {
    color: var(--secondary);
    letter-spacing: 2px;
}
.stars .empty {
    color: #ddd;
}

/* ---------- Price Display ---------- */
.price {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary);
}
.price small {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---------- Form Elements ---------- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.form-group .required {
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-white);
    color: var(--text-dark);
}

.form-control:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(243, 184, 58, 0.15);
}

.form-control.error {
    border-color: #ef4444;
}

.form-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* ---------- Select ---------- */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a7a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

/* ---------- Checkbox & Radio ---------- */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--secondary);
}

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-light);
    padding: 4px;
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 24px;
    border: none;
    background: none;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    color: var(--text-muted);
}

.tab-btn:hover {
    color: var(--text-dark);
}

.tab-btn.active {
    background: var(--bg-white);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tab-content {
    display: none;
    padding: 24px 0;
}

.tab-content.active {
    display: block;
}

/* ---------- Accordion ---------- */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: var(--transition);
}

.accordion-header:hover {
    background: var(--bg-light);
}

.accordion-header i {
    transition: var(--transition);
}

.accordion-item.active .accordion-header i {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-body-inner {
    padding: 0 20px 20px;
    color: var(--text-muted);
}

.accordion-item.active .accordion-body {
    max-height: 500px;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    color: var(--text-dark);
}

.pagination a:hover {
    background: var(--secondary);
    color: var(--primary);
    border-color: var(--secondary);
}

.pagination .active {
    background: var(--secondary);
    color: var(--primary);
    border-color: var(--secondary);
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.4rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-dark);
}

/* ---------- Filter Sidebar ---------- */
.filter-sidebar {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group h4 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    color: var(--text-dark);
}

.filter-group label:hover {
    color: var(--secondary);
}

.filter-group input[type="checkbox"],
.filter-group input[type="radio"] {
    accent-color: var(--secondary);
    width: 16px;
    height: 16px;
}

/* ---------- Loading Spinner ---------- */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Tooltip ---------- */
.tooltip {
    position: relative;
}

.tooltip-text {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--text-light);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.tooltip:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}