/* Global Theme Variables */
:root {
  /* Dark Theme (Default) */
  --panel: #1b1d21;
  --panel2: #1d1f24;
  --panel3: #141517;
  --orange: #f39200;
  --orange-d: #b66a00;
  --good: #86d38c;
  --warn: #ffd48a;
  --error: #ff6b6b;
  --success: #51cf66;

  --accent1: #F39200;
  --accent2: #FFC800;
  --ink: #0E0F11;
  --bg: #0E0F11;
  --text: #E9EDF6;
  --muted: #9CA2AB;
  --line: #2F3137;
  --line2: rgba(255, 255, 255, 0.283);
  --accent1-border: #f3920082;
  --accent2-border: #ffc8009e;

  /* --font-headline: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; */
  --font-headline: "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;


  /* Form elements */
  --input-bg: var(--panel2);
  --input-border: var(--line);
  --input-text: var(--text);
  --input-placeholder: var(--muted);

  /* Buttons */
  --btn-primary-bg: linear-gradient(180deg, var(--orange), rgba(243, 146, 0, 0.78));
  --btn-primary-text: #1b1205;
  --btn-secondary-bg: var(--panel2);
  --btn-secondary-text: var(--text);

  /* Cards */
  --card-bg: var(--panel);
  --card-border: var(--line);

  /* Navigation */
  --nav-bg: var(--panel);
  --nav-text: var(--text);
  --nav-border: var(--line);

  /* Shadows */
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Light Theme */
:root[data-theme="light"] {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel2: #f5f5f5;
  --text: #1e293b;
  --muted: #64748b;
  --line: rgba(0, 0, 0, 0.08);
  --orange: #f39200;
  --orange-d: #b66a00;
  --good: #059669;
  --warn: #d97706;
  --error: #dc2626;
  --success: #059669;

  --ink: #ffffff; /* opposite of dark ink */
  --bg: #f4f5f9; /* light, slightly blue-tinted background */
  --text: #0E0F11; /* dark readable text */
  --muted: #6b7280; /* muted gray text */
  --line: #e2e8f0; /* subtle divider lines */
  --line2: rgba(0, 0, 0, 0.1); /* faint light line */
  --accent1-border: #f4b86080; /* soft amber tone */
  --accent2-border: #ffcc0080; /* bright but not harsh yellow accent */

  --panel3: #F5F6F8;

  /* Form elements */
  --input-bg: '#f4f5f9';
  --input-border: var(--line);
  --input-text: var(--text);
  --input-placeholder: var(--muted);

  /* Buttons */
  --btn-primary-bg: linear-gradient(180deg, var(--orange), rgba(243, 146, 0, 0.78));
  --btn-primary-text: #1b1205;
  --btn-secondary-bg: var(--panel2);
  --btn-secondary-text: var(--text);

  /* Cards */
  --card-bg: var(--panel);
  --card-border: var(--line);

  /* Navigation */
  --nav-bg: var(--panel);
  --nav-text: var(--text);
  --nav-border: var(--line);

  /* Shadows */
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Base Theme Styles */
* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;

}

/* Theme-aware utility classes */
.theme-bg {
  background-color: var(--bg);
    font-family: 'Nunito', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

}


.theme-panel {
  background-color: var(--panel);
}

.theme-panel2 {
  background-color: var(--panel2);
}

.theme-text {
  color: var(--text);
}

.theme-muted {
  color: var(--muted);
}

.theme-border {
  border-color: var(--line);
}

.theme-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.theme-input {
  background-color: var(--input-bg);
  color: var(--input-text);
  border: 1px solid var(--input-border);
  border-radius: 3px;
  padding: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-input:focus {
  outline: none;
  border-color: rgba(243, 146, 0, 0.55);
  box-shadow: 0 0 0 2px rgba(243, 146, 0, 0.12);
}

.theme-input::placeholder {
  color: var(--input-placeholder);
}

.theme-btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 3px;
  margin: auto;
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  align-items: center;
  gap: 0.5rem;
  transition: filter 0.2s ease, transform 0.1s ease;
}

.theme-btn-primary:hover {
  filter: brightness(1.02);
}

.theme-btn-primary:active {
  transform: translateY(1px);
}

.theme-btn-secondary {
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.theme-btn-secondary:hover {
  background-color: var(--panel);
}

.theme-btn-secondary:active {
  transform: translateY(1px);
}

/* Theme Toggle Styles */
.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
}

.theme-toggle-inline {
  display: flex;
  align-items: center;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.theme-toggle-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent1, #FFA500), var(--accent2, #FFD966));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-toggle-btn:hover::before {
  opacity: 0.1;
}

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

.theme-toggle-btn .themeIcon {
  position: relative;
  z-index: 1;
  font-size: 20px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.theme-toggle-btn:hover .themeIcon {
  transform: rotate(15deg) scale(1.1);
}

.theme-toggle-btn:active .themeIcon {
  transform: rotate(15deg) scale(0.95);
}

/* Mobile variant - full width with text */
.theme-toggle-btn.w-full {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  min-height: 40px;
}

.theme-toggle-btn.w-full .themeIcon {
  transform: none;
}

.theme-toggle-btn.w-full:hover .themeIcon {
  transform: rotate(15deg) scale(1.1);
}

.theme-toggle-icon {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.theme-toggle-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

/* Override Tailwind classes for theme compatibility */
.bg-white {
  background-color: var(--panel) !important;
}

.bg-gray-100 {
  background-color: var(--bg) !important;
}

.text-gray-900 {
  color: var(--text) !important;
}

.text-gray-500 {
  color: var(--muted) !important;
}

.border-gray-200 {
  border-color: var(--line) !important;
}

.shadow {
  box-shadow: var(--shadow) !important;
}

.shadow-lg {
  box-shadow: var(--shadow-lg) !important;
}
