/* EveryMailFinder Professional Styles */
:root {
  --bg: #f8f9fa;
  --panel: #ffffff;
  --muted: #6c757d;
  --ink: #212529;
  --accent: #0d6efd;
  --accent-2: #0a58ca;
  --outline: #dee2e6;
  --glass: rgba(0, 0, 0, 0.05);
  --success: #198754;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #0dcaf0;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.5;
  /* REMOVED: overflow: hidden; - This was preventing scrolling */
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Floating particles background */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.3;
  animation: float 30s infinite ease-in-out;
}

.particle-blue {
  background: rgba(13, 110, 253, 0.4);
  box-shadow: 0 0 10px rgba(13, 110, 253, 0.3);
}

.particle-green {
  background: rgba(25, 135, 84, 0.4);
  box-shadow: 0 0 10px rgba(25, 135, 84, 0.3);
}

.particle-purple {
  background: rgba(111, 66, 193, 0.4);
  box-shadow: 0 0 10px rgba(111, 66, 193, 0.3);
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(20px, 40px) rotate(5deg);
  }
  50% {
    transform: translate(-10px, 70px) rotate(-5deg);
  }
  75% {
    transform: translate(15px, 30px) rotate(3deg);
  }
}

.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background-color: #ffffff;
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--outline);
  position: relative;
  z-index: 10;
}

.left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 20px;
}

.titles .appname {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.titles .tag {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.top-nav {
  display: flex;
  margin-left: 32px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  margin-right: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--accent);
  background-color: rgba(13, 110, 253, 0.1);
}

.nav-link.active {
  background-color: var(--accent);
  color: white;
}

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

.user-menu {
  position: relative;
  display: inline-block;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--outline);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-menu-toggle:hover {
  border-color: var(--accent);
  background-color: rgba(13, 110, 253, 0.05);
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--outline);
  border-radius: 8px;
  padding: 16px;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.user-menu:hover .user-menu-dropdown {
  display: block;
}

.subscription-info {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--outline);
}

.subscription-info p {
  margin: 8px 0;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}

.subscription-info p span:last-child {
  font-weight: 500;
}

.user-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--outline);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
}

.btn.outline {
  background: transparent;
  border-color: var(--outline);
  color: var(--ink);
}

.btn.outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.main {
  flex: 1;
  padding: 24px;
  overflow: auto;
  background-color: var(--bg);
  position: relative;
  z-index: 5;
}

.panel {
  max-width: 1000px;
  margin: 0 auto 24px;
  background: var(--panel);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--outline);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 5;
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--ink);
  font-size: 20px;
}

.row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.row label {
  width: 140px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.field {
  flex: 1;
  padding: 10px 14px;
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--outline);
  color: var(--ink);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.input-num {
  width: 80px;
  text-align: center;
}

.progress-area {
  flex: 1;
}

.progress-bg {
  width: 100%;
  height: 20px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--outline);
  padding: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

/* Real-time logging styles */
.log-container {
  height: 200px;
  background: var(--bg);
  border: 1px solid var(--outline);
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  color: var(--ink);
  font-size: 13px;
  display: flex;
  flex-direction: column-reverse;
}

.log-entry {
  margin-bottom: 6px;
  padding: 4px 0;
  line-height: 1.4;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  animation: fadeIn 0.3s ease;
}

.log-timestamp {
  color: var(--muted);
  margin-right: 8px;
  font-size: 11px;
}

.log-info {
  color: var(--ink);
}

.log-success {
  color: var(--success);
}

.log-warning {
  color: var(--warning);
}

.log-error {
  color: var(--danger);
}

.log-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

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

.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Footer styling - updated to be less distracting and at bottom of content */
.footer {
  padding: 12px 24px;
  border-top: 1px solid var(--outline);
  color: var(--muted);
  font-size: 12px;
  background-color: var(--panel);
  position: relative;
  z-index: 10;
  margin-top: auto;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.legal {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.3;
}

.legal p {
  margin: 4px 0;
}

.csv-info {
  font-size: 14px;
  color: var(--muted);
  margin: -8px 0 20px;
  font-style: italic;
}

.plan-free {
  color: var(--success) !important;
  font-weight: 600;
}

.plan-premium {
  color: var(--accent) !important;
  font-weight: 600;
}

/* Loading animation */
@keyframes loadingDots {
  0%, 20% { content: "."; }
  40% { content: ".."; }
  60%, 100% { content: "..."; }
}

.loading::after {
  content: "";
  animation: loadingDots 1.5s infinite;
}

/* Cookie consent banner */
.cookie-consent {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel);
  color: var(--ink);
  padding: 16px;
  border-top: 1px solid var(--outline);
  z-index: 1000;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.cookie-content {
  flex: 1;
  min-width: 300px;
  margin-right: 16px;
}

.cookie-content h3 {
  margin: 0 0 6px 0;
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
}

.cookie-content p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.cookie-buttons {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* Status indicators */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-active {
  background-color: var(--success);
}

.status-inactive {
  background-color: var(--muted);
}

/* Responsive design */
@media (max-width: 768px) {
  .topbar {
    padding: 0 16px;
    flex-direction: column;
    height: auto;
    padding: 12px;
  }
  
  .left {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
  }
  
  .top-nav {
    margin-left: 0;
    margin-top: 8px;
    flex-wrap: wrap;
  }
  
  .main {
    padding: 16px;
  }
  
  .panel {
    padding: 20px;
  }
  
  .row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .row label {
    width: 100%;
  }
  
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .cookie-consent {
    flex-direction: column;
    text-align: center;
  }
  
  .cookie-content {
    margin-right: 0;
    margin-bottom: 12px;
    min-width: auto;
  }
  
  .user-menu-dropdown {
    width: 280px;
    right: -20px;
  }
  
  /* Footer mobile adjustments */
  .footer {
    padding: 10px 16px;
  }
  
  .legal {
    font-size: 10px;
  }
}

/* PayPal button adjustments for light theme */
.paypal-buttons {
  margin-top: 16px;
}

/* File input styling */
input[type="file"] {
  padding: 10px;
  border: 1px dashed var(--outline);
  border-radius: 8px;
  background-color: var(--bg);
  width: 100%;
  cursor: pointer;
}

input[type="file"]:hover {
  border-color: var(--accent);
  background-color: rgba(13, 110, 253, 0.05);
}

/* Table styling for future use */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.table th,
.table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--outline);
}

.table th {
  font-weight: 600;
  color: var(--ink);
  background-color: var(--bg);
}

.table tr:hover {
  background-color: var(--bg);
}