/* static/css/website/website_styles.css */

/* ============================================= */
/* ==     THEME & COLOR VARIABLES (ENHANCED)  == */
/* ============================================= */
:root {
  /* --- Main Palette --- */
  --primary-color: #2f68bd;
  --primary-color-darker: #214070;
  --secondary-color: #62bfe6;
  --highlight-gradient: linear-gradient(135deg,
      var(--secondary-color),
      #5ba1f1);

  /* --- Typography (ENHANCED FOR READABILITY) --- */
  --heading-color: #2f68bd;
  --text-color: #374151;
  --text-muted: #6b7280;
  --text-on-primary: #ffffff;
  --text-on-dark-bg: #f9fafb;

  /* --- Backgrounds & Surfaces --- */
  --background-color: #f8fafc;
  --card-bg: #ffffff;
  --cards-bg: rgb(255, 252, 250);
  --header-bg: linear-gradient(135deg, #f6ebe6 0%, #e2e9f1 100%);
  --dark-section-bg: linear-gradient(135deg, #2c5aa0, #1e3f73);
  --footer-bg: #25232d;
  --footer-link-hover: var(--secondary-color);

  /* --- Borders & Shadows --- */
  --border-color: #e2e8f0;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);

  /* --- Services Section Specific --- */
  --step-1-color: #a6c6d4;
  --step-2-color: #1ebbe3;
  --step-3-color: #2c3e50;
  --step-4-color: #3498db;
  --line-color: #e0e0e0;

  /* --- Misc & Fonts --- */
  --font-family-heading: "Poppins", sans-serif;
  --font-family-body: "Inter", sans-serif;
  --transition-speed: 0.3s;
  --border-radius-md: 0.375rem;
  --border-radius-lg: 0.5rem;
  --border-radius-2xl: 1rem;

  /* --- Tag Colors --- */
  --tag-location-bg: #fffbeb;
  --tag-location-text: #b45309;
  --tag-category-bg: #f0fdf4;
  --tag-category-text: #15803d;
  --tag-english-bg: #eff6ff;
  --tag-english-text: #1d4ed8;
  --tag-worktype-bg: #f5f3ff;
  --tag-worktype-text: #6d28d9;
}

html[data-theme="dark"] {
  /* --- Dark Mode Main Palette --- */
  --primary-color: #67e8f9;
  --primary-color-darker: #22d3ee;
  --secondary-color: #5fa8e3;
  --highlight-gradient: linear-gradient(135deg,
      var(--secondary-color),
      var(--primary-color));

  /* --- Dark Mode Typography --- */
  --heading-color: #5fa8e3;
  --text-color: #d1d5db;
  --text-muted: #9ca3af;
  --text-on-primary: #111827;
  --text-on-dark-bg: #f9fafb;

  /* --- Dark Mode Backgrounds --- */
  --background-color: #111827;
  --card-bg: #1e2945;
  --cards-bg: #1e2945;
  --header-bg: linear-gradient(135deg, #1e2945, #162138);
  --dark-section-bg: linear-gradient(135deg, #1e2945, #162138);
  --footer-bg: #0a0d15;
  --footer-text: #9ca3af;

  /* --- Dark Mode Borders & Shadows --- */
  --border-color: #374151;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);

  /* --- Dark Mode Services Section --- */
  --step-1-color: #b0d0e0;
  --step-2-color: #36c8ed;
  --step-3-color: #9b82f3;
  --step-4-color: #5fa8e3;
  --line-color: #4b5563;

  /* --- Dark Mode Tag Colors --- */
  --tag-location-bg: #422006;
  --tag-location-text: #fef3c7;
  --tag-category-bg: #064e3b;
  --tag-category-text: #dcfce7;
  --tag-english-bg: #1e40af;
  --tag-english-text: #dbeafe;
  --tag-worktype-bg: #4c1d95;
  --tag-worktype-text: #e0e7ff;
}

/* ============================================= */
/* ==     GLOBAL & BASE STYLES                == */
/* ============================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-family-body);
  line-height: 1.7;
  font-size: 16px;
  color: var(--text-color);
  background-color: var(--background-color);
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.mobile-nav-active {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-heading);
  color: #2f68bd;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  max-width: 65ch;
  color: var(--text-color);
  margin-bottom: 1rem;
}

h1,
h2,
h3,
.section-header p {
  max-width: none;
}

/* ============================================= */
/* ==   NEW LAYOUT CONTAINER (FOR FULL WIDTH)   == */
/* ============================================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* ============================================= */
/* ==     HEADER & NAVIGATION                 == */
/* ============================================= */
header {
  background: var(--header-bg);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  top: 0;
  z-index: 1000;
  width: 100%;
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.5rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 17px;
  text-decoration: none;
}

.logo-image {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.logo span {
  font-family: var(--font-family-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.5rem;
}

.nav-links a {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.nav-links a span {
  position: relative;
  display: inline-block;
}

.nav-links a span::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 3px;
  background: var(--primary-color);
  bottom: -5px;
  left: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

.nav-links a:hover span::after,
.nav-links a.active span::after {
  transform: scaleX(1);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle-button {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  overflow: hidden;
  transition: all var(--transition-speed) ease;
}

.theme-toggle-button:hover {
  border-color: var(--primary-color);
}

.theme-toggle-button .sun-icon {
  display: block;
}

.theme-toggle-button .moon-icon {
  display: none;
}

html[data-theme="dark"] .theme-toggle-button .sun-icon {
  display: none;
}

html[data-theme="dark"] .theme-toggle-button .moon-icon {
  display: block;
}

.theme-toggle-button svg {
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
}

.mobile-menu-toggle {
  display: none;
}

/* ============================================= */
/* ==     COMPONENTS (BUTTONS, ETC.)          == */
/* ============================================= */
.btn-outline {
  display: inline-block;
  padding: 12px 32px;
  border: 2px solid var(--primary-color);
  border-radius: 9999px;
  background: transparent;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--text-on-primary);
  transform: translateY(-2px);
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  transition: all 0.3s ease;
  text-decoration: none;
  border: 1px solid transparent;
}

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

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

.btn-secondary {
  background-color: var(--card-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: #f9fafb;
  border-color: var(--primary-color);
}

.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.alert-danger {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* ============================================= */
/* ==     FOOTER STYLES                       == */
/* ============================================= */
footer {
  background-color: var(--footer-bg);
  padding: 3rem 0;
  color: white;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  padding: 0 0.75rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: left;
  }

  .footer-content .social-links {
    justify-content: flex-start;
  }
}

.footer-section h3 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.footer-section p,
.footer-section a {
  color: white;
  text-decoration: none;
  line-height: 1.8;
}

.footer-section a:hover {
  color: var(--footer-link-hover);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  align-items: center;
}

.social-links a {
  text-decoration: none;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.social-links a:hover {
  color: var(--primary-color);
}

.social-links .icon {
  width: 24px;
  height: 24px;
}

/* ============================================= */
/* ==   FLOATING QUICK TIPS (BASE STYLES)     == */
/* ============================================= */

.floating-container {
  position: fixed;
  top: 120px;
  right: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 999;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.click-text {
  background: white;
  color: var(--primary-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  opacity: 0;
  animation: slideDown 0.5s ease forwards;
  white-space: nowrap;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.floating-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(47, 104, 189, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 3px solid white;
}

.floating-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 30px rgba(47, 104, 189, 0.6);
}

.floating-icon:active {
  transform: scale(0.95);
}

.floating-icon svg {
  display: none;
}

.floating-icon::before {
  content: "💡";
  font-size: 32px;
  line-height: 1;
}

.tips-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
  pointer-events: none;
  opacity: 0;
  backdrop-filter: blur(4px);
}

.tips-modal.active {
  display: flex;
  pointer-events: auto;
  opacity: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
  max-width: 550px;
  width: 90%;
  animation: popIn 0.3s ease;
  position: relative;
  z-index: 2001;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-content h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: 700;
}

.modal-content ul {
  list-style: none;
  margin-bottom: 20px;
}

.modal-content li {
  padding: 10px 0;
  color: #333;
  border-bottom: 1px solid #eee;
  font-size: 15px;
}

.modal-content li:last-child {
  border-bottom: none;
}

.modal-content li:before {
  content: "💡 ";
  margin-right: 10px;
  font-size: 18px;
}

.close-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
}

.close-btn:hover {
  background: var(--primary-color-darker);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(47, 104, 189, 0.3);
}

.close-btn:active {
  transform: translateY(0);
}

/* DARK MODE SUPPORT FOR QUICK TIPS */
@media (prefers-color-scheme: dark) {
  .click-text {
    background: var(--card-bg);
    color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  }

  .floating-icon {
    background: var(--primary-color);
    box-shadow: 0 8px 20px rgba(95, 168, 227, 0.3);
  }

  .floating-icon:hover {
    box-shadow: 0 12px 30px rgba(95, 168, 227, 0.5);
  }

  .tips-modal {
    background: rgba(0, 0, 0, 0.8);
  }

  .modal-content {
    background: var(--background-color);
    color: #374151;
    border: 1px solid #e5e7eb;
  }

  .modal-content h2 {
    color: var(--primary-color);
  }

  .modal-content li {
    color: #374151;
    border-bottom-color: #e5e7eb;
  }

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

  .close-btn:hover {
    background: var(--primary-color-darker);
    box-shadow: 0 8px 20px rgba(95, 168, 227, 0.4);
  }
}

/* ============================================= */
/* ==     RESPONSIVE (MOBILE)                 == */
/* ============================================= */
@media (max-width: 768px) {

  /* --- 1. Header & Font Adjustments --- */
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  header {
    padding: 0.5rem 0;
  }

  .logo-image {
    width: 35px;
    height: 35px;
  }

  .logo span {
    font-size: 1.25rem;
  }

  .btn-primary,
  .btn-secondary {
    padding: 8px 18px;
    font-size: 13px;
  }

  .btn-outline {
    padding: 10px 28px;
  }

  /* --- 2. Mobile Menu Toggle --- */
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    /* Higher than nav-links */
  }

  .mobile-menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
  }

  body.mobile-nav-active .mobile-menu-toggle .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  body.mobile-nav-active .mobile-menu-toggle .bar:nth-child(2) {
    opacity: 0;
  }

  body.mobile-nav-active .mobile-menu-toggle .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* --- 3. FIX: Mobile Navigation Transparency --- */
  .nav-links {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* Ensure full viewport height */

    /* FIX: Use var(--card-bg) for a solid, opaque background on all pages */
    background: var(--card-bg);

    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    /* Smooth fade in */
  }

  body.mobile-nav-active .nav-links {
    display: flex;
    opacity: 1;
    pointer-events: auto;
  }

  /* --- 4. FIX: Quick Tips Responsive Positioning --- */
  .floating-container {
    top: auto;
    /* Remove top positioning */
    bottom: 30px;
    /* Move to bottom right */
    right: 20px;
    z-index: 9999;
    /* Ensure it sits on top of everything */
  }

  /* Hide the "Click for tips" text on mobile to save space */
  .click-text {
    display: none;
  }

  .floating-icon {
    width: 50px;
    height: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  }

  /* Fix Modal Sizing on Mobile */
  .modal-content {
    padding: 25px;
    width: 85%;
    margin: 0;
    max-height: 80vh;
    /* Prevent modal being taller than screen */
    overflow-y: auto;
    /* Allow scrolling inside modal */
  }

  .modal-content h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .modal-content li {
    font-size: 14px;
    padding: 8px 0;
  }

  .close-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}