/* ============================================
   ANSIN PRICE TRACKER - COMPONENTS
   Buttons, Cards, Tables, Forms
   ============================================ */

/* -------------------- BUTTONS -------------------- */

/* Primary Button - Filled */
.regular-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    background: var(--color-primary);
    color: white;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-base);
}

.regular-button:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.regular-button:active {
    transform: translateY(0);
}

/* Outlined Button - Ansin Style */
.button-outlined {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-base);
}

.button-outlined:hover {
    background: var(--color-primary);
    color: white;
}

/* Brand Toggle Button - For selection */
.brand-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.8125rem;
    font-weight: 400;
    cursor: pointer;
    transition: all var(--transition-base);
    user-select: none;
}

.brand-toggle-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-surface-hover);
}

.brand-toggle-btn.selected,
.brand-toggle-btn.active,
.brand-toggle-btn[data-selected="true"] {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.brand-toggle-btn.selected:hover,
.brand-toggle-btn.active:hover,
.brand-toggle-btn[data-selected="true"]:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

/* Ansin Brand Button - Special highlight */
.brand-toggle-btn.brand-ansin {
    border-width: 2px;
}

.brand-toggle-btn.brand-ansin.selected {
    background: var(--color-primary);
    font-weight: 500;
}

/* Disabled Button */
.regular-button-disabled,
.regular-button:disabled {
    background: var(--color-border);
    border-color: var(--color-border);
    color: var(--color-text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Danger Outline Button */
.regular-button-red-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    background: transparent;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-base);
}

.regular-button-red-outline:hover {
    background: var(--color-danger);
    color: white;
}

/* Standard Outline Button */
.regular-button-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-base);
}

.regular-button-outline:hover {
    border-color: var(--color-primary);
    background: var(--color-surface-hover);
}

/* Small Button */
.button-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 0.75rem;
}

/* Collapse Button */
.collapse-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.collapse-button:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-dark);
}

/* -------------------- CARDS -------------------- */

.card, .shadow-sm {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
}

.card-header {
    padding: 1rem 1.25rem;
    background: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-border);
    font-weight: 500;
}

.card-body {
    padding: 1.25rem;
}

/* Brand Selection Card */
.brand-select-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: border-color var(--transition-base);
}

.brand-select-card:hover {
    border-color: var(--color-border-dark);
}

/* -------------------- TABLES -------------------- */

.dash-table-container {
    overflow-x: auto !important;
    width: 100%;
    max-width: 100%;
}

.dash-table-container .dash-spreadsheet-container {
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-xs);
    background: var(--color-surface) !important;
    border: 1px solid var(--color-border) !important;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.dash-table-container .dash-header {
    background: var(--color-surface-alt) !important;
    color: var(--color-text-primary) !important;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--color-border) !important;
}

.dash-table-container .dash-cell {
    color: var(--color-text-primary);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--color-border-light) !important;
    padding: 10px 14px !important;
}

.dash-table-container .dash-row {
    transition: background var(--transition-fast);
}

.dash-table-container .dash-row:hover {
    background: var(--color-surface-hover) !important;
}

.dash-table-container .dash-selected {
    background: var(--color-ansin-bg) !important;
}

.dash-table-container .dash-filter {
    background: var(--color-surface-alt) !important;
}

/* Ansin Row Highlight */
.dash-table-container tr[data-brand="Ansin"],
.dash-table-container .dash-row.ansin-row {
    background: var(--color-ansin-bg) !important;
    font-weight: 500;
}

/* -------------------- FORMS -------------------- */

/* Input */
input[type="text"],
input[type="email"],
input[type="password"],
.form-control {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: var(--color-text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

input::placeholder {
    color: var(--color-text-muted);
}

/* Dropdown */
.Select-control,
.dash-dropdown {
    border-radius: var(--radius-sm) !important;
    border-color: var(--color-border) !important;
}

/* Checkbox styled as toggle */
.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* -------------------- BADGES -------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-xs);
}

.badge-primary {
    background: var(--color-primary);
    color: white;
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

/* -------------------- LOADING -------------------- */

.dash-spinner {
    border-color: var(--color-primary) !important;
    border-top-color: transparent !important;
}
