/* Proton Egypt — Global Styles */
:root {
  --primary: #1a73e8;
  --primary-dark: #1558b0;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;
  --frozen: #17a2b8;
  --dark: #1e1e2f;
  --darker: #16162a;
  --card-bg: #2a2a40;
  --card-border: #3a3a55;
  --text: #e0e0e0;
  --text-muted: #999;
  --text-light: #fff;
  --bg: #121220;
  --input-bg: #2a2a40;
  --input-border: #3a3a55;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

[data-theme="light"] {
  --dark: #f5f5f5;
  --darker: #eee;
  --card-bg: #fff;
  --card-border: #ddd;
  --text: #333;
  --text-muted: #666;
  --text-light: #333;
  --bg: #f0f2f5;
  --input-bg: #fff;
  --input-border: #ccc;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--darker); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

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

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

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

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

.card-header h2 {
  font-size: 1.2rem;
  color: var(--text-light);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
  color: #fff;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); }
.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }
.btn-warning { background: var(--warning); color: #333; }
.btn-info { background: var(--info); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text);
}
.btn-outline:hover { background: var(--card-border); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

textarea { resize: vertical; min-height: 80px; }

.phone-input-wrapper {
  display: flex;
  gap: 8px;
  direction: ltr;
}

.country-code-select {
  width: 120px;
  flex-shrink: 0;
}

.phone-number-input {
  flex: 1;
  direction: ltr;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

[dir="ltr"] th, [dir="ltr"] td {
  text-align: left;
}

th {
  background: var(--darker);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover td {
  background: rgba(26, 115, 232, 0.05);
}

td input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success { background: rgba(40, 167, 69, 0.2); color: var(--success); }
.badge-warning { background: rgba(255, 193, 7, 0.2); color: var(--warning); }
.badge-danger { background: rgba(220, 53, 69, 0.2); color: var(--danger); }
.badge-info { background: rgba(23, 162, 184, 0.2); color: var(--info); }
.badge-primary { background: rgba(26, 115, 232, 0.2); color: var(--primary); }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  width: auto;
  padding: 0;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--card-border);
  overflow-x: auto;
}

.tab {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
  width: auto;
}

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

.tab:hover { color: var(--text-light); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Nav sidebar */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--darker);
  border-left: 1px solid var(--card-border);
  padding: 20px 0;
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

[dir="ltr"] .sidebar {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--card-border);
}

.sidebar-header {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 12px;
}

.sidebar-header h3 {
  font-size: 16px;
  color: var(--text-light);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: right;
  font-size: 14px;
}

[dir="ltr"] .nav-item { text-align: left; }

.nav-item:hover { background: var(--card-bg); color: var(--text-light); }
.nav-item.active { background: var(--primary); color: #fff; border-radius: 0; }

.nav-badge {
  background: var(--danger);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-right: auto;
}

[dir="ltr"] .nav-badge { margin-right: 0; margin-left: auto; }

.main-content {
  flex: 1;
  margin-right: 260px;
  padding: 24px;
}

[dir="ltr"] .main-content {
  margin-right: 0;
  margin-left: 260px;
}

/* Home button */
.home-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 999;
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  min-width: 280px;
  box-shadow: var(--shadow);
  animation: slideDown 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success { border-right: 4px solid var(--success); }
.toast-error { border-right: 4px solid var(--danger); }
.toast-info { border-right: 4px solid var(--info); }

[dir="ltr"] .toast-success { border-right: none; border-left: 4px solid var(--success); }
[dir="ltr"] .toast-error { border-right: none; border-left: 4px solid var(--danger); }
[dir="ltr"] .toast-info { border-right: none; border-left: 4px solid var(--info); }

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

/* Pagination */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 20px;
  align-items: center;
}

.pagination button {
  width: auto;
  padding: 8px 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}

.pagination button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Rating stars */
.stars {
  display: flex;
  gap: 4px;
  direction: ltr;
}

.star {
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
  background: none;
  border: none;
  padding: 0;
  width: auto;
}

.star.active { color: #ffc107; }
.star:hover { color: #ffc107; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    width: 100%;
    height: auto;
    bottom: 0;
    top: auto;
    right: 0;
    display: flex;
    overflow-x: auto;
    padding: 0;
    border-top: 1px solid var(--card-border);
    border-left: none;
  }

  .sidebar-header { display: none; }

  .nav-item {
    flex-direction: column;
    padding: 8px 12px;
    font-size: 11px;
    gap: 4px;
    min-width: 70px;
    text-align: center;
  }

  .main-content {
    margin-right: 0;
    margin-left: 0;
    padding-bottom: 70px;
  }

  [dir="ltr"] .main-content {
    margin-left: 0;
  }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .home-btn { bottom: 70px; }
}

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--card-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

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

/* Login screen */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin-bottom: 8px;
  color: var(--text-light);
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Settings panel */
.settings-overlay {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  background: var(--card-bg);
  border-left: 1px solid var(--card-border);
  z-index: 1001;
  padding: 24px;
  box-shadow: var(--shadow);
}

[dir="ltr"] .settings-overlay {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--card-border);
}

.settings-overlay.active { display: block; }

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* Logo */
.logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 16px;
  object-fit: cover;
}

/* Offer card */
.offer-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.offer-card .offer-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
}

.offer-card .offer-discount {
  color: var(--success);
  font-weight: 700;
  font-size: 1.2rem;
}

.offer-card .offer-meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
}

.offer-card .offer-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}
