@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ==========================================
   CSS CUSTOM VARIABLES & THEME
   ========================================== */
:root {
  --bg-primary: hsl(224, 25%, 8%);
  --bg-secondary: hsl(224, 25%, 12%);
  --card-bg: hsla(224, 25%, 14%, 0.7);
  --card-border: hsla(224, 25%, 26%, 0.55);
  
  --text-primary: hsl(0, 0%, 96%);
  --text-secondary: hsl(224, 15%, 72%);
  --text-muted: hsl(224, 12%, 52%);
  
  --accent-cyan: hsl(180, 100%, 46%);
  --accent-cyan-glow: hsla(180, 100%, 46%, 0.3);
  --accent-whatsapp: hsl(142, 70%, 45%);
  --accent-whatsapp-dark: hsl(142, 75%, 35%);
  --accent-telegram: hsl(203, 92%, 50%);
  --accent-telegram-dark: hsl(203, 95%, 40%);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ==========================================
   BASE STYLES & RESET
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  padding: 20px;
}

/* Ambient glow blobs in background */
.bg-blob {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.15;
}

.blob-1 {
  background-color: var(--accent-cyan);
  top: -10%;
  left: -10%;
  animation: float 20s infinite alternate;
}

.blob-2 {
  background-color: var(--accent-telegram);
  bottom: -10%;
  right: -10%;
  animation: float 25s infinite alternate-reverse;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 30px) scale(1.15); }
}

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

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 15px var(--accent-cyan-glow); }
  100% { box-shadow: 0 0 25px rgba(180, 100%, 46%, 0.55); }
}

/* ==========================================
   BANNER COMPONENT
   ========================================== */
.banner {
  width: 100%;
  max-width: 600px;
  background: linear-gradient(135deg, hsla(224, 25%, 16%, 0.85), hsla(224, 25%, 10%, 0.85));
  border: 1px solid var(--accent-cyan);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 10px var(--accent-cyan-glow);
  backdrop-filter: blur(12px);
  animation: slideDown 0.5s ease-out forwards;
  z-index: 10;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-grow: 1;
}

.banner-icon {
  background: var(--accent-cyan-glow);
  color: var(--accent-cyan);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.banner-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.4;
  font-weight: 500;
}

.banner-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  margin-left: 12px;
}

.banner-close:hover {
  color: var(--text-primary);
}

/* ==========================================
   GLASS CARD CONTAINER
   ========================================== */
.card-container {
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 36px 30px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
  animation: fadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
}

/* Header Info */
.app-logo {
  font-size: 2.2rem;
  margin-bottom: 8px;
  display: inline-block;
  animation: floatLogo 3s ease-in-out infinite alternate;
}

@keyframes floatLogo {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

.card-title {
  font-family: var(--font-title);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* QR Screen Frame */
.qr-frame-wrapper {
  margin: 0 auto 28px;
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 20px;
  padding: 6px;
  background: linear-gradient(135deg, var(--card-border) 0%, rgba(255, 255, 255, 0.05) 50%, var(--card-border) 100%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.qr-frame-wrapper:hover {
  transform: scale(1.03);
}

.qr-frame {
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.qr-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Dynamic QR placeholder style */
.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 20px;
  text-align: center;
}

.qr-placeholder-svg {
  width: 60px;
  height: 60px;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  fill: none;
  margin-bottom: 12px;
  animation: pulseScan 2.5s ease-in-out infinite;
}

@keyframes pulseScan {
  0%, 100% { opacity: 0.4; transform: scale(0.95); stroke: var(--text-muted); }
  50% { opacity: 1; transform: scale(1.05); stroke: var(--accent-cyan); filter: drop-shadow(0 0 5px var(--accent-cyan-glow)); }
}

.qr-placeholder-text {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
}

/* QR Caption instructions */
.qr-caption {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  line-height: 1.5;
  padding: 0 10px;
}

/* ==========================================
   BUTTONS & ACTIONS
   ========================================== */
.actions-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  width: 100%;
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

/* Button scaling micro-animation */
.btn:active {
  transform: scale(0.97);
}

.btn-whatsapp {
  background: linear-gradient(135deg, var(--accent-whatsapp), var(--accent-whatsapp-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.25);
}

.btn-whatsapp:hover {
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  transform: translateY(-2px);
}

.btn-telegram {
  background: linear-gradient(135deg, var(--accent-telegram), var(--accent-telegram-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(0, 136, 204, 0.25);
}

.btn-telegram:hover {
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
  transform: translateY(-2px);
}

.btn-link {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
}

.btn-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 0 12px var(--accent-cyan-glow);
}

.btn-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ==========================================
   ADMIN LAYOUT & DASHBOARD
   ========================================== */
.admin-card {
  max-width: 600px;
}

/* Login View */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: stretch;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
}

.input-field:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.btn-submit {
  background: linear-gradient(135deg, var(--accent-cyan), hsl(180, 100%, 35%));
  color: hsl(224, 25%, 8%);
  font-weight: 700;
  box-shadow: 0 4px 15px var(--accent-cyan-glow);
}

.btn-submit:hover {
  box-shadow: 0 6px 20px rgba(180, 100%, 46, 0.5);
  transform: translateY(-2px);
}

/* Admin Dashboard Elements */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.admin-header-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
}

.btn-logout {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: hsl(0, 85%, 65%);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Stats Widget */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-number {
  font-family: var(--font-title);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
  margin-bottom: 4px;
  text-shadow: 0 0 10px var(--accent-cyan-glow);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Settings Form Tabs/Section */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.setting-card {
  text-align: left;
  border-top: 1px solid var(--card-border);
  padding-top: 24px;
}

.setting-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Switch Toggle Styling */
.switch-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.switch-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--card-border);
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-cyan-glow);
  border-color: var(--accent-cyan);
}

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: var(--accent-cyan);
}

/* Drag & Drop File Zone */
.dropzone {
  border: 2px dashed var(--card-border);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-glow);
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  stroke: var(--text-secondary);
  stroke-width: 1.5;
  fill: none;
}

.dropzone-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.dropzone-fileinfo {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

.qr-mini-preview {
  margin-top: 14px;
  width: 100%;
  max-width: 150px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  display: none;
  align-self: center;
}

.qr-mini-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Toast Message */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 8px;
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 999;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
  margin-top: 36px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--accent-cyan);
  text-shadow: 0 0 5px var(--accent-cyan-glow);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 480px) {
  body {
    padding: 12px;
  }
  .card-container {
    padding: 24px 16px;
    border-radius: 20px;
  }
  .card-title {
    font-size: 1.55rem;
  }
  .qr-frame-wrapper {
    width: 220px;
    height: 220px;
  }
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)) !important;
    gap: 6px !important;
  }
  .proposal-bar > div {
    padding: 14px 16px !important;
  }
  .proposal-summary {
    font-size: 0.78rem !important;
  }
}

/* ==========================================
   CARDS GRID & INTERACTIVE SELECTION
   ========================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.card-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  position: relative;
}

.card-item:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-sm);
}

.card-item:active {
  transform: scale(0.96);
}

/* Selection Highlight Glow */
.card-item.selected {
  border-color: var(--accent-cyan) !important;
  background: var(--accent-cyan-glow) !important;
  box-shadow: 0 0 10px var(--accent-cyan-glow) !important;
}

/* Custom Tabs State */
.tab-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--card-border) !important;
  color: var(--text-primary) !important;
}

/* ==========================================
   CONTACT MODAL POPUP
   ========================================== */
.modal-overlay {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-overlay[style*="opacity: 1"] {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.modal-overlay[style*="opacity: 1"] #contact-modal-card {
  transform: scale(1) !important;
}

/* ==========================================
   FLOATING PROPOSAL BAR
   ========================================== */
.proposal-bar {
  /* Dynamic slide-up is handled via transform translateY in JS */
}

/* WhatsApp Message proposal CTA styling */
.proposal-btn {
  background: linear-gradient(135deg, var(--accent-whatsapp), var(--accent-whatsapp-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.proposal-btn:hover {
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
}

