/* ===== CSS VARIABLES / COLOR SCHEME ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #06b6d4;
  --secondary-dark: #0891b2;
  --accent: #ec4899;
  --dark-bg: #0f172a;
  --dark-card: #1e293b;
  --dark-border: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --gradient-1: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --gradient-2: linear-gradient(135deg, #ec4899 0%, #6366f1 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

/* ===== UTILITIES ===== */
.hidden {
  display: none !important;
}

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

/* ===== AUTH PAGE ===== */
#auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-bg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo {
  width: 50px;
  height: 50px;
  margin: 0 auto 20px;
  background: var(--gradient-1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 24px;
  color: white;
  font-family: 'Orbitron', sans-serif;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Form styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.form-group input {
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--dark-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
  color: rgba(203, 213, 225, 0.5);
}

/* Buttons */
.btn {
  padding: 12px 20px;
  background: var(--gradient-1);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.1);
}

.btn-small {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-view {
  background: rgba(99, 102, 241, 0.2);
  color: var(--secondary);
  border: 1px solid var(--secondary);
}

.btn-view:hover {
  background: var(--secondary);
  color: var(--dark-bg);
}

/* Auth footer links */
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  transition: color 0.3s ease;
}

.auth-footer a:hover {
  color: var(--secondary);
}

/* ===== DASHBOARD ===== */
#dashboard-container {
  display: flex;
  min-height: 100vh;
  background: var(--dark-bg);
}

/* Sidebar Navigation */
.dashboard-sidebar {
  width: 250px;
  background: rgba(30, 41, 59, 0.5);
  border-right: 1px solid var(--dark-border);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: white;
  font-family: 'Orbitron', sans-serif;
}

.sidebar-logo-text {
  font-size: 16px;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sidebar user info */
.sidebar-user {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  padding: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--gradient-2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: capitalize;
  margin-bottom: 4px;
}

.user-email {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

/* Sidebar nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  padding: 12px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-align: left;
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.2);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  border-color: var(--primary);
}

.nav-icon {
  margin-right: 10px;
}

/* Sidebar logout */
.sidebar-logout {
  margin-top: auto;
}

#logout-btn {
  width: 100%;
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
  border: 1px solid var(--error);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
}

#logout-btn:hover {
  background: var(--error);
  color: white;
}

/* Main Content Area */
.dashboard-main {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.dashboard-title {
  font-size: 28px;
  font-weight: 700;
}

.dashboard-title-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Tab system */
.tab-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--dark-border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 14px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  position: relative;
  bottom: -1px;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== OVERVIEW TAB ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  transform: translateY(-4px);
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Recent Orders Section */
.recent-orders-section {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 24px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.order-item:last-child {
  border-bottom: none;
}

.order-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.order-id {
  font-weight: 600;
  color: var(--text-primary);
}

.order-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.order-status {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 16px;
  min-width: 100px;
  text-align: center;
}

.order-status.completed {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.order-status.in-progress {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.order-status.pending {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.order-amount {
  font-weight: 600;
  color: var(--secondary);
  min-width: 100px;
  text-align: right;
}

/* ===== ORDERS TAB ===== */
.orders-table {
  width: 100%;
  overflow-x: auto;
}

.orders-table-wrapper {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  overflow: hidden;
}

.order-row {
  display: grid;
  grid-template-columns: 100px 120px 1fr 120px 120px 100px;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
  align-items: center;
  font-size: 14px;
}

.order-row:first-child {
  background: rgba(99, 102, 241, 0.05);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 12px 20px;
}

.order-row:last-child {
  border-bottom: none;
}

.order-id,
.order-date,
.order-items,
.order-amount {
  color: var(--text-primary);
}

/* ===== ACCOUNT TAB ===== */
.account-sections {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.account-section {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 24px;
}

.section-header {
  margin-bottom: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-description {
  font-size: 13px;
  color: var(--text-secondary);
}

.form-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-primary {
  background: var(--gradient-1);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--dark-border);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
  border: 1px solid var(--error);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: auto;
}

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

.delete-account-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.delete-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.delete-warning {
  font-size: 13px;
  color: var(--error);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .dashboard-main {
    padding: 20px;
  }

  .form-two-col {
    grid-template-columns: 1fr;
  }

  .order-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .order-row:first-child {
    display: none;
  }

  .order-row > div::before {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
  }

  .order-id::before {
    content: 'Order ID: ';
  }

  .order-date::before {
    content: 'Date: ';
  }

  .order-items::before {
    content: 'Items: ';
  }

  .order-amount::before {
    content: 'Amount: ';
  }

  .order-status::before {
    content: 'Status: ';
  }
}

@media (max-width: 768px) {
  #dashboard-container {
    flex-direction: column;
  }

  .dashboard-sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid var(--dark-border);
  }

  .sidebar-logo {
    width: 100%;
    order: 1;
  }

  .sidebar-user {
    width: 100%;
    order: 2;
  }

  .sidebar-nav {
    width: 100%;
    order: 3;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-item {
    flex: 1;
    min-width: calc(50% - 4px);
  }

  .sidebar-logout {
    width: 100%;
    margin-top: 0;
    order: 4;
  }

  .dashboard-main {
    padding: 20px;
  }

  .auth-wrapper {
    padding: 30px;
    max-width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-two-col {
    grid-template-columns: 1fr;
  }

  .tab-buttons {
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 20px;
  }

  .tab-btn {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .auth-wrapper {
    padding: 20px;
  }

  .auth-title {
    font-size: 20px;
  }

  .dashboard-title {
    font-size: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 24px;
  }

  .sidebar-nav {
    flex-direction: column;
  }

  .nav-item {
    min-width: auto;
  }

  .order-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .delete-account-section {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .btn-danger {
    width: 100%;
  }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Print styles */
@media print {
  #logout-btn,
  .tab-buttons,
  .delete-account-section {
    display: none;
  }
}
