/**
 * Main Stylesheet - Drgxel Cloud
 * Mobile-First Design
 */

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #0f172a;
  --dark-light: #1e293b;
  --gray: #64748b;
  --gray-light: #e2e8f0;
  --white: #ffffff;
  --text: #334155;
  --border: #cbd5e1;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--dark);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== CONTAINER ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== HEADER ===== */
.header {
  background: var(--dark-light);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-menu {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-link {
  color: var(--gray-light);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary);
  color: var(--white);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-secondary {
  background: var(--gray);
  color: var(--white);
}

.btn-block {
  width: 100%;
  display: block;
}

/* ===== CARDS ===== */
.card {
  background: var(--dark-light);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  color: var(--gray-light);
}

/* ===== PRODUCT GRID ===== */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 24px;
}

.product-card {
  background: var(--dark-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
  border: 2px solid transparent;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.product-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 20px;
  color: var(--white);
}

.product-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.product-category {
  font-size: 12px;
  opacity: 0.9;
}

.product-body {
  padding: 20px;
}

.product-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.product-features {
  list-style: none;
  margin: 16px 0;
}

.product-features li {
  padding: 8px 0;
  color: var(--gray-light);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-features li::before {
  content: "✓";
  color: var(--success);
  font-weight: 700;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--gray-light);
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--dark);
  color: var(--white);
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

select.form-control {
  cursor: pointer;
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: var(--success);
  color: var(--white);
}

.badge-warning {
  background: var(--warning);
  color: var(--white);
}

.badge-danger {
  background: var(--danger);
  color: var(--white);
}

.badge-primary {
  background: var(--primary);
  color: var(--white);
}

/* ===== TABLES ===== */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 24px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--dark-light);
  border-radius: var(--radius);
  overflow: hidden;
}

.table th,
.table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--dark);
}

.table th {
  background: var(--dark);
  color: var(--white);
  font-weight: 600;
  font-size: 14px;
}

.table td {
  color: var(--gray-light);
  font-size: 14px;
}

.table tr:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* ===== ALERTS ===== */
.alert {
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning);
  color: var(--warning);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .container {
    padding: 0 24px;
  }
}

/* ===== PWA SPECIFIC ===== */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .header {
    padding-top: calc(16px + env(safe-area-inset-top));
  }
}

/* ===== LOADING ===== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--white);
  animation: spin 0.8s linear infinite;
}

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

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-white { color: var(--white); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }