/* Font imports */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap");

/* CSS Variables */
:root {
  --primary-color: #004b87;
  --primary-light: #1e5fa3;
  --secondary-color: #fbb03b;
  --accent-color: #e8f4fd;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --background: #fafbfc;
  --surface: #ffffff;
  --border: #e5e7eb;
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-large: 0 8px 25px rgba(0, 0, 0, 0.15);
  --gradient-primary: linear-gradient(135deg, #004b87 0%, #1e5fa3 100%);
  --gradient-secondary: linear-gradient(135deg, #fbb03b 0%, #f39c12 100%);
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Noto Sans Thai", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Login page specific body height */
body.login-page,
html:has(body.login-page) {
  height: 100%;
}

/* App Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f8fafc 0%, #e8f4fd 100%);
  position: relative;
  overflow-x: hidden;
}

/* Login page specific app container */
.app-container.login-page {
  overflow: hidden;
}

.app-container::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 100%;
  height: 200%;
  background: var(--gradient-primary);
  border-radius: 50%;
  opacity: 0.03;
  transform: rotate(-15deg);
  z-index: 0;
}

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 10;
  box-shadow: var(--shadow-light);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Profile page specific header */
.header-content.profile-header {
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* Main Content */
.main-content {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Login page specific main content */
.login-page .main-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* Login Card (Login page specific) */
.login-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 3rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-large);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

/* Airport Info */
.airport-info {
  text-align: center;
  margin-bottom: 2.5rem;
}

.airport-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-color);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.airport-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.airport-subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin: 0;
}

/* Login Section */
.login-section {
  margin-bottom: 1.5rem;
}

.section-title {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

.login-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Login Buttons */
.login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.login-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s;
}

.login-button:hover::before {
  left: 100%;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--primary-color);
}

.login-button:active {
  transform: translateY(0);
}

.login-button.google {
  border-color: #ea4335;
  color: #ea4335;
}

.login-button.google:hover {
  background: #ea4335;
  color: white;
  border-color: #ea4335;
}

.login-button.facebook {
  border-color: #1877f2;
  color: #1877f2;
}

.login-button.facebook:hover {
  background: #1877f2;
  color: white;
  border-color: #1877f2;
}

.login-button.twitter {
  border-color: #000000;
  color: #000000;
}

.login-button.twitter:hover {
  background: #000000;
  color: white;
  border-color: #000000;
}

.login-button.microsoft {
  border-color: #00a4ef;
  color: #00a4ef;
}

.login-button.microsoft:hover {
  background: #00a4ef;
  color: white;
  border-color: #00a4ef;
}

.login-button.line {
  border-color: #00b900;
  color: #00b900;
}

.login-button.line:hover {
  background: #00b900;
  color: white;
  border-color: #00b900;
}

.login-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Loading state */
.login-button.loading {
  pointer-events: none;
  opacity: 0.7;
}

.login-button.loading .login-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Footer Text */
.footer-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

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

.footer-text a:hover {
  text-decoration: underline;
}

/* Focus states for accessibility */
.login-button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: #000000;
    --text-secondary: #000000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .login-button {
    transition: none;
  }

  .login-button:hover {
    transform: none;
  }
}

/* Responsive design */
@media (max-width: 640px) {
  .login-card {
    margin: 1rem;
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }

  .airport-name {
    font-size: 1.25rem;
  }

  .header-content {
    padding: 1rem;
  }

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

@media (max-width: 480px) {
  .main-content {
    padding: 1rem 0.5rem;
  }

  .login-card {
    margin: 0.5rem;
    padding: 1.5rem 1rem;
  }

  .airport-name {
    font-size: 1.125rem;
  }
}