/* ==========================================
   COMPONENTS.CSS — Buttons, Cards, Badges
   ========================================== */

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border: none; border-radius: var(--radius);
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    transition: var(--transition); position: relative; overflow: hidden;
}
.btn::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    opacity: 0; transition: var(--transition);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 15px rgba(99,102,241,0.4); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--warning); color: var(--text-dark); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-surface-2); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Badges --- */
.badge {
    display: inline-flex; align-items: center; padding: 3px 10px;
    border-radius: 50px; font-size: 0.75rem; font-weight: 600;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--accent-light); color: var(--accent); }

/* --- Tags --- */
.tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: var(--radius-sm);
    background: var(--bg-surface-2); color: var(--text-secondary);
    font-size: 0.8rem; border: 1px solid var(--border-light);
}

/* --- Cards --- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
}
.card:hover { border-color: rgba(196,30,47,0.2); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 1rem; font-weight: 600; }

/* --- Tabs --- */
.tabs { display: flex; gap: 4px; background: var(--bg-surface-2); padding: 4px; border-radius: var(--radius); margin-bottom: 20px; overflow-x: auto; }
.tab-btn {
    padding: 8px 16px; border: none; background: transparent;
    color: var(--text-muted); border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500; cursor: pointer;
    transition: var(--transition); white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--primary); color: white; }

/* --- Dropdown --- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute; top: 100%; right: 0; min-width: 180px;
    background: var(--bg-surface-2); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 6px; z-index: 200; display: none;
}
.dropdown-menu.show { display: block; animation: fadeInDown 0.2s ease; }
.dropdown-item {
    display: block; padding: 8px 14px; color: var(--text-secondary);
    border-radius: var(--radius-sm); font-size: 0.85rem;
    transition: var(--transition-fast); cursor: pointer;
    background: none; border: none; width: 100%; text-align: left;
}
.dropdown-item:hover { background: var(--primary-light); color: var(--text); }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Stat Value Animation --- */
.stat-value { animation: countUp 0.6s ease-out; }

/* --- Tooltip --- */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute; bottom: 100%; left: 50%;
    transform: translateX(-50%); padding: 6px 10px;
    background: var(--bg-surface-3); color: var(--text);
    font-size: 0.75rem; border-radius: var(--radius-sm);
    white-space: nowrap; z-index: 300;
    animation: fadeIn 0.2s ease;
}

/* --- Divider --- */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* --- Status Dot --- */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.active { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.inactive { background: var(--text-muted); }
.status-dot.danger { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
