/* ===================================
   Member System - Refined Luxury Aesthetic
   =================================== */

:root {
  /* Colors - Dark Luxury Palette */
  --color-bg: #0a0a0f;
  --color-surface: #151520;
  --color-surface-light: #1c1c28;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-focus: rgba(255, 255, 255, 0.2);
  
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.6);
  --color-text-tertiary: rgba(255, 255, 255, 0.4);
  
  --color-accent: #c9a55a;
  --color-accent-light: #e6c980;
  --color-accent-dark: #a68940;
  
  --color-success: #4ade80;
  --color-error: #f87171;
  --color-warning: #fbbf24;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #c9a55a 0%, #8b7244 100%);
  --gradient-surface: linear-gradient(135deg, #1c1c28 0%, #151520 100%);
  --gradient-orb-1: radial-gradient(circle at center, rgba(201, 165, 90, 0.15) 0%, transparent 70%);
  --gradient-orb-2: radial-gradient(circle at center, rgba(139, 114, 68, 0.1) 0%, transparent 70%);
  
  /* Typography */
  --font-body: 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(201, 165, 90, 0.3);
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   Base Styles
   =================================== */

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   Background Effects
   =================================== */

.background-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: var(--gradient-orb-1);
  top: -200px;
  right: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--gradient-orb-2);
  bottom: -150px;
  left: -150px;
  animation-delay: -5s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: var(--gradient-orb-1);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* ===================================
   Login Page Styles
   =================================== */

.login-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  animation: cardEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.logo-mark {
  display: inline-flex;
  color: var(--color-accent);
  margin-bottom: var(--spacing-md);
  animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(201, 165, 90, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(201, 165, 90, 0.5));
  }
}

.login-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: var(--spacing-xs);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 300;
}

/* Form Styles */

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: 0.01em;
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--color-text-primary);
  background: var(--color-surface-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-base);
}

.form-input::placeholder {
  color: var(--color-text-tertiary);
}

.form-input:focus {
  background: rgba(28, 28, 40, 0.8);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(201, 165, 90, 0.1);
}

.input-border {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-base);
  border-radius: 2px;
}

.form-input:focus + .input-border {
  width: 100%;
}

.submit-button {
  margin-top: var(--spacing-sm);
  padding: 1.125rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--color-bg);
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

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

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

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

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.button-text {
  display: inline-block;
  transition: opacity var(--transition-fast);
}

.button-loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-bg);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.submit-button.loading .button-text {
  opacity: 0;
}

.submit-button.loading .button-loader {
  display: block;
}

.error-message {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--color-error);
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-sm);
  display: none;
  animation: shake 0.4s;
}

.error-message.show {
  display: block;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

.login-footer {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer-text {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.footer-text::before {
  content: '🔒';
  font-size: 1rem;
}

/* ===================================
   Dashboard Page Styles
   =================================== */

.dashboard-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: var(--spacing-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-header {
  margin-bottom: var(--spacing-xl);
  animation: fadeInDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--color-accent);
}

.header-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
}

.logout-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
}

.logout-button:hover {
  color: var(--color-text-primary);
  border-color: var(--color-border-focus);
  background: var(--color-surface-light);
}

.dashboard-main {
  animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

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

.welcome-section {
  margin-bottom: var(--spacing-xl);
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: var(--spacing-xs);
  color: var(--color-text-primary);
}

.welcome-title span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  font-weight: 300;
}

/* Stats Grid */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  position: relative;
  padding: var(--spacing-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  overflow: hidden;
  transition: all var(--transition-base);
  animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-fill-mode: both;
}

.stat-card:nth-child(1) {
  animation-delay: 0.3s;
}

.stat-card:nth-child(2) {
  animation-delay: 0.4s;
}

.stat-card:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-focus);
  box-shadow: var(--shadow-md);
}

.stat-decoration {
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(201, 165, 90, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.stat-icon {
  display: inline-flex;
  padding: 0.75rem;
  background: rgba(201, 165, 90, 0.1);
  border-radius: var(--radius-sm);
  color: var(--color-accent);
  margin-bottom: var(--spacing-md);
}

.stat-content {
  position: relative;
  z-index: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}

.balance-card .stat-value {
  color: var(--color-accent);
}

.stat-unit {
  font-size: 0.875rem;
  color: var(--color-text-tertiary);
}

.stat-badge {
  display: inline-block;
  margin-top: var(--spacing-xs);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-badge.success {
  background: rgba(74, 222, 128, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.stat-badge.warning {
  background: rgba(251, 191, 36, 0.1);
  color: var(--color-warning);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.stat-badge.error {
  background: rgba(248, 113, 113, 0.1);
  color: var(--color-error);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

/* Info Section */

.info-section {
  padding: var(--spacing-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: var(--spacing-md);
  color: var(--color-text-primary);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--spacing-md);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

.info-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--color-border-focus);
}

.info-label {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.info-value {
  font-size: 1rem;
  color: var(--color-text-primary);
  font-weight: 400;
}

/* Responsive Design */

@media (max-width: 768px) {
  :root {
    --spacing-xl: 2rem;
    --spacing-lg: 1.5rem;
  }

  .login-card {
    padding: var(--spacing-lg);
  }

  .login-title {
    font-size: 1.75rem;
  }

  .welcome-title {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-container {
    padding: var(--spacing-md);
  }
}

/* ===================================
   RED THEME - Baccarat AI Login
   =================================== */

.login-red-theme {
  background: radial-gradient(ellipse at top, #4a0e15 0%, #2a0508 50%, #1a0305 100%);
}

.login-red-theme .gradient-orb {
  filter: blur(100px);
}

.login-red-theme .orb-1 {
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
}

.login-red-theme .orb-2 {
  background: radial-gradient(circle at center, rgba(139, 0, 0, 0.2) 0%, transparent 70%);
}

.login-red-theme .orb-3 {
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
}

.login-red-theme .login-card {
  background: linear-gradient(180deg, rgba(90, 20, 30, 0.95) 0%, rgba(60, 15, 20, 0.95) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 
              0 0 40px rgba(139, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* AI Logo */
.ai-logo {
  display: inline-flex;
  margin-bottom: 1.5rem;
  animation: aiGlow 3s ease-in-out infinite;
}

@keyframes aiGlow {
  0%, 100% {
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 24px rgba(212, 175, 55, 0.6));
  }
}

.login-red-theme .login-title {
  font-family: 'Prompt', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.login-red-theme .login-subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: rgba(212, 175, 55, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Form Inputs - Red Theme */
.login-red-theme .form-input {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(200, 200, 200, 0.5);
  border-radius: 12px;
  color: #2a0508;
  font-weight: 500;
  padding: 1rem 1.25rem;
  font-size: 1rem;
}

.login-red-theme .form-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.login-red-theme .form-input:focus {
  background: #ffffff;
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
  outline: none;
}

/* Form Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  user-select: none;
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #d4af37;
}

.remember-me:hover {
  color: #ffffff;
}

.forgot-password {
  color: rgba(212, 175, 55, 0.9);
  text-decoration: none;
  transition: all 0.2s;
}

.forgot-password:hover {
  color: #d4af37;
  text-decoration: underline;
}

/* Submit Button - Red Theme */
.login-red-theme .submit-button {
  background: linear-gradient(180deg, #d4af37 0%, #b8941f 100%);
  color: #2a0508;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-red-theme .submit-button::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.login-red-theme .submit-button:hover {
  background: linear-gradient(180deg, #e6c547 0%, #c9a529 100%);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
  transform: translateY(-2px);
}

.login-red-theme .submit-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

/* Footer - Red Theme */
.login-red-theme .footer-text {
  color: rgba(255, 255, 255, 0.5);
}

.login-red-theme .footer-text::before {
  content: '🔒';
  filter: grayscale(0.3);
}

/* Error Message - Red Theme */
.login-red-theme .error-message {
  background: rgba(255, 100, 100, 0.15);
  border: 1px solid rgba(255, 100, 100, 0.3);
  color: #ff6464;
}

/* Remove input border animation for red theme */
.login-red-theme .input-border {
  display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .login-red-theme .login-title {
    font-size: 1.5rem;
  }
  
  .login-red-theme .login-subtitle {
    font-size: 0.875rem;
  }
  
  .ai-logo svg {
    width: 48px;
    height: 48px;
  }
  
  .form-options {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
}

/* Login Brand Text */
.login-red-theme .login-brand {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(212, 175, 55, 0.8);
  margin-top: 0.25rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Adjust subtitle spacing */
.login-red-theme .login-subtitle {
  font-size: 0.9rem;
  margin-bottom: 0;
}

.login-red-theme .login-title {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

/* LSM2PLAY Logo Image */
.logo-img {
  height: 80px;
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

@media (max-width: 768px) {
  .logo-img {
    height: 64px;
  }
}
