/* ===============================
   1. CORE VARIABLES & RESET
=============================== */
:root {
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  --primary: #d32f2f; /* Classy Red */
  --primary-hover: #b71c1c;
  --text-main: #1a1a1a;
  --text-muted: #666;
  --bg-body: #f0f2f5;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
  --glass-bg: rgba(18, 18, 18, 0.65);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --text-main: #f0f0f0;
  --text-muted: #aaa;
  --bg-body: #0a0a0a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; height: 100%; /* Fix for sticky footer */ }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  /* FIX: Adjusted min-height to account for fixed header padding */
  min-height: calc(100vh - 90px); 
  padding-top: 90px;
  transition: background 0.5s ease, color 0.5s ease;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* Prevent horizontal scroll on resize */
}

/* ===============================
   2. SIDEBAR & NAVBAR
=============================== */
.navbar {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
  width: 96%; max-width: 1400px; display: flex; justify-content: space-between;
  align-items: center; padding: 12px 24px; z-index: 1000;
}

.nav-left { display: flex; align-items: center; gap: 15px; }
.nav-logo { height: 45px; width: auto; border-radius: var(--radius-sm); }
.powered-box { border-left: 2px solid var(--text-muted); padding-left: 12px; }
.powered { font-size: 0.65rem; font-weight: 600; opacity: 0.8; text-transform: uppercase; }

.nav-right { display: flex; align-items: center; gap: 20px; }

/* Theme Toggle */
.toggle-btn {
  border: none; width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; background: rgba(0,0,0,0.05); color: var(--text-main);
  display: flex; align-items: center; justify-content: center; transition: 0.3s;
  z-index: 1001; /* Ensure clickable */
}
[data-theme="dark"] .toggle-btn { background: rgba(255,255,255,0.1); }
.toggle-btn:hover { transform: rotate(15deg) scale(1.1); background: var(--primary); color: white; }

/* Hamburger */
.hamburger-btn {
  font-size: 1.4rem; background: transparent; border: none; cursor: pointer;
  color: var(--text-main); transition: 0.3s; padding-right: 10px;
}
.hamburger-btn:hover { color: var(--primary); }

/* Sidebar */
.sidebar {
  position: fixed; top: 0; left: -300px; width: 280px; height: 100vh;
  z-index: 2000; padding: 25px;
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border-right: 1px solid var(--glass-border);
  transition: left 0.4s cubic-bezier(0.77, 0, 0.175, 1);
  box-shadow: 4px 0 25px rgba(0,0,0,0.2);
}
.sidebar.open { left: 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 1px solid var(--glass-border); padding-bottom: 15px; }
.close-sidebar { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-main); }
.sidebar-logo-text { font-weight: 700; font-size: 1.2rem; color: var(--primary); }

.sidebar-list { list-style: none; padding: 0; }
.sidebar-list li a {
  display: flex; align-items: center; gap: 12px; padding: 14px 0;
  color: var(--text-main); font-weight: 500; text-decoration: none;
  transition: 0.2s;
}
.sidebar-list li a:hover { color: var(--primary); transform: translateX(5px); }

.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px); display: none; z-index: 1500; opacity: 0; transition: 0.3s;
}
.sidebar-overlay.show { display: block; opacity: 1; }

/* ===============================
   3. GLASS & LAYOUT
=============================== */
.glass {
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); box-shadow: var(--glass-shadow);
}

.container {
  width: 90%; max-width: 1200px; margin: 40px auto;
  display: grid; grid-template-columns: 1fr; gap: 40px; flex: 1;
}

@media(min-width: 900px) {
  .container { grid-template-columns: 1.2fr 0.8fr; }
}

/* ===============================
   4. REGISTRATION STYLES
=============================== */
.register-card { padding: 2.5rem; }
.reg-title { text-align: center; font-size: 1.8rem; font-weight: 700; margin-bottom: 2.5rem; color: var(--text-main); position: relative; display: inline-block; left: 50%; transform: translateX(-50%); }
.reg-title::after { content: ''; display: block; width: 40px; height: 4px; background: var(--primary); margin: 10px auto 0; border-radius: 2px; }

.field { margin-bottom: 1.5rem; }
.field label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; color: var(--text-muted); margin-bottom: 0.5rem; }

.form-input {
  width: 100%; padding: 12px 0; font-size: 1rem; color: var(--text-main);
  background: transparent; border: none; border-bottom: 2px solid #cbd5e1;
  outline: none; transition: 0.3s; font-family: inherit;
}
.form-input:focus { border-bottom-color: var(--primary); }
.form-input::placeholder { color: #cbd5e1; font-style: italic; }

select.form-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d32f2f' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.762L10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0 center;
}

/* Buttons */
.btn { width: 100%; padding: 14px; font-size: 1rem; font-weight: 600; border: none; border-radius: var(--radius-md); cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px; }
.wa-btn { background: #25D366; color: white; margin-bottom: 1rem; }
.wa-btn:hover { background: #1ebc57; }
.submit-btn { background: var(--primary); color: white; margin-top: 1rem; }
.submit-btn:hover:not(:disabled) { background: var(--primary-hover); }
.submit-btn:disabled { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; }

.pulse { animation: pulse-green 2s infinite; }
@keyframes pulse-green { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); } }

/* Info & Terms */
.info-note { font-size: 0.85rem; color: var(--text-muted); background: rgba(0,0,0,0.05); padding: 15px; border-radius: 8px; border-left: 4px solid #25D366; margin: 1.5rem 0; }
[data-theme="dark"] .info-note { background: rgba(255,255,255,0.05); }
.terms-row { display: flex; align-items: center; gap: 10px; margin-bottom: 1.5rem; font-size: 0.9rem; cursor: pointer; }
.terms-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.terms-row a { color: var(--primary); font-weight: 600; }

/* ===============================
   5. GENERATOR STYLES (Sized for Desktop)
=============================== */
.wa-card { 
  padding: 2rem; 
  display: flex; 
  flex-direction: column; 
  justify-content: flex-start; /* Align top */
  height: fit-content; /* Don't stretch to bottom */
}

.wa-header { text-align: center; margin-bottom: 20px; }
.wa-header h2 { font-size: 1.5rem; color: var(--primary); margin-bottom: 5px; }
.wa-header p { font-size: 0.9rem; color: var(--text-muted); }

.input-group { display: flex; gap: 10px; margin-bottom: 15px; }
.country-select {
  width: 110px; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.5); color: var(--text-main); font-size: 0.9rem; outline: none; cursor: pointer;
}
[data-theme="dark"] .country-select { background: rgba(0,0,0,0.3); color: white; }

.wa-input {
  flex: 1; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.5); color: var(--text-main); font-family: inherit; outline: none;
}
[data-theme="dark"] .wa-input { background: rgba(0,0,0,0.3); color: white; }
.wa-input:focus { border-color: #25D366; }

.result-box { margin-top: 20px; padding: 15px; background: rgba(255,255,255,0.1); border-radius: var(--radius-md); border: 1px dashed var(--glass-border); display: none; animation: fadeIn 0.5s ease; }
[data-theme="dark"] .result-box { background: rgba(0,0,0,0.2); }
.result-link { width: 100%; padding: 10px; margin-bottom: 10px; background: transparent; border: 1px solid var(--glass-border); border-radius: var(--radius-sm); color: var(--primary); font-size: 0.9rem; }
.btn-copy { background: #007bff; color: white; width: auto; padding: 0 15px; }

/* ===============================
   6. FOOTER & OVERLAYS
=============================== */
footer { 
  width: 100%; 
  padding: 50px 20px 30px; 
  margin-top: 0; /* Removed margin to ensure flush bottom */
  background: rgba(0,0,0,0.8); 
  color: white; 
  backdrop-filter: blur(10px); 
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto 40px; }
.footer-col h4 { margin: 0 0 20px; color: var(--primary); font-size: 1.1rem; }
.footer-link { text-decoration: none; color: #ccc; opacity: 0.7; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; transition: 0.3s; }
.footer-link:hover { opacity: 1; color: var(--primary); transform: translateX(5px); }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; max-width: 800px; margin: 0 auto; font-size: 0.85rem; opacity: 0.6; }

.success-overlay { position: fixed; inset: 0; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px); z-index: 3000; display: none; align-items: center; justify-content: center; opacity: 0; transition: 0.3s; }
.success-overlay.active { opacity: 1; }
.success-box { text-align: center; }
.checkmark { width: 80px; height: 80px; background: #25D366; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin: 0 auto 1.5rem; }
.anim-pop { animation: pop 0.6s ease forwards; }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.joined-status { text-align: center; color: #25D366; font-weight: 700; margin-bottom: 1.5rem; font-size: 1.1rem; }
.footer-link i:hover,
div a i:hover {
  opacity: 0.7;
  transform: scale(1.1);
}
/* Footer full stretch fix for small screens */

@media (max-width: 600px) {
  body {
    /* On mobile, reduce the body calculation gap slightly to fit better */
    min-height: calc(100vh - 85px);
  }

  footer {
    padding-left: 10px;
    padding-right: 10px;
  }

  .footer-grid {
    width: 100%;
    max-width: 100%;
  }
}
