/**
 * WordPress Media Cleaner
 * thewpclan.com design system
 */

:root {
  --primary: #ff6701;
  --primary-hover: #fea82f;
  --text-dark: #2f3242;
  --text-body: #52576d;
  --bg-light: #fcfcfc;
  --bg-white: #ffffff;
  --border: #efefef;
  --border-dark: #ddd;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --font-heading: 'Jost', sans-serif;
  --font-body: 'Open Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-body);
  background: var(--bg-light);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text-dark);
  font-weight: 600;
}

h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
}

.logo span { color: var(--primary); }

.nav { display: flex; gap: 16px; align-items: center; }
.nav a { color: var(--text-body); font-weight: 500; }
.nav a:hover { color: var(--primary); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  gap: 8px;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); color: var(--text-dark); }
.btn-secondary { background: var(--bg-white); color: var(--text-dark); border: 1px solid var(--border-dark); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--error); color: white; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cards */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text-dark); }
.form-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
}
.form-input:focus { outline: none; border-color: var(--primary); }
.form-hint { font-size: 13px; color: var(--text-body); margin-top: 4px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--text-dark); background: var(--bg-light); }
.table tr:hover td { background: var(--bg-light); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--bg-white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.stat-value { font-family: var(--font-heading); font-size: 28px; font-weight: 700; color: var(--text-dark); }
.stat-label { font-size: 14px; color: var(--text-body); margin-top: 4px; }
.stat-value.primary { color: var(--primary); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }

/* Progress */
.progress { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); transition: width 0.3s; }

/* Badges */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0e7ff; color: #3730a3; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-white);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
}

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

.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

/* Alert */
.alert { padding: 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Empty */
.empty { text-align: center; padding: 48px; color: var(--text-body); }

/* Auth Page */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo { font-size: 32px; text-align: center; display: block; margin-bottom: 24px; }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 14px; }
.text-muted { color: var(--text-body); }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mt-md { margin-top: 16px; }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.hidden { display: none; }

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Page header */
.page-header { margin-bottom: 32px; }
.page-title { margin-bottom: 4px; }
.page-subtitle { color: var(--text-body); }

/* Responsive */
@media (max-width: 768px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .table { font-size: 14px; }
  .table th, .table td { padding: 8px 12px; }
  h1 { font-size: 24px; }
}

/* Toast animations */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}
