/* 
=====================================================================
1. GLOBAL & CORE SYSTEM STYLES
=====================================================================
*/
:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Modern Professional Dark Emerald Theme */
  --bg-dark: #0b1311; 
  --card-bg: rgba(16, 27, 24, 0.85); 
  --card-border: rgba(16, 185, 129, 0.12); 
  --card-border-glow: rgba(16, 185, 129, 0.25); 
  
  /* Primary Action Colors (Refined Sage & Forest Emerald) */
  --primary-accent: #10b981;
  --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --primary-hover: linear-gradient(135deg, #059669 0%, #047857 100%);
  
  /* Secondary Accent (Tactical Bronze / Warm Slate) */
  --secondary-accent: #d97706;
  --secondary-gradient: linear-gradient(135deg, #d97706 0%, #b45309 100%);

  /* Golden/Amber Accent for PTB Hub Promo */
  --gold-accent: #f59e0b;
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gold-hover: linear-gradient(135deg, #d97706 0%, #b45309 100%);

  /* Surface Buttons (Minimal Slate Tint) */
  --surface-btn: rgba(255, 255, 255, 0.03); 
  --surface-btn-border: rgba(255, 255, 255, 0.08); 
  --surface-btn-hover: rgba(16, 185, 129, 0.12); 

  --input-bg: rgba(6, 11, 10, 0.9);
  --text-main: #f8fafc;
  --text-muted: #94a3b8; 
  --text-dim: #64748b; 

  --danger-color: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 50% 100%, rgba(217, 119, 6, 0.05) 0%, transparent 60%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 40px 20px;
}

/* Container wrapper for desktop side-by-side grid layout */
.app-layout-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

/* 
=====================================================================
2. HEADER SECTION (<header class="app-header">)
=====================================================================
*/
.app-header {
  text-align: center;
  margin-bottom: 24px;
  width: 100%;
  max-width: 520px;
}

/* Top Navigation Bar (Home & Share Buttons) */
.top-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  width: 100%;
}

.top-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface-btn);
  border: 1px solid var(--surface-btn-border);
  border-radius: 99px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-nav-btn svg {
  stroke: var(--primary-accent);
}

.top-nav-btn:hover {
  background: var(--surface-btn-hover);
  border-color: var(--card-border-glow);
  color: var(--text-main);
  transform: translateY(-1px);
}

.top-nav-btn:active {
  transform: translateY(0);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03); 
  border: 1px solid var(--card-border);
  padding: 8px 18px;
  border-radius: 99px;
  margin-bottom: 14px;
  backdrop-filter: blur(12px);
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand-title {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.version-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-accent);
  background: rgba(16, 185, 129, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.app-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 460px;
  line-height: 1.5;
  margin: 0 auto;
}

.credits-box {
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

.credits-box span {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  font-weight: 600;
}

.credits-link {
  color: var(--secondary-accent);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.credits-link:hover {
  color: #fbbf24;
}

/* 
=====================================================================
3. MAIN GENERATOR CARD (<main class="app-card">)
=====================================================================
*/
.app-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  box-shadow: 
    0 20px 40px -15px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  backdrop-filter: blur(16px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.app-card:hover {
  border-color: var(--card-border-glow);
  box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.9);
}

.method-helper-text {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.02); 
  border: 1px dashed rgba(255, 255, 255, 0.08); 
  padding: 10px 14px;
  border-radius: 10px;
}

.method-helper-text strong {
  color: var(--text-main);
}

.form-group {
  margin-bottom: 20px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.field-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.char-counter {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
}

.select-wrapper select,
.input-wrapper input {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.1); 
  border-radius: 12px;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.select-wrapper select {
  padding: 14px 16px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  padding: 14px 42px 14px 16px;
}

.select-wrapper select:focus,
.input-wrapper input:focus {
  border-color: var(--primary-accent); 
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.inline-clear-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.inline-clear-btn:hover {
  color: var(--danger-color);
}

.quick-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface-btn);
  border: 1px solid var(--surface-btn-border);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  background: var(--surface-btn-hover);
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

/* Important Note Box */
.important-note-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.note-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fca5a5;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.important-note-box p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.important-note-box strong {
  color: #ffffff;
}

.primary-action-container {
  display: flex;
  flex-direction: column;
}

/* Modern Professional Primary Button */
.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 
    0 4px 14px 0 rgba(16, 185, 129, 0.39),
    0 1px 2px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 
    0 8px 25px 0 rgba(16, 185, 129, 0.5),
    0 2px 4px 0 rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px 0 rgba(16, 185, 129, 0.3);
}

/* 
=====================================================================
4. PROMO BANNER CARD (<aside class="promo-card">)
=====================================================================
*/
.promo-card {
  background: var(--card-bg); 
  border: 1px solid rgba(245, 158, 11, 0.2); 
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

.promo-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 12px 30px -10px rgba(245, 158, 11, 0.15);
}

.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.1);
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  margin-bottom: 14px;
}

.live-dot {
  width: 7px;
  height: 7px;
  background-color: #f59e0b;
  border-radius: 50%;
  box-shadow: 0 0 8px #f59e0b;
}

.promo-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.promo-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.promo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--gold-gradient);
  border-radius: 12px;
  color: #1c1000;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 18px -3px rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
}

.promo-btn:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
}

/* 
=====================================================================
5. NOTIFICATIONS (<div id="toast" class="toast">)
=====================================================================
*/
.toast {
  visibility: hidden;
  min-width: 240px;
  background-color: var(--primary-accent);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
  border-radius: 10px;
  padding: 14px 20px;
  position: fixed;
  z-index: 100;
  top: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  font-size: 0.9rem;
  opacity: 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 
=====================================================================
6. FOOTER STYLING (.app-footer)
=====================================================================
*/
.app-footer {
  margin-top: 40px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-powered {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 6px;
  margin-bottom: 10px;
}

.credit-link, .footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.credit-link:hover, .footer-links a:hover {
  color: var(--primary-accent);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 
=====================================================================
7. RESPONSIVE MEDIA QUERIES
=====================================================================
*/
@media (min-width: 850px) {
  body {
    padding: 60px 40px;
  }

  .app-header {
    margin-bottom: 36px;
    max-width: 960px;
  }

  .brand-title {
    font-size: 1.6rem;
  }

  .app-subtitle {
    font-size: 1.05rem;
  }

  /* Expand Layout to 2 columns on Desktop */
  .app-layout-wrapper {
    max-width: 960px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
    gap: 32px;
  }

  .app-card {
    padding: 32px;
  }

  .promo-card {
    padding: 32px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}
