/* Modern Design System */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --border: #334155;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);

  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Header */
.header {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
}

.header-content h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 5px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  gap: 15px;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-secondary);
}

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

.btn-icon {
  font-size: 1.2rem;
}

/* Daily Count Card */
.daily-count-card {
  background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
  border-radius: var(--radius-lg);
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-lg);
  color: white;
}

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

.daily-count-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
}

.date {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

.daily-count-body {
  text-align: center;
  margin-bottom: 20px;
}

.count-display {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.count-separator {
  opacity: 0.5;
}

.count-label {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 15px;
}

.progress-bar {
  background: rgba(255, 255, 255, 0.2);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  background: white;
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Status Message */
.status-message {
  padding: 15px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

.status-message.success {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--success);
  color: var(--success);
}

.status-message.error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.status-message.info {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid var(--info);
  color: var(--info);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 15px 20px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Leads Container */
.leads-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  min-height: 400px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.leads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

/* Lead Card */
.lead-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.lead-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--success);
  transition: var(--transition);
}

.lead-card.disqualified::before {
  background: var(--danger);
}

.lead-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: var(--primary);
}

.lead-header {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.lead-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.lead-country {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.lead-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-field {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.field-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.field-value {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: right;
  max-width: 60%;
}

.lead-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-light);
}

.badge.success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.badge.auto-purchased {
  background: rgba(139, 92, 246, 0.2);
  color: var(--secondary);
  font-weight: 700;
}

/* Disqualification Reasons */
.disqualification-reasons {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.reasons-header {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.reasons-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.reasons-list li {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 6px 10px;
  margin-bottom: 5px;
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--danger);
  border-radius: 4px;
  line-height: 1.4;
}

.reasons-list li:last-child {
  margin-bottom: 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.modal-header {
  padding: 25px 30px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: 30px;
}

.modal-footer {
  padding: 20px 30px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

/* Settings Sections */
.settings-section {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.setting-item {
  margin-bottom: 20px;
}

.setting-item label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

.setting-item input[type="number"] {
  width: 100%;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

.setting-item input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary);
}

.checkbox-item label {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Warning Box */
.warning-box {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--warning);
  border-left: 4px solid var(--warning);
  color: var(--text-secondary);
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.warning-box strong {
  color: var(--warning);
  font-weight: 600;
}

/* Info Box */
.info-box {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid var(--info);
  border-left: 4px solid var(--info);
  color: var(--text-secondary);
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Schedule Configuration */
.schedule-options {
  margin-top: 15px;
  padding: 15px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.schedule-select {
  width: 100%;
  padding: 10px 15px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.schedule-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.schedule-config {
  margin-top: 15px;
  padding: 15px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.schedule-config label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

.schedule-input {
  width: 100%;
  padding: 10px 15px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 10px;
  transition: var(--transition);
}

.schedule-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.day-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.day-checkbox {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.day-checkbox:hover {
  border-color: var(--primary);
  background: var(--bg-secondary);
}

.day-checkbox input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--primary);
}

.time-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-inputs input {
  width: 80px;
  margin-bottom: 0;
}

.time-inputs span {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: bold;
}

/* Cookies Management */
.section-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 15px;
  line-height: 1.5;
}

.cookies-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.cookies-textarea {
  width: 100%;
  min-height: 200px;
  padding: 15px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
  transition: var(--transition);
}

.cookies-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.cookies-textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* Keyword/Country Input */
.keyword-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.keyword-input-group input {
  flex: 1;
  padding: 10px 15px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.keyword-input-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.tag {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.tag:hover {
  border-color: var(--primary);
}

.tag-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  transition: var(--transition);
}

.tag-remove:hover {
  transform: scale(1.2);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Loading Spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 20px;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
  }

  .leads-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-direction: column;
  }

  .modal-content {
    width: 95%;
  }
}