/* ===== LegalTechHub.mn — Mobile-First Simplified Design ===== */

:root {
  --primary-color: #2563eb; /* blue-600 */
  --primary-dark: #1e40af;  /* blue-800 */
  --secondary-color: #64748b; /* slate-500 */
  --accent-color: #fbbc04;
  --text-color: #202124;
  --text-light: #5f6368;
  --bg-color: #ffffff;
  --bg-light: #f8f9fa;
  --border-color: #e8eaed;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
  --border-radius: 8px;
  --max-width: 1200px;

  --blue: #1e40af;
  --light-bg: #ffffff;
  --light-text: #333333;
  --dark-bg: #0f172a;
  --dark-text: #f3f4f6;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
}

/* --- Main container for perfect centering --- */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

@media (max-width: 600px) {
  .main-container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* --- Header Layout --- */
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 auto;
  padding: 0.7rem 1.5rem 0.7rem 1.5rem;
  background: #fff;
  border: none;
  box-shadow: none;
}

.header-row {
  margin: 0 auto;
  width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

/* Language Switcher */
.language-switcher {
  position: static;
  background: #f8f9fa;
  box-shadow: none;
  border-radius: 16px;
  padding: 3px 6px;
  margin-right: 0.7rem;
}

.language-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2001; /* above menu-toggle and nav */
  display: flex;
  gap: 5px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 5px 8px;
  box-shadow: var(--shadow);
}

.lang-btn {
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-light);
  border-radius: 15px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.lang-btn:hover {
  background: var(--bg-light);
  color: var(--text-color);
}

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

@media (max-width: 768px) {
  .language-switcher {
    top: 12px;
    right: 12px;
    left: auto;
    position: fixed;
    z-index: 2001;
    border-radius: 16px;
    padding: 4px 6px;
  }
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  z-index: 999;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin: 0 auto;
}

header .container {
  position: relative;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  background: linear-gradient(135deg, #2563eb, #64748b);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  animation: logoGlow 3s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(37, 99, 235, 0.18);
  transition: all 0.3s ease;
  position: relative;
}

.logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 15px rgba(26, 115, 232, 0.5));
}

.logo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #2563eb, #64748b);
  opacity: 0.08;
  border-radius: 8px;
  z-index: -1;
  filter: blur(10px);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none !important;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

/* --- Responsive Navigation Bar: Prevent Wrapping, Enable Horizontal Scroll --- */
nav ul {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 2rem;
  white-space: nowrap;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE 10+ */
}
nav ul::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Webkit */
}

@media (max-width: 900px) {
  nav ul {
    display: block !important;
    flex-direction: column !important;
    gap: 0 !important;
    overflow-x: visible !important;
    white-space: normal !important;
  }
}

nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--primary-color);
}

/* Header Authentication Styles */
header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

header nav ul {
  flex: 1;
}

.auth-section {
  margin-left: auto;
  padding-left: 20px;
}

/* --- Auth Section Visibility --- */
.auth-section.desktop-auth { display: flex; gap: 0.5rem; }
.auth-section.mobile-auth { display: none; }
@media (max-width: 900px) {
  .auth-section.desktop-auth { display: none; }
  .auth-section.mobile-auth { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 2rem; }
}

/* --- Auth Button Styles --- */
.btn-auth {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--primary-color);
  background: #fff;
  color: var(--primary-color);
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(26,115,232,0.07);
  margin-bottom: 0.2rem;
}
.btn-auth:hover, .btn-auth:focus {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,115,232,0.13);
}
.btn-auth.primary {
  background: var(--primary-color);
  color: #fff;
  border: 1px solid var(--primary-color);
}
.btn-auth.primary:hover, .btn-auth.primary:focus {
  background: var(--primary-dark);
  color: #fff;
}
@media (max-width: 900px) {
  .auth-section.mobile-auth .btn-auth {
    width: 100%;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 1rem;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-light);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.status-icon {
  font-size: 1.25rem;
}

.status-text {
  color: var(--text-light);
  font-weight: 500;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.button, .button-outline {
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 1rem;
}

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

.button:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-hover);
}

.button-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.button-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* Email Form */
.email-form {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: var(--border-radius);
  margin-top: 2rem;
  border: 1px solid var(--border-color);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.email-form h3 {
  margin-bottom: 1rem;
  color: var(--text-color);
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.email-input, .name-input, .role-select {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
}

.btn-signup {
  background: var(--secondary-color);
  color: white;
  padding: 0.75rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-signup:hover {
  background: #2e8b47;
  box-shadow: var(--shadow-hover);
}

/* Sections */
.section {
  padding: 4rem 1rem;
  margin: 0 auto;
}

.section:nth-child(even) {
  background: var(--bg-light);
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--text-color);
}

/* Cards Grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.card {
  background: var(--bg-color);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.card p {
  color: var(--text-light);
  line-height: 1.6;
}

/* CTA Section */
.cta-section {
  text-align: center;
  background: var(--bg-color);
  padding: 3rem 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.cta-section h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.cta-section p {
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* Footer */
footer {
  background: linear-gradient(135deg, #2563eb 0%, #64748b 100%);
  color: #fff;
  border-radius: 32px 32px 0 0;
  margin-top: 3rem;
  box-shadow: 0 -2px 24px rgba(37,99,235,0.08);
}
.footer-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2.5rem;
  padding-bottom: 1.5rem;
}
.footer-block h3 {
  color: #fff;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}
.footer-social-links a, .footer-quick-links a {
  color: #fff;
  background: rgba(26,115,232,0.13);
  border-radius: 8px;
  padding: 0.4rem 1rem;
  font-weight: 500;
  transition: background 0.2s;
}
.footer-social-links a:hover, .footer-quick-links a:hover {
  background: var(--primary-color);
  color: #fff;
}
.footer-credit {
  color: #fff;
  opacity: 0.85;
  font-size: 1rem;
  padding-bottom: 1.5rem;
}
@media (max-width: 900px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 0.5rem;
  }
  footer {
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
  }
}

/* Contact section highlighting */
footer .contact-main {
  background: rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

footer .contact-main h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #fff;
  text-align: center;
  font-weight: bold;
}

footer .contact-main .contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.3s ease;
}

footer .contact-main .contact-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(5px);
}

footer .contact-main .contact-icon {
  font-size: 1.25rem;
  margin-right: 1rem;
  width: 30px;
  text-align: center;
}

footer .contact-main .contact-text {
  font-size: 1rem;
  color: #fff;
  font-weight: 500;
}

footer h3 {
  margin-bottom: 1rem;
  color: white;
  font-size: 1.25rem;
}

footer p {
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
}

footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

footer a:hover {
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.footer-credit {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-top: 2rem;
}

.footer-credit {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.18);
  color: #eee;
  font-size: 0.95rem;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  footer {
    padding: 2.5rem 1rem 1.5rem;
  }
}

@media (max-width: 600px) {
  footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem 0.5rem 1rem;
    margin-top: 2rem;
  }
  footer .contact-main,
  footer > div:not(.footer-credit) {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
    border-radius: 16px;
    padding: 1.2rem 0.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  }
  footer .contact-main .contact-item {
    justify-content: center;
    margin-bottom: 0.7rem;
    padding: 0.5rem 0.2rem;
  }
  footer .contact-main h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  footer h3 {
    font-size: 1.1rem;
    margin-bottom: 0.7rem;
  }
  .footer-credit {
    padding-top: 1.2rem;
    font-size: 0.85rem;
    margin-top: 1.2rem;
  }
}

/* --- Ensure footer links and social are centered on mobile --- */
@media (max-width: 600px) {
  footer > div:not(.contact-main):not(.footer-credit) {
    text-align: center;
    margin: 0 auto 0.5rem auto;
  }
  footer p, footer a {
    text-align: center;
    display: inline-block;
    width: auto;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Logo animations and effects */
@keyframes logoGlow {
  0%, 100% { 
    background-position: 0% 50%;
    filter: drop-shadow(0 0 10px rgba(26, 115, 232, 0.3));
  }
  50% { 
    background-position: 100% 50%;
    filter: drop-shadow(0 0 20px rgba(52, 168, 83, 0.4));
  }
}

/* --- Reveal Animations (fix: always visible by default) --- */
.reveal {
  opacity: 1;
  transition: opacity 0.7s cubic-bezier(.23,1.01,.32,1), transform 0.7s cubic-bezier(.23,1.01,.32,1);
  transform: none;
}
.reveal.visible {
  animation: fadeInUp 0.7s cubic-bezier(.23,1.01,.32,1) both;
}

/* --- Scroll to Top Button --- */
.scroll-to-top {
  position: fixed;
  right: 2rem;
  bottom: 2.5rem;
  z-index: 2000;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  box-shadow: 0 4px 16px rgba(30,64,175,0.18);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, background 0.2s;
}
.scroll-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.scroll-to-top:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.scroll-to-top:hover {
  background: #1e3a8a;
}
@media (max-width: 600px) {
  .scroll-to-top {
    right: 1rem;
    bottom: 1.2rem;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}

/* --- Improved Focus States for Accessibility --- */
button:focus, a:focus, input:focus, select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(30,64,175,0.13);
}

/* --- Subtle Hover/Active Effects for Cards and Buttons --- */
.card:active, .button:active, .button-outline:active {
  transform: scale(0.98);
  box-shadow: 0 1px 6px rgba(30,64,175,0.10);
}

/* Dark mode styles */
body.dark {
  background: #181a20;
  color: #e0e3e8;
}
.navbar.dark, .main-container.dark, .section.dark, .footer-container.dark {
  background: #22242a;
  color: #e0e3e8;
}
.card.dark, .auth-card.dark {
  background: #23262f;
  color: #e0e3e8;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.button.dark, .button-outline.dark, .btn-auth.primary.dark {
  background: #2d3a4a;
  color: #fff;
}
input.dark, select.dark {
  background: #23262f;
  color: #e0e3e8;
  border-color: #444;
}
/* Add dark mode for other elements as needed */

/* Prominent theme toggle styles */
.theme-toggle.prominent {
  position: absolute;
  top: 24px;
  right: 32px;
  z-index: 100;
  font-size: 2rem;
  background: none;
  border: none;
  color: #2d3a4a;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}
body.dark .theme-toggle.prominent {
  color: #e0e3e8;
}
.theme-toggle.prominent:hover {
  color: #ffb300;
  transform: scale(1.15);
}
@media (max-width: 600px) {
  .theme-toggle.prominent {
    top: 16px;
    right: 12px;
    font-size: 1.5rem;
  }
}

/* --- Hamburger menu for mobile --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
  z-index: 3000; /* highest priority */
  background: #fff;
  border: 2px solid #2563eb;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(37,99,235,0.12);
  position: absolute;
  top: 12px;
  right: 16px;
  opacity: 1 !important;
  visibility: visible !important;
}
.hamburger .bar {
  width: 28px;
  height: 4px;
  background: #1e40af;
  margin: 5px 0;
  border-radius: 2px;
  transition: 0.3s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
@media (max-width: 900px) {
  .hamburger {
    position: fixed !important;
    top: 16px !important;
    right: 16px !important;
    display: flex !important;
    z-index: 4000 !important;
    background: #ffeb3b !important; /* bright yellow for debug */
    border: 4px solid #e53935 !important; /* thick red border for debug */
    outline: 3px solid #e53935 !important; /* extra red outline for debug */
    opacity: 1 !important;
    visibility: visible !important;
  }
  .hamburger .bar {
    background: #1e40af !important;
    border: 2px solid #e53935 !important;
  }
}
@media (min-width: 901px) {
  .hamburger {
    display: none !important;
  }
  .menu {
    display: flex !important;
    position: static !important;
    flex-direction: row !important;
    background: none !important;
    box-shadow: none !important;
  }
}
