/* Tinnitaid Design System - Wellness Theme */

:root {
  /* Color Palette */
  --primary: #0077CC;
  /* Old Blue */
  --primary-dark: #005FA3;
  --secondary: #2A9D8F;
  /* Teal/Green (formerly primary) */
  --accent: #E9C46A;
  /* Warm Yellow */
  --background: #F8F9FA;
  /* Soft White */
  --surface: #FFFFFF;
  /* Pure White */
  --text-main: #264653;
  --text-muted: #6c757d;
  --danger: #E76F51;
  /* Burnt Orange */

  /* Typography */
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

/* Layout */
.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

header {
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.hero-section {
  padding: var(--spacing-md) 0;
  margin-bottom: var(--spacing-md);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary);
  text-decoration: none;
  /* Ensure no underline */
}

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

@media (max-width: 400px) {
  .logo span {
    display: none;
    /* Hide text on very small screens to fit controls */
  }

  .header-controls .btn-outline {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
}

main {
  flex: 1;
  padding: 4rem 0;
  /* Increased from spacing-xl (3rem) to 4rem */
}

footer {
  background-color: var(--text-main);
  /* Darker footer looks better with blue */
  color: var(--surface);
  padding: var(--spacing-xl) 0;
  text-align: center;
  margin-top: auto;
}

/* Components */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: var(--spacing-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  margin-bottom: var(--spacing-lg);
  /* Kept original margin-bottom */
}

.card.text-center {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card.text-center>*:last-child {
  margin-top: auto;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-size: 1rem;
  gap: var(--spacing-xs);
  transform: scale(1);
}

.btn:hover {
  transform: scale(1.02);
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(0, 119, 204, 0.3);
}

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

.btn-outline:hover {
  background-color: rgba(0, 119, 204, 0.1);
}

.btn-large {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
}



/* Controls */
.control-group {
  margin-bottom: var(--spacing-md);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xs);
}

input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #e0e0e0;
  border-radius: var(--radius-full);
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* Typography Utilities */
h1,
h2,
h3 {
  font-family: var(--font-heading);
  color: var(--text-main);
  margin-bottom: var(--spacing-sm);
  margin-top: var(--spacing-xl);
  /* Added spacing */
}

/* Only remove top margin for h2 and h3 if they are first child. H1 should always have space. */
h2:first-child,
h3:first-child {
  margin-top: 0;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.2rem;
}

.text-center {
  text-align: center;
}

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

.mb-4 {
  margin-bottom: var(--spacing-lg);
}

/* Grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Utilities */
.hidden {
  display: none;
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

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

/* Login Page Specifics */
.login-page {
  background: linear-gradient(135deg, var(--background) 0%, #e6f3ff 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  padding-top: 80px;
  /* Ensure content doesn't overlap with absolute header */
  position: relative;
  overflow: hidden;
}

/* Decorative background blobs */
.login-main::before,
.login-main::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
  opacity: 0.6;
}

.login-main::before {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: -50px;
  left: -50px;
  opacity: 0.15;
}

.login-main::after {
  width: 250px;
  height: 250px;
  background: var(--secondary);
  bottom: -50px;
  right: -50px;
  opacity: 0.15;
}

.login-card {
  background: rgba(255, 255, 255, 0.9);
  /* Slightly more opaque for better readability */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  /* Slightly tighter width */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
  width: 100%;
}

.login-header h1 {
  font-size: 1.75rem;
  /* Smaller, cleaner heading */
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.login-header p {
  font-size: 0.95rem;
  line-height: 1.5;
}

.login-logo {
  width: 48px;
  /* Reduced from 64px */
  height: 48px;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 6px rgba(0, 119, 204, 0.2));
}

.btn-google {
  background-color: white;
  color: #3c4043;
  border: 1px solid #dadce0;
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-weight: 500;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  /* Softer pill shape */
  font-size: 15px;
  cursor: pointer;
  height: 48px;
}

.btn-google:hover {
  background-color: #f8f9fa;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-color: #d2e3fc;
  transform: translateY(-1px);
}

.btn-google:active {
  background-color: #f1f3f4;
  transform: translateY(0);
}

.btn-google img {
  margin-right: 12px;
  width: 20px;
  height: 20px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

/* Language Switcher Styles - Match Back Button */
/* Remove pill container, style buttons like btn-outline */
#header-lang-switcher,
#profile-lang-switcher {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

button.lang-btn,
#header-lang-switcher .lang-btn,
#profile-lang-switcher .lang-btn,
.lang-btn {
  /* Explicitly set all properties - don't use 'all: unset' */
  display: inline-block !important;
  cursor: pointer !important;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-main) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
  text-decoration: none !important;

  /* Match btn-outline style */
  background: transparent !important;
  border: 2px solid var(--primary) !important;
  color: var(--primary) !important;
  min-width: 44px !important;
  text-align: center !important;
}

button.lang-btn:hover:not(.active),
#header-lang-switcher .lang-btn:hover:not(.active),
#profile-lang-switcher .lang-btn:hover:not(.active),
.lang-btn:hover:not(.active) {
  background-color: rgba(0, 119, 204, 0.1) !important;
}

button.lang-btn.active,
#header-lang-switcher .lang-btn.active,
#profile-lang-switcher .lang-btn.active,
.lang-btn.active {
  background: var(--primary) !important;
  color: white !important;
  font-weight: 600 !important;
}

.lang-separator {
  display: none !important;
}

/* Fix Card Alignment */
/* Ensure the inner text-center div fills the card and pushes button down */
.card .text-center {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.card .text-center>*:last-child {
  margin-top: auto;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-sm);
  }

  /* Fix Login Card Width & Padding */
  .login-card {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin: var(--spacing-sm) auto;
    /* Center it */
    width: 100%;
    /* Take full width */
    max-width: 100%;
    /* Ensure no overflow */
  }

  /* Make header controls tighter on mobile */
  .lang-switcher-header {
    margin-right: 0.5rem;
  }

  .lang-btn {
    padding: 4px 8px;
    /* Slightly smaller touch targets */
    font-size: 0.8rem;
  }

  .login-main {
    align-items: center;
    /* Center on mobile too, looks better than bottom */
    padding-bottom: var(--spacing-md);
    padding-top: 60px;
  }

  /* Ensure buttons are easy to tap but text doesn't flow out */
  .btn-large {
    padding: 0.8rem;
    font-size: 1rem;
  }

  /* Fix text sizes */
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .login-main::before {
    top: -10%;
    left: -10%;
  }

  .login-main::after {
    bottom: -5%;
    right: -5%;
  }
}