/* Product Generator - Global Styles */
:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --secondary: #f8f9fa;
  --text: #333;
  --text-light: #666;
  --border: #e0e0e0;
  --success: #34a853;
  --danger: #ea4335;
  --warning: #fbbc04;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text);
  background: #f0f2f5;
  line-height: 1.6;
}

/* Nav */
.nav {
  background: white;
  box-shadow: var(--shadow);
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-right: 30px;
  text-decoration: none;
}
.nav-links { display: flex; gap: 5px; }
.nav-links a {
  text-decoration: none;
  color: var(--text-light);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  background: rgba(26, 115, 232, 0.08);
}

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

/* Card */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card h2 { font-size: 18px; margin-bottom: 15px; color: var(--text); }
.card h3 { font-size: 15px; margin-bottom: 10px; color: var(--text); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Forms */
.form-group { margin-bottom: 15px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 5px;
}
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,115,232,0.15); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { appearance: auto; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* Table */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th { background: var(--secondary); font-weight: 600; color: var(--text-light); font-size: 12px; text-transform: uppercase; }
tr:hover td { background: rgba(26,115,232,0.03); }

/* Tags */
.tag {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(26,115,232,0.1);
  color: var(--primary);
  border-radius: 12px;
  font-size: 12px;
  margin-right: 4px;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: rgba(52,168,83,0.1); color: var(--success); }
.badge-warning { background: rgba(251,188,4,0.15); color: #e37400; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 25px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-light); }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 15px;
  font-size: 14px;
}
.alert-success { background: rgba(52,168,83,0.1); color: var(--success); border: 1px solid rgba(52,168,83,0.2); }
.alert-error { background: rgba(234,67,53,0.1); color: var(--danger); border: 1px solid rgba(234,67,53,0.2); }
.alert-info { background: rgba(26,115,232,0.08); color: var(--primary); border: 1px solid rgba(26,115,232,0.15); }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(26,115,232,0.05);
}
.upload-zone p { color: var(--text-light); margin-top: 10px; }

/* Image grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
}
.image-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.image-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}
.image-card .info { padding: 10px; font-size: 12px; }

/* Loading */
.loading { display: flex; justify-content: center; padding: 40px; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state svg { width: 80px; height: 80px; margin-bottom: 15px; opacity: 0.4; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-card .number { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 13px; color: var(--text-light); margin-top: 5px; }

/* Responsive */
@media (max-width: 600px) {
  .nav { flex-direction: column; height: auto; padding: 10px; }
  .nav-links { flex-wrap: wrap; }
  .container { padding: 15px; }
}
