/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--color-teal);
    color: #fff;
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
    background: var(--color-teal-dark);
}

.btn-primary:disabled {
    background: var(--color-card-lighter);
    color: var(--color-text-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-coral {
    background: var(--color-coral);
    color: #fff;
    box-shadow: var(--shadow-btn);
}

.btn-coral:hover {
    background: var(--color-coral-dark);
}

.btn-outline {
    background: transparent;
    color: var(--color-teal);
    border: 2px solid var(--color-teal);
}

.btn-outline:hover {
    background: rgba(78, 205, 196, 0.1);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-dim);
    padding: 8px 16px;
}

.btn-ghost:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
}

.btn-full {
    width: 100%;
}

/* Cards */
.card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.card-sm {
    padding: 12px 16px;
}

/* Input fields */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-dim);
}

.input {
    background: var(--color-bg);
    border: 2px solid var(--color-card-lighter);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 16px;
    color: var(--color-text);
    transition: border-color var(--transition-fast);
    outline: none;
}

.input:focus {
    border-color: var(--color-teal);
}

.input::placeholder {
    color: var(--color-text-muted);
}

/* Toggle */
.toggle {
    position: relative;
    width: 48px;
    height: 28px;
    background: var(--color-card-lighter);
    border-radius: 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.toggle.active {
    background: var(--color-teal);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.toggle.active::after {
    transform: translateX(20px);
}

/* Slider */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-value {
    font-weight: 600;
    color: var(--color-teal);
    min-width: 50px;
    text-align: right;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--color-card-lighter);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: var(--color-teal);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Chip / Tag */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    gap: 4px;
}

.chip-teal {
    background: rgba(78, 205, 196, 0.15);
    color: var(--color-teal);
}

.chip-coral {
    background: rgba(240, 84, 79, 0.15);
    color: var(--color-coral);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    background: var(--color-coral);
    color: #fff;
}

/* Modal / Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    animation: fade-in 200ms ease;
}

.modal {
    background: var(--color-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slide-up 300ms ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-up {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Bottom sheet */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1000;
    animation: sheet-up 300ms ease;
}

@keyframes sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fade-in 200ms ease;
}

/* Toast */
.toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    z-index: 2000;
    box-shadow: var(--shadow-card);
    animation: toast-in 300ms ease;
    max-width: 90%;
}

@keyframes toast-in {
    from { transform: translateX(-50%) translateY(-100%); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Rating stars */
.stars {
    color: #FFD700;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Divider */
.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

/* Multi-select button group */
.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-group .btn-option {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-card-lighter);
    background: var(--color-bg);
    color: var(--color-text-dim);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-group .btn-option.selected {
    border-color: var(--color-teal);
    background: rgba(78, 205, 196, 0.15);
    color: var(--color-teal);
}

/* Loading state */
.loading-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.loading-text {
    color: var(--color-text-dim);
    font-size: 14px;
    animation: pulse-text 2s ease infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state .emoji {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Price color helpers */
.price-1 { color: var(--color-price-1); }
.price-2 { color: var(--color-price-2); }
.price-3 { color: var(--color-price-3); }
.price-4 { color: var(--color-price-4); }

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online { background: var(--color-success); }
.status-dot.swiping { background: var(--color-success); animation: pulse-dot 1.5s ease infinite; }
.status-dot.idle { background: var(--color-warning); }
.status-dot.offline { background: var(--color-text-muted); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* Progress bar */
.progress-bar {
    height: 6px;
    background: var(--color-bg);
    border-radius: 3px;
    overflow: hidden;
    flex: 1;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-teal);
    border-radius: 3px;
    transition: width var(--transition-normal);
}
