﻿/**
 * FluxGood - Common CSS (Desktop)
 * Dark theme + Orange accent
 */

:root {
  --primary: #f97316;
  --primary-hover: #ea580c;
  --primary-light: rgba(249,115,22,0.12);
  --bg: #0f1117;
  --bg-page: #0a0c10;
  --bg-card: #161b24;
  --bg-input: #1e2530;
  --text: #e8eaf0;
  --text-secondary: #9aa0b0;
  --text-muted: #5c6370;
  --border: #252c38;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

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

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

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 16px; }
.gap-2 { gap: 8px; }

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(249,115,22,0.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249,115,22,0.4);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Inputs */
.input, textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
textarea { resize: vertical; min-height: 100px; }

/* Select */
select {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  outline: none;
}
select:focus { border-color: var(--primary); }

/* Image display */
.image-preview {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-input);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.image-preview img {
  max-width: 100%;
  max-height: 600px;
  object-fit: contain;
}

/* Loading */
.loading { position: relative; pointer-events: none; opacity: 0.7; }

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 9999;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow-lg);
}
.toast-info { background: var(--primary); color: #fff; }
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--error); color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } }

/* Header */
.header {
  padding: 16px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}
.header nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 5px;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  padding: 6px 12px;
  border-radius: 6px;
}
.header nav a:hover { color: var(--primary); background: var(--primary-light); }
.header nav a.active { color: var(--primary); background: var(--primary-light); }

/* Utility */
.hidden { display: none !important; }
.placeholder-text { color: var(--text-muted); font-size: 14px; }

/* Nav layout */
.nav-center a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 12px;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.nav-center a:hover, .nav-center a.active { color: var(--primary); background: var(--primary-light); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang-select {
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}
.btn-login-nav {
  padding: 7px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-login-nav:hover { background: var(--primary-hover); }


/* ===== Login Modal ===== */
.login-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
  backdrop-filter: blur(4px);
}
.login-modal {
  background: var(--bg-card); border-radius: 20px; padding: 40px 36px;
  width: 420px; max-width: 90vw; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-close {
  position: absolute; top: 16px; right: 18px;
  background: none; border: none; font-size: 20px; color: var(--text-muted);
  cursor: pointer;
}
.login-tabs {
  display: flex; gap: 0; margin-bottom: 28px;
  border-bottom: 2px solid var(--border);
}
.login-tab {
  flex: 1; padding: 12px; text-align: center;
  background: none; border: none; font-size: 15px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s;
}
.login-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-field input {
  width: 100%; padding: 14px 16px; background: var(--bg-input);
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; color: var(--text); outline: none;
}
.login-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,0.1); }

.login-code-row { display: flex; gap: 10px; }
.login-code-row input { flex: 1; }
.login-send-code {
  padding: 10px 14px; background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--primary);
  cursor: pointer; white-space: nowrap;
}
.login-send-code:hover { border-color: var(--primary); }
.login-send-code:disabled { opacity: 0.5; cursor: not-allowed; }

.login-submit {
  width: 100%; padding: 14px; background: var(--primary); color: #fff;
  border: none; border-radius: 10px; font-size: 15px; font-weight: 600;
  cursor: pointer; box-shadow: 0 2px 8px rgba(249,115,22,0.3);
  transition: background 0.2s; margin-top: 4px;
}
.login-submit:hover { background: var(--primary-hover); }

.login-divider {
  text-align: center; position: relative; margin: 8px 0;
}
.login-divider::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--border);
}
.login-divider span {
  background: var(--bg-card); padding: 0 12px; font-size: 12px; color: var(--text-muted);
  position: relative;
}

.login-google {
  width: 100%; padding: 13px; background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--text);
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-google:hover { border-color: #4285F4; box-shadow: 0 2px 8px rgba(66,133,244,0.15); }

.login-error {
  color: var(--error); font-size: 13px; text-align: center; margin-top: 12px; min-height: 18px;
}

/* ── Nav Dropdown ──────────────────────────────────────────────────────────── */
.nav-dropdown {
  position: relative;
  display: inline-block;
}
.nav-dropdown > a {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-dropdown > a::after {
  content: '▾';
  font-size: 10px;
  opacity: 0.6;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-card, #161b24);
  border: 1px solid var(--border, #252c38);
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-secondary, #9aa0b0);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  margin: 0 !important;
  background: none !important;
  border-left: none !important;
}
.nav-dropdown-menu a:hover {
  background: var(--bg-input, #1e2530) !important;
  color: var(--primary, #f97316) !important;
}
.nav-dropdown-menu .drop-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* ── Nav HOT badge ─────────────────────────────────────────────────────────── */
.nav-hot {
  position: relative;
  color: #f97316 !important;
  font-weight: 700 !important;
}
.nav-hot::before {
  content: '🔥';
  margin-right: 4px;
  font-size: 13px;
}
.nav-hot .hot-badge {
  display: none;
}

/* ── Logo link: force white text, point to home ───────────────────────────── */
.header h1 a {
  color: #fff !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 25px;
  font-weight: 800;
}
.header h1 a:hover { color: #fff !important; }

/* Nav links wider padding */
.nav-center a,
.nav-center .nav-dropdown > a {
  padding: 10px 25px;
}

/* ── Login modal inputs: force dark bg + white text ──────────────────────── */
#loginModal input,
#loginModal textarea {
  background: var(--bg-input, #1e2530) !important;
  color: var(--text, #e8eaf0) !important;
  border-color: var(--border, #252c38) !important;
}
#loginModal input::placeholder {
  color: var(--text-muted, #5c6370) !important;
}
