/* ============================================
   COMPONENTS - Buttons, Cards, Forms, Badges
   ============================================ */

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn:hover::before { opacity: 1; }

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}
.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--surface-3);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}
.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: #dc2626; transform: translateY(-2px); }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #16a34a; transform: translateY(-2px); }

.btn-sm { padding: 8px 16px; font-size: var(--font-size-xs); border-radius: var(--radius-md); }
.btn-lg { padding: 16px 32px; font-size: var(--font-size-md); border-radius: var(--radius-xl); }
.btn-xl { padding: 18px 40px; font-size: var(--font-size-lg); border-radius: var(--radius-xl); }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-md); }
.btn-icon.btn-sm { width: 32px; height: 32px; }

.btn-glow {
    background: var(--accent-gradient);
    color: white;
    position: relative;
}
.btn-glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--accent-gradient);
    border-radius: inherit;
    z-index: -1;
    filter: blur(15px);
    opacity: 0.5;
    transition: opacity var(--transition-base);
}
.btn-glow:hover::after { opacity: 0.8; }
.btn-glow:hover { transform: translateY(-2px); }

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card:hover::before { opacity: 1; }

.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Complaint Card */
.complaint-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.complaint-card .card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.complaint-card .brand-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.complaint-card .card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
}

.complaint-card .card-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

.complaint-card .card-title a {
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.complaint-card .card-title a:hover { color: var(--accent-primary); }

.complaint-card .card-excerpt {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.complaint-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-secondary);
}

.card-stats {
    display: flex;
    gap: var(--space-md);
}

.card-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.card-stat svg { width: 16px; height: 16px; }
.card-stat:hover { color: var(--accent-primary); }

/* Brand Card */
.brand-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.brand-card .brand-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-primary);
}

.brand-card .brand-info { flex: 1; min-width: 0; }
.brand-card .brand-name { font-weight: 600; font-size: var(--font-size-md); margin-bottom: 4px; }
.brand-card .brand-name a:hover { color: var(--accent-primary); }
.brand-card .brand-category { font-size: var(--font-size-xs); color: var(--text-tertiary); }

.brand-card .brand-score {
    text-align: right;
    flex-shrink: 0;
}

.brand-card .score-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
}

.score-good { color: var(--success); }
.score-medium { color: var(--warning); }
.score-bad { color: var(--danger); }

/* Stat Card */
.stat-card {
    text-align: center;
    padding: var(--space-xl);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    border-radius: var(--radius-lg);
    background: rgba(99, 102, 241, 0.1);
    font-size: 24px;
}

.stat-card .stat-number {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    white-space: nowrap;
}

.badge[style] {
    background: color-mix(in srgb, var(--badge-color) 15%, transparent);
    border-color: color-mix(in srgb, var(--badge-color) 30%, transparent);
    color: var(--badge-color);
}

.badge-type { border-radius: var(--radius-md); }

.badge-verified {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.badge-premium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(236, 72, 153, 0.15));
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.badge-sm { padding: 2px 8px; font-size: 10px; }
.badge-lg { padding: 6px 16px; font-size: var(--font-size-sm); }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: var(--space-lg); }

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-secondary);
    background: white;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all var(--transition-base);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: white;
}

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

.form-control.error { border-color: var(--danger); }

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-hint {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-top: 6px;
}

.form-error {
    font-size: var(--font-size-xs);
    color: var(--danger);
    margin-top: 6px;
}

/* Checkbox / Radio */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-primary);
    background: var(--bg-glass);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

/* File upload zone */
.upload-zone {
    border: 2px dashed var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-glass);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-zone .upload-icon { font-size: 40px; margin-bottom: var(--space-md); }
.upload-zone p { color: var(--text-secondary); font-size: var(--font-size-sm); }

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-secondary);
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-link {
    padding: 12px 20px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-tertiary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-family);
}

.tab-link:hover { color: var(--text-primary); }
.tab-link.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content { display: none; padding-top: var(--space-lg); }
.tab-content.active { display: block; }

/* ============================================
   MODAL
   ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-backdrop.active { opacity: 1; visibility: visible; }

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: var(--z-modal);
    background: white;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-xl);
}

.modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-secondary);
}

.modal-header h3 { font-size: var(--font-size-lg); }
.modal-body { padding: var(--space-lg); }
.modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-secondary);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: white;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    padding: 6px;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all var(--transition-base);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-secondary);
    margin: 4px 8px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    padding: var(--space-xl) 0;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-item { list-style: none; }

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: white;
    border: 1px solid var(--border-secondary);
    transition: all var(--transition-base);
    cursor: pointer;
}

.page-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.page-item.active .page-link {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.page-item.page-dots .page-link {
    border: none;
    background: none;
    cursor: default;
    color: var(--text-muted);
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
    padding: var(--space-md) 0;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.breadcrumb-item {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

.breadcrumb-item a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover { color: var(--accent-primary); }

.breadcrumb-separator {
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: var(--space-md);
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background: #ecfeff;
    border: 1px solid #a5f3fc;
    color: #155e75;
}

/* ============================================
   TABLES (Admin)
   ============================================ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-primary); }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-secondary);
    font-size: var(--font-size-sm);
}

.data-table th {
    background: var(--surface-1);
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: var(--font-size-xs);
    white-space: nowrap;
}

.data-table td { color: var(--text-secondary); }

.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: rgba(99, 102, 241, 0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
}

.empty-state .empty-icon { font-size: 64px; margin-bottom: var(--space-lg); }
.empty-state h3 { font-size: var(--font-size-xl); margin-bottom: var(--space-sm); }
.empty-state p { color: var(--text-secondary); margin-bottom: var(--space-lg); font-size: var(--font-size-sm); }
