/* ==========================================
   MilkMafia — Design System
   Minimal Pro — Noir & Blanc
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ==========================================
   1. Variables
   ========================================== */
:root {
  --bg:           #000000;
  --bg-2:         #0a0a0a;
  --bg-3:         #111111;
  --bg-4:         #1a1a1a;

  --surface:      #141414;
  --surface-2:    #1e1e1e;
  --surface-hover:#222222;

  --border:       #2a2a2a;
  --border-2:     #333333;
  --border-hover: #444444;

  --text-1:       #ffffff;
  --text-2:       #a0a0a0;
  --text-3:       #555555;

  --accent:       #ffffff;
  --accent-dim:   rgba(255,255,255,0.08);
  --accent-mid:   rgba(255,255,255,0.12);

  --danger:       #ff4444;
  --success:      #44cc88;
  --warning:      #ffaa33;

  --font:         'Inter', -apple-system, sans-serif;

  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --radius-full:  9999px;

  --t-fast:       all 0.12s ease;
  --t-base:       all 0.2s ease;
  --t-slow:       all 0.35s ease;

  --sidebar-width: 260px;
}

/* ==========================================
   2. Reset
   ========================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ==========================================
   3. Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: var(--t-base);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--text-1);
  color: var(--bg);
  border-color: var(--text-1);
}
.btn-primary:hover:not(:disabled) {
  background: #e0e0e0;
  border-color: #e0e0e0;
}
.btn-primary:active:not(:disabled) { background: #c8c8c8; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-1);
  border-color: var(--border-2);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(255,68,68,0.3);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(255,68,68,0.08);
}

.btn-success {
  background: transparent;
  color: var(--success);
  border-color: rgba(68,204,136,0.3);
}
.btn-success:hover:not(:disabled) {
  background: rgba(68,204,136,0.08);
}

.btn-icon {
  padding: 5px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-3);
  transition: var(--t-fast);
  font-size: 14px;
  line-height: 1;
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text-1); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; border-radius: var(--radius-lg); }

/* ==========================================
   4. Forms
   ========================================== */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-1);
  font-size: 14px;
  transition: var(--t-fast);
  outline: none;
}
.form-input::placeholder { color: var(--text-3); }
.form-input:focus {
  border-color: var(--border-hover);
  background: var(--surface-2);
}

/* ==========================================
   5. Badges
   ========================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-primary {
  background: rgba(255,255,255,0.06);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.badge-success {
  background: rgba(68,204,136,0.1);
  color: var(--success);
  border: 1px solid rgba(68,204,136,0.2);
}

/* ==========================================
   6. Scrollbar
   ========================================== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ==========================================
   7. Toast
   ========================================== */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-3);
  font-size: 13px;
  font-weight: 500;
  min-width: 260px;
  max-width: 380px;
  pointer-events: auto;
  animation: toast-in 0.2s ease forwards;
}
.toast.success { border-color: rgba(68,204,136,0.3); color: var(--success); }
.toast.error   { border-color: rgba(255,68,68,0.3);  color: #ff6666; }
.toast.info    { border-color: var(--border-2);       color: var(--text-1); }
.toast.warning { border-color: rgba(255,170,51,0.3);  color: var(--warning); }
.toast.out { animation: toast-out 0.2s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

/* ==========================================
   8. Modal
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: var(--t-base);
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 500px;
  transform: translateY(12px);
  transition: var(--t-slow);
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}

/* ==========================================
   9. Upload Zone
   ========================================== */
.upload-zone {
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--t-base);
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--border-hover);
  background: var(--accent-dim);
}
.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone .upload-icon { font-size: 28px; margin-bottom: 10px; opacity: 0.4; }
.upload-zone .upload-text { color: var(--text-2); font-size: 13px; }
.upload-zone .upload-hint { color: var(--text-3); font-size: 12px; margin-top: 6px; }

/* ==========================================
   10. Progress Bar
   ========================================== */
.progress {
  height: 2px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--text-1);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* ==========================================
   11. Skeleton
   ========================================== */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface) 25%,
    var(--surface-2) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================
   12. Upload Progress Widget
   ========================================== */
.upload-progress-list {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 500;
}
.upload-item {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  animation: toast-in 0.2s ease;
}
.upload-item-name { font-size: 12px; font-weight: 500; margin-bottom: 8px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================
   13. Divider / Utils
   ========================================== */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.hidden  { display: none !important; }
.text-muted { color: var(--text-3); }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 11px; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
