/**
 * common.css - Shared styles for English Buddy application
 */

:root {
  --blur-size: 100px;
  --primary-color: #3d48e0;
  --secondary-color: #ff66c4;
  --secondary-dark: #cc2b89;
  --bg-color: #f4f9ff;
  --white: #ffffff;
  --shadow-light: rgba(0, 0, 0, 0.08);
  --shadow-med: rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Outfit", sans-serif;
  background: var(--bg-color);
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-x: hidden;
}

body.home-page {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  width: 100%;
  overflow-x: hidden;
}

body.home-page .page-content {
  justify-content: center;
  align-items: center;
  height: 100%;
}

header {
  background: var(--white);
  box-shadow: 0 2px 12px var(--shadow-light);
  padding: 20px 64px;
  display: flex;
  align-items: center;
  z-index: 10;
  position: relative;
  width: 100%;
}

.logo {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.3s ease;
}

.logo:hover {
  color: var(--secondary-color);
}

.logo:active {
  color: var(--secondary-dark);
}

.logo i {
  margin-right: 10px;
  color: var(--primary-color);
  transition: color 0.3s ease;
}

.logo:hover i {
  color: var(--secondary-color);
}

.logo:active i {
  color: var(--secondary-dark);
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-link {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 600;
}

.header-danger {
  color: #e03d3d;
}

.blur-before,
.blur-after {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(var(--blur-size));
  opacity: 0.7;
  z-index: 0;
  pointer-events: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center;
}

.blur-before {
  background: #a4c8ff;
  animation: orbitFullBefore 30s linear infinite;
}

.blur-after {
  background: #f49bd2;
  animation: orbitFullAfter 30s linear infinite;
}

@keyframes orbitFullBefore {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) translateX(-300px) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg) translateX(-300px) rotate(-360deg);
  }
}

@keyframes orbitFullAfter {
  0% {
    transform: translate(-50%, -50%) rotate(180deg) translateX(-300px) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(540deg) translateX(-300px) rotate(-360deg);
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  body.home-page {
    position: fixed;
    height: 100%;
    width: 100%;
    overflow: hidden;
  }

  header {
    padding: 15px 20px;
    justify-content: center;
    height: auto;
  }

  .logo {
    font-size: 1.3rem;
  }

  .blur-before,
  .blur-after {
    width: 300px;
    height: 300px;
  }
}

/* Auth modal */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.auth-modal-overlay.show {
  display: flex;
}

.auth-modal {
  width: calc(100% - 2rem);
  max-width: 440px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
}

.auth-modal-header {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
}

.auth-modal-close {
  background: rgba(241, 245, 249, 0.8);
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #64748b;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.auth-modal-close:hover {
  background: rgba(203, 213, 225, 0.9);
  color: #334155;
}

.auth-modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 52px 44px 44px;
}

.auth-modal-title {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px 0;
  text-align: center;
  opacity: 1;
}

.auth-modal-subtitle {
  color: #64748b;
  font-size: 16px;
  text-align: center;
  margin: 0;
  line-height: 1.5;
  max-width: 320px;
  opacity: 1;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-input {
  width: 100%;
  padding: 18px 16px;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  outline: none;
  font-size: 16px;
  color: #1f2937;
  background: #ffffff;
  transition: all 0.15s ease;
  text-align: center;
}

.auth-input:focus {
  border-color: #2563eb;
}

.auth-submit {
  width: 100%;
  background: #000000;
  color: #ffffff;
  font-weight: 500;
  font-size: 16px;
  border: none;
  padding: 18px 24px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-submit:hover {
  background: #2563eb;
}

.auth-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #64748b;
}

.auth-modal .auth-link {
  background: none;
  border: none;
  color: #3d48e0;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.auth-modal .auth-link:hover {
  color: #2563eb;
}

.form-errors {
  width: 100%;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
}
