/* ==========================================================================
   OLX MONITOR TELEGRAM MINI APP DESIGN SYSTEM
   Theme: OLX Dark Navy (#002f34) + Electric Turquoise (#23e5db) + Warm Gold (#ffce32)
   ========================================================================== */

:root {
  --bg-color: #002f34;
  --bg-gradient: radial-gradient(circle at 50% 0%, #004d55 0%, #002f34 100%);
  --surface-color: #053c43;
  --surface-hover: #084952;
  --surface-border: rgba(35, 229, 219, 0.15);
  
  --primary-turquoise: #23e5db;
  --primary-hover: #1cd4ca;
  --accent-yellow: #ffce32;
  
  --text-main: #ffffff;
  --text-muted: #9bb3b6;
  --text-dim: #6c8a8e;

  --danger-color: #ff4d4d;
  --danger-bg: rgba(255, 77, 77, 0.12);
  
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(35, 229, 219, 0.25);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  padding: 16px;
  display: flex;
  justify-content: center;
}

.app-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 30px;
}

/* ==========================================================================
   HEADER & USER BADGE
   ========================================================================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-turquoise), var(--accent-yellow));
  color: #002f34;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(35, 229, 219, 0.3);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-greeting {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(35, 229, 219, 0.1);
  border: 1px solid var(--surface-border);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-turquoise);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary-turquoise);
  box-shadow: 0 0 8px var(--primary-turquoise);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   STATS CARD
   ========================================================================== */
.stats-card {
  background: rgba(5, 60, 67, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: var(--shadow-card);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-turquoise);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--surface-border);
}

/* ==========================================================================
   SECTION HEADER & BUTTONS
   ========================================================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.add-btn-primary {
  background: var(--accent-yellow);
  color: #002f34;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(255, 206, 50, 0.3);
}

.add-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 206, 50, 0.45);
}

.add-btn-primary:active {
  transform: scale(0.97);
}

/* ==========================================================================
   FILTERS LIST & CARDS
   ========================================================================== */
.filters-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.filter-card:hover {
  border-color: rgba(35, 229, 219, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.filter-name-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.filter-date {
  font-size: 12px;
  color: var(--text-dim);
}

/* TOGGLE SWITCH */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
  background-color: var(--primary-turquoise);
}

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #002f34;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.olx-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary-turquoise);
  text-decoration: none;
  font-weight: 500;
  max-width: 75%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.olx-link:hover {
  text-decoration: underline;
}

.delete-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.delete-btn:hover {
  color: var(--danger-color);
  background: var(--danger-bg);
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: rgba(5, 60, 67, 0.3);
  border: 1px dashed var(--surface-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  width: 60px;
  height: 60px;
  background: rgba(35, 229, 219, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-turquoise);
}

.empty-state h4 {
  font-size: 16px;
  font-weight: 600;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
}

/* LOADING SPINNER */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 16px;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(35, 229, 219, 0.2);
  border-top-color: var(--primary-turquoise);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 20, 23, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #053b42;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

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

.modal-header h4 {
  font-size: 18px;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input {
  background: rgba(0, 47, 52, 0.6);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus {
  border-color: var(--primary-turquoise);
  box-shadow: 0 0 10px rgba(35, 229, 219, 0.2);
}

.input-hint {
  font-size: 11px;
  color: var(--text-dim);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.btn-primary {
  background: var(--primary-turquoise);
  color: #002f34;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: none;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.delete-modal {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.delete-icon-box {
  width: 56px;
  height: 56px;
  background: var(--danger-bg);
  color: var(--danger-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.delete-modal h4 {
  font-size: 18px;
  margin-bottom: 8px;
}

.delete-modal p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  width: 90%;
  max-width: 400px;
}

/* ==========================================================================
   MULTI-URL BADGES AND DYNAMIC INPUTS
   ========================================================================== */
.url-inputs-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.url-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.url-input-row input {
  flex: 1;
}

.btn-remove-url-row {
  background: var(--danger-bg);
  color: var(--danger-color);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.btn-remove-url-row:hover {
  background: var(--danger-color);
  color: white;
}

.btn-add-url-row {
  background: rgba(35, 229, 219, 0.08);
  border: 1px dashed var(--surface-border);
  color: var(--primary-turquoise);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  transition: var(--transition);
}

.btn-add-url-row:hover {
  background: rgba(35, 229, 219, 0.18);
  border-color: var(--primary-turquoise);
}

/* URL PILLS / BADGES IN FILTER CARD */
.urls-list-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.urls-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.urls-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-add-url-to-filter {
  background: rgba(35, 229, 219, 0.1);
  color: var(--primary-turquoise);
  border: 1px solid var(--surface-border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.btn-add-url-to-filter:hover {
  background: var(--primary-turquoise);
  color: #002f34;
}

.url-pill {
  background: rgba(0, 47, 52, 0.6);
  border: 1px solid rgba(35, 229, 219, 0.2);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: var(--transition);
}

.url-pill:hover {
  border-color: var(--primary-turquoise);
  background: rgba(0, 47, 52, 0.9);
}

.url-pill-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.url-pill-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.url-pill-badge:hover {
  color: var(--primary-turquoise);
  text-decoration: underline;
}

.url-delete-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.url-delete-btn:hover {
  color: var(--danger-color);
  background: var(--danger-bg);
}
