/* ============================================
   Glitz HQ — Component Styles
   ============================================ */

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--font-family); font-weight: 600; font-size: 13px; padding: 8px 16px; border-radius: var(--radius-pill); transition: var(--transition-fast); cursor: pointer; white-space: nowrap; border: none; position: relative; overflow: hidden; }

.btn-primary { background: var(--gradient-primary); color: #fff; }
.btn-primary::before { content:''; position:absolute; inset:0; background:linear-gradient(135deg,rgba(255,255,255,0.15) 0%,transparent 100%); opacity:0; transition:opacity 0.2s; }
.btn-primary:hover::before { opacity:1; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(255,45,120,0.45); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary { background: var(--glass-bg); color: var(--text-primary); border: 1px solid var(--border-light); }
.btn-secondary:hover { background: var(--glass-bg-hover); border-color: var(--pink-border); }

.btn-ghost { background: transparent; color: var(--text-muted); padding: 6px 12px; }
.btn-ghost:hover { background: var(--glass-bg); color: var(--text-primary); }

.btn-outline { background: transparent; color: var(--pink); border: 1px solid var(--pink-border); }
.btn-outline:hover { background: var(--pink-dim); border-color: var(--pink); }

.btn-danger { background: rgba(255,107,107,0.12); color: var(--red); border: 1px solid rgba(255,107,107,0.2); }
.btn-danger:hover { background: rgba(255,107,107,0.2); border-color: rgba(255,107,107,0.4); }

.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-dim); background: transparent; transition: var(--transition-fast); }
.btn-icon:hover { background: var(--glass-bg); color: var(--text-primary); }

.btn-sm { font-size: 12px; padding: 5px 12px; }
.btn-lg { font-size: 14px; padding: 12px 24px; }

.btn.loading { pointer-events: none; opacity: 0.7; }
.btn.loading::after { content: ''; width: 14px; height: 14px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin 0.6s linear infinite; margin-left: 6px; }

/* ── Inputs ── */
.input { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid var(--border-light); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; padding: 10px 14px; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input:focus { border-color: var(--pink); box-shadow: var(--shadow-focus); }
.input::placeholder { color: var(--text-dim); }

.input-sm { font-size: 12px; padding: 6px 10px; }
.input-inline { background: transparent; border: 1px solid transparent; padding: 4px 8px; border-radius: var(--radius-xs); }
.input-inline:hover { border-color: var(--border); }
.input-inline:focus { background: rgba(255,255,255,0.05); border-color: var(--pink); }

textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }

.label { display: block; font-size: 11px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 12px; align-items: flex-start; }
.form-row > * { flex: 1; }

/* ── Input Group (icon-prefixed) ── */
.input-group { position: relative; }
.input-group .input { padding-left: 38px; }
.input-group .input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; display: flex; }

/* ── Select/Dropdown ── */
.select { appearance: none; background: rgba(255,255,255,0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; border: 1px solid var(--border-light); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; padding: 8px 32px 8px 12px; cursor: pointer; transition: border-color 0.2s ease, box-shadow 0.2s ease; color-scheme: dark; }
.select:focus { border-color: var(--pink); box-shadow: var(--shadow-focus); }
.select option { background: var(--surface-2); color: var(--text-primary); }

/* ── Glass Panels ── */
.glass { background: var(--glass-bg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); }
.glass-sm { background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4); transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.card:hover { border-color: var(--pink-border); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); }

/* ── Stat Card ── */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; position: relative; overflow: hidden; transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--gradient-primary); opacity: 0; transition: opacity 0.25s ease; }
.stat-card:hover { border-color: var(--pink-border); box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.stat-card:hover::before { opacity: 1; }
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card .stat-value { font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -1px; margin-top: 12px; }
.stat-card .stat-label { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-top: 4px; }
.stat-card .stat-trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; margin-top: 8px; padding: 2px 8px; border-radius: var(--radius-pill); }
.stat-card .stat-trend.up { color: var(--green); background: rgba(0,212,120,0.1); }
.stat-card .stat-trend.down { color: var(--red); background: rgba(255,107,107,0.1); }
.stat-card .stat-sparkline { position: absolute; bottom: 0; right: 0; width: 120px; height: 48px; opacity: 0.6; }

/* ── Gradient Border Card ── */
.card-gradient { position: relative; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.card-gradient::before { content: ''; position: absolute; inset: 0; border-radius: var(--radius); padding: 1px; background: var(--gradient-card-border); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }

.badge-priority-urgent { background: rgba(255,77,77,0.12); color: var(--priority-urgent); border: 1px solid rgba(255,77,77,0.25); }
.badge-priority-high { background: rgba(255,140,0,0.12); color: var(--priority-high); border: 1px solid rgba(255,140,0,0.25); }
.badge-priority-normal { background: rgba(255,183,0,0.12); color: var(--priority-normal); border: 1px solid rgba(255,183,0,0.25); }
.badge-priority-low { background: rgba(0,212,120,0.12); color: var(--priority-low); border: 1px solid rgba(0,212,120,0.25); }
.badge-priority-none { background: rgba(119,119,119,0.12); color: var(--priority-none); border: 1px solid rgba(119,119,119,0.25); }

.badge-status { padding: 3px 10px; font-size: 11px; border-radius: var(--radius-pill); }

/* ── Tag Chips ── */
.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 500; }
.tag-chip .tag-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* ── Chip (filter/removable) ── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--glass-bg); border: 1px solid var(--border-light); font-size: 12px; font-weight: 500; color: var(--text-secondary); transition: var(--transition-fast); }
.chip:hover { border-color: var(--pink-border); background: var(--glass-bg-hover); }
.chip .chip-remove { display: flex; align-items: center; cursor: pointer; color: var(--text-dim); transition: color 0.15s; }
.chip .chip-remove:hover { color: var(--red); }
.chip.active { background: var(--pink-dim); border-color: var(--pink-border); color: var(--pink); }

/* ── Tabs ── */
.tabs { display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,0.03); border-radius: var(--radius-sm); padding: 3px; }
.tab { display: flex; align-items: center; gap: 5px; padding: 6px 14px; border-radius: var(--radius-xs); font-size: 12px; font-weight: 500; color: var(--text-dim); cursor: pointer; transition: all 0.2s ease; white-space: nowrap; border: none; background: none; }
.tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.tab.active { color: var(--pink); background: var(--pink-dim); font-weight: 600; }

/* ── Avatars ── */
.avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; background: var(--gradient-avatar); }
.avatar-sm { width: 22px; height: 22px; font-size: 9px; }
.avatar-lg { width: 36px; height: 36px; font-size: 14px; }
.avatar-xl { width: 48px; height: 48px; font-size: 18px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ── Dropdown ── */
.dropdown { position: absolute; z-index: 100; min-width: 180px; background: var(--surface-2); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 4px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity 0.12s ease, transform 0.12s ease; }
.dropdown.open { opacity: 1; transform: translateY(0); pointer-events: all; }

.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-xs); font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: var(--transition-fast); }
.dropdown-item:hover { background: var(--glass-bg); color: var(--text-primary); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: rgba(255,107,107,0.08); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.15s ease; }
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-xl); width: 90%; max-width: 520px; max-height: 85vh; overflow: auto; transform: scale(0.95); transition: transform 0.2s var(--ease-out-expo); box-shadow: var(--shadow-lg); }
.modal-overlay.open .modal { transform: scale(1); }

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 16px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 20px; }

/* ── Tooltip ── */
.tooltip { position: relative; }
.tooltip::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border-light); border-radius: var(--radius-xs); padding: 4px 10px; font-size: 11px; color: var(--text-muted); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 200; }
.tooltip:hover::after { opacity: 1; }

/* ── Checkbox ── */
.checkbox { width: 16px; height: 16px; border: 1.5px solid var(--border-strong); border-radius: 4px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition-fast); flex-shrink: 0; }
.checkbox:hover { border-color: var(--pink); }
.checkbox.checked { background: var(--pink); border-color: var(--pink); }
.checkbox.checked svg { stroke: #fff; }

/* ── Color Dot ── */
.color-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Text Gradient ── */
.text-gradient { background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ── Skeleton Loading ── */
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 100%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }

/* ── Empty State ── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; }
.empty-state-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--glass-bg); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--text-dim); }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--text-dim); max-width: 300px; }

/* ── Notification Badge ── */
.notif-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; border-radius: 50%; background: var(--pink); color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; animation: pulse-badge 2s ease-in-out infinite; }

/* ── Progress Bar ── */
.progress-bar { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 2px; background: var(--gradient-primary); transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }

/* ── Data Table ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02); position: sticky; top: 0; z-index: 1; }
.data-table tbody td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 13px; }
.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table.striped tbody tr:nth-child(even) { background: rgba(255,255,255,0.015); }

/* ── Page Header ── */
.page-header { padding: var(--page-padding) var(--page-padding) 16px; }
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; }
.page-subtitle { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }

/* ── Confirm Modal ── */
.confirm-modal .modal { max-width: 400px; }
.confirm-modal .modal-body { text-align: center; padding: 24px; }
.confirm-modal .modal-body h3 { font-size: 18px; margin-bottom: 8px; }
.confirm-modal .modal-body p { color: var(--text-dim); font-size: 14px; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast { background: var(--surface-2); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 14px 18px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); max-width: 360px; animation: toastIn 0.3s var(--ease-out-expo); display: flex; align-items: center; gap: 10px; position: relative; overflow: hidden; }
.toast.dismiss { animation: toastOut 0.3s ease forwards; }
.toast .toast-icon { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.toast .toast-progress { position: absolute; bottom: 0; left: 0; height: 2px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); animation: toastProgress 3s linear forwards; }
.toast.success .toast-progress { background: var(--green); }
.toast.error .toast-progress { background: var(--red); }
.toast.warning .toast-progress { background: var(--gold); }
.toast.info .toast-progress { background: var(--pink); }

/* ── Priority Chip ── */
.priority-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 600; text-transform: capitalize; }
.priority-chip.priority-urgent { background: rgba(255,77,77,0.12); color: var(--priority-urgent); }
.priority-chip.priority-high { background: rgba(255,140,0,0.12); color: var(--priority-high); }
.priority-chip.priority-normal { background: rgba(255,183,0,0.12); color: var(--priority-normal); }
.priority-chip.priority-low { background: rgba(0,212,120,0.12); color: var(--priority-low); }
.priority-chip.priority-none { background: rgba(119,119,119,0.12); color: var(--priority-none); }

/* ── Team Grid ── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding: 0 var(--page-padding) var(--page-padding); }

/* ══════════════════════════════════════════
   MOBILE RESPONSIVE — Components
   ══════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Modals: bottom-sheet style ── */
    .modal-overlay { align-items: flex-end; }
    .modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        animation: slideUpModal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .modal-header { padding: 16px 16px 0; }
    .modal-header h3 { font-size: 15px; }
    .modal-body { padding: 12px 16px; }
    .modal-footer { padding: 12px 16px 20px; }

    /* Modal pull indicator for bottom-sheet feel */
    .modal::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
        margin: 8px auto 4px;
    }

    /* ── Buttons: larger touch targets ── */
    .btn { min-height: 40px; padding: 10px 16px; font-size: 13px; }
    .btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12px; }
    .btn-icon { width: 36px; height: 36px; }
    .btn-icon svg { width: 18px !important; height: 18px !important; }

    /* ── Inputs: larger ── */
    .input { padding: 12px 14px; font-size: 14px; }
    .input-sm { padding: 8px 12px; font-size: 13px; }
    textarea.input { min-height: 60px; }

    /* ── Select: larger ── */
    .select { padding: 10px 32px 10px 12px; font-size: 14px; }

    /* ── Cards ── */
    .card { padding: var(--space-3); border-radius: var(--radius-sm); }
    .stat-card { padding: 14px 16px; }
    .stat-card .stat-value { font-size: 24px; margin-top: 8px; }
    .stat-card .stat-icon { width: 36px; height: 36px; }

    /* ── Dropdown: full-width on mobile ── */
    .dropdown {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        width: auto !important;
        max-height: 50vh;
        border-radius: var(--radius-lg);
        padding: 8px;
    }
    .dropdown-item { padding: 12px 14px; font-size: 14px; }

    /* ── Toast: bottom-center, wider ── */
    .toast-container {
        left: 8px;
        right: 8px;
        bottom: 16px;
    }
    .toast { max-width: 100%; font-size: 13px; }

    /* ── Notification dropdown ── */
    #notif-dropdown {
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-height: 60vh;
        border-radius: var(--radius-lg) !important;
    }

    /* ── Team Grid ── */
    .team-grid { grid-template-columns: 1fr; gap: 10px; padding: 0 var(--page-padding) var(--page-padding); }

    /* ── Empty State ── */
    .empty-state { padding: 32px 16px; }
    .empty-state-icon { width: 48px; height: 48px; }

    /* ── Page Header ── */
    .page-header { padding: var(--page-padding) var(--page-padding) 12px; }
    .page-title { font-size: 20px; }
    .page-actions { flex-wrap: wrap; }

    /* ── Data Table ── */
    .data-table { font-size: 12px; }
    .data-table thead th { padding: 8px 10px; font-size: 10px; }
    .data-table tbody td { padding: 8px 10px; }

    /* ── Progress Bar ── */
    .progress-bar { height: 6px; }

    /* ── Form Layout ── */
    .form-row { flex-direction: column; gap: 0; }
}

/* ── Modal slide-up animation ── */
@keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
