
/* 🚫 FULL LOCKDOWN: No scrolling, no overscroll, perfect fit */
html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  height: 100vh;
  max-height: 100vh;
  width: 100vw;
  max-width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
}

/* Optional: container centriranje ako je potrebno */
#app, .app, main {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}


/* 🔒 PWA viewport & touch lockdown */
html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  height: 100%;
  width: 100%;
}

/* ✅ dozvoli skrol samo gde eksplicitno zelis */
.scrollable {
  overflow-y: auto;
  touch-action: pan-y;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
}

/* Layout */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

h1 {
  color: #ff6b35;
  font-size: 3rem;
  font-weight: bold;
}

.subtitle {
  color: #888;
  margin-bottom: 2rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* User / auth UI */
.user-name {
  font-size: 0.85rem;
  color: #e0e0e0;
  text-align: right;
}

.user-picture-wrapper {
  position: relative;
  cursor: pointer;
}

.user-picture {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #ff6b35;
  object-fit: cover;
}

.hidden {
  display: none !important;
}

.user-menu {
  position: absolute;
  top: 50px;
  right: 0;
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 12px;
  padding: 1rem;
  min-width: 280px;
  z-index: 100;
}

.stats-section h3 {
  color: #ff6b35;
  margin-bottom: 1rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #333;
}

.stat-item.small {
  font-size: 0.85rem;
}

.stat-item.highlight .stat-label {
  color: #ff6b35;
}

.stat-label {
  color: #888;
  font-size: 0.85rem;
}

.stat-value {
  color: #e0e0e0;
  font-weight: 600;
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* Menu buttons */
.analytics-btn,
.upgrade-btn,
#logoutBtn,
.subscription-btn {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 0.5rem;
  border: none;
}

.analytics-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.upgrade-btn {
  background: #ff6b35;
  color: #0a0a0a;
}

#logoutBtn {
  background: #333;
  color: #e0e0e0;
}

.subscription-btn {
  background: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #444;
  font-size: 14px;
  transition: all 0.2s;
}

.subscription-btn:hover {
  background: #333;
  border-color: #ff6b35;
}

/* Main input */
.input-group input {
  width: 100%;
  padding: 1rem;
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 12px;
  color: #e0e0e0;
  font-size: 1rem;
}

/* Controls */
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 1rem 0 1.5rem;
  align-items: flex-start;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #888;
  font-size: 0.9rem;
}

.controls select {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #e0e0e0;
}

#countLabel {
  overflow: hidden;
}

@media (max-width: 768px) {
  .controls {
    grid-template-columns: 1fr;
  }
}

/* Summarize button */
#summarizeBtn {
  width: 100%;
  padding: 1rem;
  background: #ff6b35;
  color: #0a0a0a;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: bold;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#summarizeBtn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Result / loading */
.result {
  background: #1a1a1a;
  padding: 1.5rem;
  border-radius: 12px;
  border: 2px solid #333;
  margin-top: 1rem;
}

.copy-btn {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: #333;
  color: #e0e0e0;
  border: none;
  border-radius: 8px;
  display: none !important;
}

.loading {
  text-align: center;
  padding: 2rem;
}

.spinner {
  border: 4px solid #333;
  border-top: 4px solid #ff6b35;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Auth */
.login-required {
  text-align: center;
  padding: 3rem 1rem;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  color: #333;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 1rem;
}

/* Quota display */
.quota-display-header {
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  margin-right: 1rem;
}

.quota-ok {
  background: #1a3a1a;
  color: #7fc97f;
}

.quota-warning {
  background: #3a2a1a;
  color: #f9c74f;
}

.quota-exceeded {
  background: #3a1a1a;
  color: #ff6b6b;
}

/* Batch mode */
.batch-toggle {
  text-align: center;
  margin: 1rem 0;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  width: 50px;
  height: 26px;
  background: #333;
  border-radius: 26px;
  position: relative;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: #ff6b35;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.toggle-label {
  font-size: 0.9rem;
  color: #e0e0e0;
}

.batch-input textarea {
  width: 100%;
  padding: 1rem;
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 12px;
  color: #e0e0e0;
  font-family: monospace;
  resize: vertical;
}

.batch-info {
  text-align: right;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #888;
}

/* Install button */
.install-btn {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  color: #ff6b35;
  border: 2px solid #333;
  border-radius: 12px;
  font-weight: 600;
  margin-bottom: 1rem;
}

@media (display-mode: standalone) {
  .install-btn {
    display: none !important;
  }
}
\n
/* Analytics modal restore */
.modal,
.analytics-modal,
#analyticsModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.7);
}

/* respect .hidden utility */
.modal.hidden,
.analytics-modal.hidden,
#analyticsModal.hidden {
  display: none !important;
}

.modal-content,
.analytics-modal-content,
#analyticsModal .modal-inner {
  width: 100%;
  max-width: 520px;
  background: #111;
  border-radius: 16px;
  border: 1px solid #333;
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ff6b35;
}

.modal-close-btn {
  border: none;
  background: transparent;
  color: #aaa;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  font-size: 0.9rem;
  color: #ddd;
  max-height: 60vh;
  overflow-y: auto;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.analytics-card {
  background: #181818;
  border-radius: 10px;
  padding: 0.75rem;
  border: 1px solid #262626;
}

.analytics-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 0.25rem;
}

.analytics-card-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e0e0e0;
}

.analytics-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.analytics-detail-table th,
.analytics-detail-table td {
  padding: 0.4rem 0.3rem;
  border-bottom: 1px solid #222;
}

.analytics-detail-table th {
  text-align: left;
  color: #aaa;
  font-weight: 500;
}

.analytics-detail-table tr:hover {
  background: #141414;
}
\n
/* ANALYTICS MODAL - FINAL HARD FIX */
#analyticsModal.analytics-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.9) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  padding: 20px !important;
}

#analyticsModal.hidden {
  display: none !important;
}

#analyticsModal .analytics-content {
  background: #1a1a1a !important;
  border-radius: 16px !important;
  width: 100% !important;
  max-width: 1200px !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  border: 2px solid #333 !important;
  position: relative !important;
  margin: 0 auto !important;
}

#analyticsModal .analytics-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 1.5rem 2rem !important;
  border-bottom: 2px solid #333 !important;
  position: sticky !important;
  top: 0 !important;
  background: #1a1a1a !important;
  z-index: 10 !important;
}

#analyticsModal .analytics-header h2 {
  margin: 0 !important;
  color: #ff6b35 !important;
}

#analyticsModal .close-btn {
  background: none !important;
  border: none !important;
  color: #888 !important;
  font-size: 2rem !important;
  cursor: pointer !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 8px !important;
}

#analyticsModal .close-btn:hover {
  background: #333 !important;
  color: #fff !important;
}

#analyticsModal .analytics-body {
  padding: 2rem !important;
}

#analyticsModal .chart-container {
  background: #0a0a0a !important;
  padding: 1.5rem !important;
  border-radius: 12px !important;
  border: 1px solid #333 !important;
  margin-bottom: 2rem !important;
  width: 100% !important;
}

#analyticsModal .chart-container h3 {
  margin: 0 0 1rem 0 !important;
  color: #e0e0e0 !important;
}

#analyticsModal .chart-container canvas {
  width: 100% !important;
  height: 300px !important;
}

#analyticsModal .stats-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap: 1rem !important;
  margin-bottom: 2rem !important;
}

#analyticsModal .stat-card {
  background: #0a0a0a !important;
  padding: 1.5rem !important;
  border-radius: 12px !important;
  border: 1px solid #333 !important;
  text-align: center !important;
}

#analyticsModal .stat-card h4 {
  margin: 0 0 0.5rem 0 !important;
  color: #888 !important;
  font-size: 0.9rem !important;
  font-weight: normal !important;
}

#analyticsModal .stat-big {
  font-size: 2rem !important;
  font-weight: bold !important;
  color: #ff6b35 !important;
}

@media (max-width: 768px) {
  #analyticsModal .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #analyticsModal .stat-big {
    font-size: 1.5rem !important;
  }
}


/* === SCROLL FIX === */
html, body {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
