/* Arvik Media - Main Stylesheet */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-50);
}

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-page .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1200px;
  width: 100%;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.login-left {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 3rem;
}

.benefit-item {
  margin-bottom: 2rem;
}

.benefit-item .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.benefit-item h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.benefit-item p {
  opacity: 0.9;
}

.social-proof {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat h4 {
  font-size: 1.875rem;
  margin-bottom: 0.25rem;
}

.stat p {
  opacity: 0.8;
  font-size: 0.875rem;
}

.login-right {
  padding: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-container {
  width: 100%;
  max-width: 400px;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form h2 {
  font-size: 1.875rem;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.subtitle {
  color: var(--gray-700);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.link {
  color: var(--primary);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-block {
  width: 100%;
}

.form-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--gray-700);
}

.form-footer a {
  color: var(--primary);
  font-weight: 500;
}

.password-strength {
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.password-strength.weak::after {
  content: '';
  display: block;
  width: 33%;
  height: 100%;
  background: var(--error);
}

.password-strength.medium::after {
  content: '';
  display: block;
  width: 66%;
  height: 100%;
  background: var(--warning);
}

.password-strength.strong::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: var(--success);
}

/* Responsive */
@media (max-width: 768px) {
  .login-page .container {
    grid-template-columns: 1fr;
  }

  .login-left {
    display: none;
  }
}

/* ── Dark / Light Mode Toggle Button ────────────────────────────────────────*/
.theme-toggle-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99,102,241,0.5);
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.theme-toggle-btn:hover {
  transform: scale(1.12) rotate(15deg);
  box-shadow: 0 6px 20px rgba(99,102,241,0.65);
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

/* Keep floating button above mobile bottom nav (56px) */
@media (max-width: 768px) {
  .theme-toggle-btn {
    bottom: calc(56px + 1rem);
    right: 1rem;
  }
}

/* ── Dark Mode Variables ─────────────────────────────────────────────────────*/
html[data-theme="dark"] {
  --bg:           #0f172a;
  --surface:      #1e293b;
  --surface2:     #253047;
  --border:       #334155;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --input-bg:     #1e293b;
}

/* ── Dark Mode Global Overrides ─────────────────────────────────────────────*/
html[data-theme="dark"] body {
  background-color: var(--bg);
  color: var(--text);
}

/* Sidebar */
html[data-theme="dark"] .sidebar {
  background: var(--surface);
  border-color: var(--border);
}
html[data-theme="dark"] .sidebar-header,
html[data-theme="dark"] .sidebar-footer {
  border-color: var(--border);
}
html[data-theme="dark"] .nav-item {
  color: var(--text-muted);
}
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .nav-item.active {
  background: rgba(99,102,241,0.18);
  color: #a5b4fc;
}
html[data-theme="dark"] .user-name  { color: var(--text); }
html[data-theme="dark"] .user-email { color: var(--text-muted); }

/* Main / Header */
html[data-theme="dark"] .main-content  { background: var(--bg); }
html[data-theme="dark"] .top-header    { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .top-header h2 { color: var(--text); }
html[data-theme="dark"] .subtitle      { color: var(--text-muted); }

/* Stat Cards */
html[data-theme="dark"] .stat-card {
  background: var(--surface);
  border-color: var(--border);
}
html[data-theme="dark"] .stat-label { color: var(--text-muted); }
html[data-theme="dark"] .stat-value { color: var(--text); }
html[data-theme="dark"] .stat-change { color: var(--text-muted); }

/* Quick Action Cards */
html[data-theme="dark"] .action-card {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
html[data-theme="dark"] .action-card:hover { background: var(--surface2); }
html[data-theme="dark"] .action-title { color: var(--text); }
html[data-theme="dark"] .action-desc  { color: var(--text-muted); }

/* Sections / Cards */
html[data-theme="dark"] .recent-posts,
html[data-theme="dark"] .upcoming-posts,
html[data-theme="dark"] .section-header,
html[data-theme="dark"] .posts-table,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .settings-tabs,
html[data-theme="dark"] .tab-btn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
html[data-theme="dark"] .tab-btn       { color: var(--text-muted); }
html[data-theme="dark"] .tab-btn:hover { background: rgba(99,102,241,0.15); color: #a5b4fc; }
html[data-theme="dark"] .tab-btn.active { background: rgba(99,102,241,0.2); color: #a5b4fc; border-bottom-color: #a5b4fc; }
html[data-theme="dark"] .card-title    { color: var(--text); }
html[data-theme="dark"] .card-desc     { color: var(--text-muted); }

/* Table */
html[data-theme="dark"] table        { background: var(--surface); }
html[data-theme="dark"] th           { background: var(--surface2); color: var(--text-muted); border-color: var(--border); }
html[data-theme="dark"] td           { color: var(--text); border-color: var(--border); }
html[data-theme="dark"] tr:hover td  { background: var(--surface2); }

/* Timeline */
html[data-theme="dark"] .timeline-item  { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .timeline-time  { color: var(--primary-light); }
html[data-theme="dark"] .timeline-title { color: var(--text); }
html[data-theme="dark"] .timeline-platforms { color: var(--text-muted); }

/* Forms / Inputs */
html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .input-password input,
html[data-theme="dark"] .tz-select {
  background: var(--input-bg);
  border-color: var(--border);
  color: var(--text);
}
html[data-theme="dark"] .form-group label { color: var(--text); }
html[data-theme="dark"] .label-hint       { color: var(--text-muted); }
html[data-theme="dark"] .avatar-hint      { color: var(--text-muted); }
html[data-theme="dark"] .avatar-img,
html[data-theme="dark"] .avatar-fallback  { border-color: var(--border); }
html[data-theme="dark"] .tz-preview {
  background: #0f2d1e;
  border-color: #1a5c3a;
}
html[data-theme="dark"] .tz-preview-label { color: var(--text-muted); }
html[data-theme="dark"] .tz-preview-time  { color: #4ade80; }

/* Social page */
html[data-theme="dark"] .platform-card {
  background: var(--surface);
  border-color: var(--border);
}
html[data-theme="dark"] .platform-name,
html[data-theme="dark"] .platform-title { color: var(--text); }
html[data-theme="dark"] .platform-status { color: var(--text-muted); }

/* Chat / Content Creator */
html[data-theme="dark"] .chat-container,
html[data-theme="dark"] .chat-messages,
html[data-theme="dark"] .chat-input-area { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .message-ai .message-bubble   { background: var(--surface2); color: var(--text); }
html[data-theme="dark"] .message-user .message-bubble { background: var(--primary-dark); color: white; }
html[data-theme="dark"] .chat-input textarea {
  background: var(--input-bg);
  border-color: var(--border);
  color: var(--text);
}
html[data-theme="dark"] .chat-input textarea::placeholder { color: var(--text-muted); }

/* Calendar */
html[data-theme="dark"] .calendar-grid,
html[data-theme="dark"] .fc,
html[data-theme="dark"] .fc-scrollgrid,
html[data-theme="dark"] .fc-col-header-cell,
html[data-theme="dark"] .fc-daygrid-day { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-theme="dark"] .fc-toolbar-title { color: var(--text) !important; }
html[data-theme="dark"] .fc-button       { background: var(--primary) !important; border-color: var(--primary) !important; }

/* Login page */
html[data-theme="dark"] .login-page .container { background: var(--surface); }
html[data-theme="dark"] .login-right { background: var(--surface); }
html[data-theme="dark"] .auth-form h2 { color: var(--text); }
html[data-theme="dark"] .form-group input { background: var(--input-bg); border-color: var(--border); color: var(--text); }

/* Section headers */
html[data-theme="dark"] .section-header h3 { color: var(--text); }
html[data-theme="dark"] .notif-group-title  { color: var(--text); }
html[data-theme="dark"] .toggle-label       { color: var(--text); }
html[data-theme="dark"] .toggle-desc        { color: var(--text-muted); }
html[data-theme="dark"] .toggle-row         { border-color: var(--border); }

/* Empty state */
html[data-theme="dark"] .empty-state p { color: var(--text-muted); }

/* ── Hashtag links (global) ──────────────────────────────────────────────── */
a.hashtag {
  color: var(--primary, #6366f1);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border-radius: 4px;
  padding: 0 2px;
  transition: background 0.12s, color 0.12s;
}
a.hashtag:hover {
  background: rgba(99,102,241,0.12);
  color: var(--primary-dark, #4f46e5);
  text-decoration: none;
}
[data-theme="dark"] a.hashtag:hover {
  background: rgba(99,102,241,0.22);
}

/* ── Trending tags card (dashboard) ─────────────────────────────────────── */
#trendingTagsCard {
  grid-column: 1 / -1;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}
.trending-tags-title {
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.55;
  margin-bottom: 0.65rem;
  letter-spacing: 0.03em;
}
.trending-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trending-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(99,102,241,0.09);
  border: 1px solid rgba(99,102,241,0.18);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary, #6366f1);
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
  text-decoration: none;
}
.trending-tag-pill:hover {
  background: rgba(99,102,241,0.18);
  transform: scale(1.04);
}
.trending-tag-count {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.65;
}

/* ── Translate language picker dropdown ──────────────────────────────────── */
.translate-picker-dropdown {
  position: fixed;
  z-index: 99999;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  min-width: 210px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px 0;
  animation: translatePickerIn 0.15s ease;
}
@keyframes translatePickerIn {
  from { opacity:0; transform:translateY(-6px) scale(0.97); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
.translate-picker-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #9ca3af);
  padding: 8px 14px 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.translate-picker-lang {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-primary, #111827);
  cursor: pointer;
  transition: background 0.1s;
}
.translate-picker-lang:hover {
  background: var(--hover-bg, rgba(99,102,241,0.08));
  color: var(--primary, #6366f1);
}
[data-theme="dark"] .translate-picker-dropdown {
  background: var(--card-bg, #1f2937);
  border-color: var(--border-color, #374151);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
[data-theme="dark"] .translate-picker-lang {
  color: var(--text-primary, #f3f4f6);
}

/* Translate picker — revert option + separator */
.translate-picker-revert {
  color: var(--primary, #6366f1) !important;
  font-weight: 700 !important;
  border-bottom: none;
}
.translate-picker-sep {
  height: 1px;
  background: var(--border-color, #e5e7eb);
  margin: 2px 12px;
}
