/* index.css - LYSwing Web App Styles */

/* Header/Navigation */
header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

body.auth-checking #root {
  visibility: hidden;
}

body.auth-route {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background-color: #000;
}

body.auth-route header,
body.auth-route main,
body.auth-route footer {
  display: none !important;
}

body.auth-route::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.62)),
    url('/bg.jpg') center center / cover no-repeat;
  filter: grayscale(1);
  z-index: -2;
}

body.auth-route::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.03), transparent 24%);
  z-index: -1;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.language-selector {
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary);
}

.logo img {
  width: 40px;
  height: 50px;
  object-fit: contain;
}

nav {
  display: flex;
  gap: var(--spacing-lg);
}

nav a {
  color: var(--color-text);
  font-weight: 500;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

.nav-right {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-noir) 0%, var(--color-surface) 100%);
  padding: var(--spacing-xl);
  text-align: center;
}

.hero-content {
  max-width: 600px;
}

.hero img {
  width: 150px;
  height: 180px;
  margin-bottom: var(--spacing-lg);
  filter: drop-shadow(0 5px 20px rgba(196, 30, 58, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.hero h1 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--spacing-md);
  color: var(--color-text);
}

.hero .subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-accent);
  margin-bottom: var(--spacing-lg);
}

.hero p {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-lg);
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Auth Container */
.auth-container {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 480px);
  max-height: min(88vh, 820px);
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  background:
    radial-gradient(circle at top, rgba(208, 175, 42, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(58, 58, 58, 0.98), rgba(32, 32, 32, 0.98));
  border: 1px solid rgba(208, 175, 42, 0.18);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
}

body.auth-route .auth-container {
  display: block;
  inset: 0;
  top: 0;
  left: 0;
  transform: none;
  width: 100vw;
  min-height: 100vh;
  max-height: none;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-container.active {
  display: block;
}

.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(196, 30, 58, 0.16), transparent 24%),
    rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
  z-index: 999;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.28);
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1;
}

.auth-close:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.auth-visual-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 3.5vw, 3rem);
  background: linear-gradient(180deg, rgba(6, 6, 6, 0.66), rgba(6, 6, 6, 0.84));
}

.auth-visual-inner {
  max-width: 380px;
}

.auth-hero-logo {
  width: min(19vw, 168px);
  height: auto;
  object-fit: contain;
  margin-bottom: 1rem;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.42));
}

.auth-visual-kicker {
  margin: 0 0 0.55rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.auth-visual-title {
  margin-bottom: 0.8rem;
  color: #fff;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.02;
  max-width: 20ch;
}

.auth-visual-copy {
  max-width: 36ch;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.94rem;
  line-height: 1.55;
}

.auth-form-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: clamp(4rem, 6vw, 5rem) clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 2vw, 1.75rem);
  background: linear-gradient(180deg, rgba(6, 6, 6, 0.66), rgba(6, 6, 6, 0.84));
}

.auth-language-switcher {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  z-index: 2;
}

.language-selector--auth {
  min-width: 140px;
  background: rgba(10, 10, 10, 0.7);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.auth-form-header {
  width: min(100%, 390px);
  margin: 0 auto 1rem auto;
}

.auth-form-kicker {
  margin: 0 0 0.25rem;
  color: var(--color-accent);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.auth-form-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.94rem;
  line-height: 1.45;
}

.auth-form {
  animation: authFadeIn 0.24s ease;
  width: min(100%, 390px);
  margin: 0 auto;
}

.auth-submit {
  width: 100%;
  margin-top: 0.6rem;
}

.auth-main-btn {
  margin-top: 0.2rem;
  min-height: 48px;
}

.auth-inline-action-row {
  width: min(100%, 390px);
  margin: -0.1rem auto 0 auto;
  display: flex;
  justify-content: flex-end;
}

.auth-inline-link {
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.9rem;
  cursor: pointer;
}

.auth-inline-link:hover {
  color: var(--color-accent);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 3.4rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.8rem;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

.password-toggle.is-visible {
  color: var(--color-accent);
}

.auth-provider-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.85rem auto 0 auto;
  width: min(100%, 390px);
}

.auth-divider-group {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

.auth-divider-text {
  position: relative;
  margin-bottom: var(--spacing-md);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  letter-spacing: 0.12em;
}

.auth-divider-text::before,
.auth-divider-text::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 34%;
  height: 1px;
  background: var(--color-border);
}

.auth-divider-text::before {
  left: 0;
}

.auth-divider-text::after {
  right: 0;
}

.auth-provider-btn {
  width: 100%;
  justify-content: flex-start;
  gap: 0.75rem;
  min-height: 48px;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.auth-provider-btn + .auth-provider-btn {
  margin-top: var(--spacing-sm);
}

.auth-provider-icon {
  font-size: 1.1rem;
}

.auth-provider-icon--svg {
  display: inline-flex;
  width: 20px;
  height: 20px;
}

.auth-provider-icon--svg svg {
  width: 20px;
  height: 20px;
}

.auth-route-link-row {
  width: min(100%, 390px);
  margin: 0.85rem auto 0 auto;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.auth-route-link {
  margin-left: 0.35rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.auth-route-link:hover {
  color: var(--color-accent);
}

.phone-auth-panel {
  width: min(100%, 390px);
  margin: 0.85rem auto 0 auto;
  padding: 0.85rem;
  border: 1px solid rgba(208, 175, 42, 0.16);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
}

.phone-auth-header {
  margin-bottom: var(--spacing-md);
}

.phone-auth-header h3 {
  margin-bottom: 0.35rem;
}

.phone-auth-header p {
  margin: 0;
  font-size: var(--font-size-sm);
}

.phone-auth-actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.recaptcha-shell {
  margin-top: var(--spacing-md);
  display: flex;
  justify-content: center;
  min-height: 76px;
}

.reset-password-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(10px);
  z-index: 1600;
}

.reset-password-modal {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 1601;
}

.reset-password-modal__card {
  position: relative;
  width: min(92vw, 760px);
  padding: clamp(2rem, 4vw, 3.25rem);
  border: 1px solid rgba(208, 175, 42, 0.18);
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(208, 175, 42, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(18, 18, 18, 0.96), rgba(8, 8, 8, 0.98));
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.55);
}

.reset-password-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.reset-password-modal__kicker {
  margin: 0 0 0.5rem;
  color: var(--color-accent);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.reset-password-modal__title {
  margin-bottom: 0.7rem;
  color: #fff;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.02;
}

.reset-password-modal__description {
  margin: 0 0 1.4rem;
  max-width: 46ch;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.reset-password-modal__field {
  max-width: 560px;
}

.reset-password-modal__submit {
  width: min(100%, 560px);
  min-height: 52px;
}

.reset-password-modal__submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.reset-password-modal__message {
  min-height: 1.5rem;
  margin: 1rem 0 0;
  color: rgba(255, 255, 255, 0.76);
}

.reset-password-modal__message.is-success {
  color: #cfe8b4;
}

.reset-password-modal__message.is-error {
  color: #ff8d8d;
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group {
  margin-bottom: 0.8rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: var(--color-text);
}

@media (min-width: 1024px) and (max-height: 920px) {
  .auth-visual-inner {
    max-width: 340px;
  }

  .auth-hero-logo {
    width: min(16vw, 136px);
    margin-bottom: 0.75rem;
  }

  .auth-visual-title {
    font-size: clamp(1.6rem, 2.5vw, 2.35rem);
    margin-bottom: 0.65rem;
  }

  .auth-visual-copy {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .auth-form-side {
    padding-top: 3.35rem;
    padding-bottom: 1rem;
  }

  .auth-form-header {
    margin-bottom: 0.85rem;
  }

  .auth-form,
  .auth-form-header,
  .auth-provider-stack,
  .auth-route-link-row,
  .phone-auth-panel {
    width: min(100%, 370px);
  }

  .form-group {
    margin-bottom: 0.65rem;
  }

  .auth-provider-stack,
  .auth-route-link-row,
  .phone-auth-panel {
    margin-top: 0.7rem;
  }

  .auth-provider-btn,
  .auth-main-btn {
    min-height: 44px;
  }

  .auth-inline-action-row,
  .auth-form,
  .auth-form-header,
  .auth-provider-stack,
  .auth-route-link-row,
  .phone-auth-panel {
    width: min(100%, 370px);
  }
}

.form-group input {
  width: 100%;
}

.form-group .error {
  color: var(--color-cherry-red);
  font-size: var(--font-size-sm);
  margin-top: 4px;
}

/* Form Error/Success Message Styles */
.form-error-message {
  color: #c41c3a;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: rgba(196, 28, 58, 0.1);
  border-left: 3px solid #c41c3a;
  border-radius: 4px;
}

.phone-auth-error {
  color: #c41c3a;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: rgba(196, 28, 58, 0.1);
  border-left: 3px solid #c41c3a;
  border-radius: 4px;
}

.phone-auth-success {
  color: #4caf50;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: rgba(76, 175, 80, 0.1);
  border-left: 3px solid #4caf50;
  border-radius: 4px;
}

.reset-password-modal__message.is-error {
  color: #c41c3a;
  background-color: rgba(196, 28, 58, 0.1);
  border-left: 3px solid #c41c3a;
  padding: 0.75rem;
  border-radius: 4px;
}

.reset-password-modal__message.is-success {
  color: #4caf50;
  background-color: rgba(76, 175, 80, 0.1);
  border-left: 3px solid #4caf50;
  padding: 0.75rem;
  border-radius: 4px;
}

/* Feed Section */
.feed {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.post {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  border: 1px solid var(--color-border);
}

.post-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.post-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-cotton);
  font-weight: 700;
}

.post-meta {
  flex: 1;
}

.post-author {
  font-weight: 600;
  color: var(--color-text);
}

.post-time {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* RTL Support */
html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .auth-split {
  grid-template-columns: 1fr 1fr;
}

html[dir="rtl"] .auth-visual-side {
  order: 2;
}

html[dir="rtl"] .auth-form-side {
  order: 1;
}

html[dir="rtl"] header .container {
  flex-direction: row-reverse;
}

html[dir="rtl"] nav {
  flex-direction: row-reverse;
}

html[dir="rtl"] .nav-right {
  flex-direction: row-reverse;
}

html[dir="rtl"] .password-field input {
  padding-left: 3.4rem;
  padding-right: 0.8rem;
}

html[dir="rtl"] .password-toggle {
  right: auto;
  left: 0.8rem;
}

html[dir="rtl"] .form-error-message,
html[dir="rtl"] .phone-auth-error {
  border-left: none;
  border-right: 3px solid #c41c3a;
}

html[dir="rtl"] .phone-auth-success {
  border-left: none;
  border-right: 3px solid #4caf50;
}

.post-content {
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.post-image {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.post-actions {
  display: flex;
  justify-content: space-between;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

.post-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--spacing-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: var(--transition-base);
}

.post-action:hover {
  color: var(--color-primary);
  background-color: var(--color-surface-light);
  border-radius: var(--radius-md);
}

/* Loading State */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer */
footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--spacing-lg) 0;
  margin-top: var(--spacing-xl);
}

footer .container {
  text-align: center;
}

footer p {
  color: var(--color-text-secondary);
  margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero {
    min-height: auto;
    padding: var(--spacing-lg) var(--spacing-sm);
  }

  .hero img {
    width: 100px;
    height: 130px;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .feed {
    padding: var(--spacing-md);
  }

  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-visual-side {
    min-height: 30vh;
    align-items: flex-end;
    padding-bottom: 1rem;
  }

  .auth-visual-title {
    max-width: 100%;
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  .auth-form-side {
    align-items: center;
    padding: 3rem 1.5rem 1.5rem 1.5rem;
  }

  .auth-language-switcher {
    top: 0.8rem;
    right: 0.8rem;
  }

  .language-selector--auth {
    min-width: 110px;
    font-size: 0.85rem;
  }

  .auth-close {
    top: 10px;
    right: 10px;
  }
}
