/* ===== CG Community — Global Styles ===== */

/* ===== Custom Fonts ===== */
@font-face {
  font-family: 'VelaSans';
  src: url('/fonts/VelaSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'VelaSans';
  src: url('/fonts/VelaSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'VelaSans';
  src: url('/fonts/VelaSans-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'VelaSans';
  src: url('/fonts/VelaSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Bounded';
  src: url('/fonts/Bounded-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Bounded';
  src: url('/fonts/Bounded-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-primary: #000000;
  --bg-secondary: #121214;
  --bg-card: #1a1a1c;
  --bg-input: #121214;
  --gold: rgb(201, 166, 96);
  --gold-light: rgb(227, 200, 140);
  --gold-dark: rgb(165, 124, 61);
  --gold-1: rgb(189, 154, 89);
  --gold-2: rgb(201, 166, 96);
  --gold-3: rgb(165, 124, 61);
  --gold-4: rgb(227, 200, 140);
  --gold-gradient: linear-gradient(135deg, rgb(165,124,61), rgb(201,166,96), rgb(227,200,140), rgb(201,166,96));
  --white: #ffffff;
  --text-primary: #FFFFFF;
  --text-secondary: #999999;
  --text-muted: #6c6c80;
  --border: rgba(201, 166, 96, 0.2);
  --border-color: rgba(201, 166, 96, 0.2);
  --success: #4caf50;
  --danger: #e74c3c;
  --warning: #f39c12;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'VelaSans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: 'Bounded', sans-serif;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--gold-light);
}

/* ===== Header ===== */
.header {
  background: #121214;
  border-bottom: 1px solid rgba(201, 166, 96, 0.2);
  padding: 0 24px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

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

.logo img {
  height: 72px;
  display: block;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-nav a,
.header-nav button {
  color: var(--text-secondary);
  font-size: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.header-nav a:hover,
.header-nav button:hover {
  color: var(--gold);
}

/* ===== Container ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px;
}

.container-narrow {
  max-width: 520px;
  margin: 0 auto;
  padding: 40px 24px;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.card-header {
  margin-bottom: 24px;
}

.card-header h1,
.card-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

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

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

.form-group label .required {
  color: var(--gold);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid rgba(201, 166, 96, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: rgb(201, 166, 96);
  box-shadow: 0 0 0 3px rgba(201, 166, 96, 0.15);
}

.form-control::placeholder {
  color: var(--text-muted);
}

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

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

.phone-group select {
  width: 140px;
  flex-shrink: 0;
}

.phone-group input {
  flex: 1;
}

/* Checkboxes */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--gold);
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-group label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'VelaSans', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, rgb(165,124,61), rgb(201,166,96), rgb(227,200,140));
  color: #000000;
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgb(201,166,96), rgb(227,200,140), rgb(201,166,96));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201, 166, 96, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgb(201, 166, 96);
  color: rgb(201, 166, 96);
}

.btn-secondary:hover {
  background: rgba(201, 166, 96, 0.1);
}

.btn-success {
  background: var(--success);
  color: white;
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-success:hover {
  background: #43a047;
}

.btn-danger {
  background: var(--danger);
  color: white;
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-full {
  width: 100%;
}

/* ===== Alerts ===== */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.alert-success {
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #81c784;
}

.alert-error {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #ef9a9a;
}

.alert-info {
  background: rgba(201, 166, 96, 0.1);
  border: 1px solid rgba(201, 166, 96, 0.25);
  color: var(--gold-light);
}

/* ===== Success Screen ===== */
.success-screen {
  text-align: center;
  padding: 60px 20px;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 2.5rem;
}

.success-screen h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.success-screen p {
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

/* ===== Badge ===== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending {
  background: rgba(243, 156, 18, 0.15);
  color: var(--warning);
}

.badge-approved {
  background: rgba(76, 175, 80, 0.15);
  color: var(--success);
}

.badge-rejected {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
}

/* ===== Table ===== */
.table-wrapper {
  overflow-x: auto;
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table th {
  text-align: left;
  padding: 12px 16px;
  background: #1a1a1c;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

table td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

table tr:hover td {
  background: rgba(201, 166, 96, 0.05);
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

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

.tab.active {
  color: rgb(201, 166, 96);
  border-bottom-color: rgb(201, 166, 96);
}

.tab-content {
  display: none;
}

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

/* ===== Chat ===== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 500px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.chat-msg {
  max-width: 80%;
}

.chat-msg.own {
  align-self: flex-end;
}

.chat-msg-header {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.chat-msg-header strong {
  color: var(--gold);
  font-weight: 600;
}

.chat-msg-body {
  background: var(--bg-secondary);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg.own .chat-msg-body {
  background: rgba(201, 166, 96, 0.15);
}

.chat-input {
  display: flex;
  gap: 8px;
}

.chat-input input {
  flex: 1;
}

.chat-input .btn {
  flex-shrink: 0;
}

.chat-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-size: 0.9rem;
}

/* ===== Notifications ===== */
.notification-item {
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border-left: 3px solid var(--gold);
}

.notification-item h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.notification-item p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.notification-item .date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.95rem;
}

/* ===== Dashboard Welcome ===== */
.welcome-banner {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
}

.welcome-banner h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.welcome-banner h1 span {
  color: var(--gold);
}

.welcome-banner p {
  color: var(--text-secondary);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal h3 {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.modal .btn-group {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal--scroll {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.modal--scroll .modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 8px;
}

.modal--scroll .modal-footer {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 16px;
}

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

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

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

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ===== Admin Notification Form ===== */
.admin-section {
  margin-top: 32px;
}

.admin-section h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ===== Loader ===== */
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header {
    padding: 0 16px;
  }

  .container,
  .container-narrow,
  .container-wide {
    padding: 24px 16px;
  }

  .card {
    padding: 24px 20px;
  }

  .phone-group {
    flex-direction: column;
  }

  .phone-group select {
    width: 100%;
  }

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

  table {
    font-size: 0.8rem;
  }

  table th,
  table td {
    padding: 8px 10px;
  }

  .actions {
    flex-direction: column;
  }

  .chat-container {
    height: 400px;
  }

  .chat-msg {
    max-width: 90%;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    padding: 10px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.2rem;
  }

  .header-nav a,
  .header-nav button {
    font-size: 0.8rem;
  }

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

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== Page transition ===== */
.page-enter {
  animation: fadeIn 0.4s ease;
}

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