/* Advanced YouTube SEO Tool Styles */

.tool-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px auto;
}

.tool-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: var(--brand-primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.tool-privacy-note {
  color: var(--status-published);
  font-size: 0.875rem;
  font-weight: 600;
}

.tool-search-card {
  padding: 24px;
  border-radius: var(--radius-xl);
  margin-bottom: 40px;
}

.search-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.input-group {
  flex: 1 1 300px;
}

.keyword-input {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color var(--transition-fast);
}

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

.select-group {
  flex: 0 1 auto;
}

.custom-select {
  padding: 14px 36px 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: var(--bg-surface-elevated) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%239CA3AF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>') no-repeat right 12px center;
  color: var(--text-primary);
  font-size: 0.95rem;
  appearance: none;
  cursor: pointer;
}

.custom-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.btn-search {
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-search:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* States */
.hidden {
  display: none !important;
}

.state-container {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.error-text {
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-glass);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px auto;
}

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

/* Results Area */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.results-count-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.results-actions {
  display: flex;
  gap: 12px;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--border-focus);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-fast);
}

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

.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.suggestion-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  gap: 12px;
}

.suggestion-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glass-hover);
}

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

.suggestion-text {
  font-size: 1.05rem;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
}

.suggestion-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  white-space: nowrap;
}

.badge-direct {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-expanded {
  background: rgba(59, 130, 246, 0.15);
  color: #3B82F6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-copy {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.btn-copy:hover {
  background: var(--bg-surface);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--text-primary);
  color: var(--bg-canvas);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards, fadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards 2.7s;
}

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

@keyframes fadeOut {
  to { opacity: 0; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .search-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .input-group {
    flex: 0 1 auto;
    width: 100%;
  }
  
  .select-group {
    width: 100%;
  }
  
  .custom-select {
    width: 100%;
  }
  
  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tool-title {
    font-size: 1.75rem;
  }

  .btn-search {
    width: 100%;
    justify-content: center;
  }

  .tool-search-card {
    padding: 16px;
  }

  .suggestion-card {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .suggestion-content {
    width: 100%;
  }

  .suggestion-actions {
    width: 100%;
    justify-content: space-between;
  }

  .results-actions {
    flex-wrap: wrap;
  }

  .results-actions .btn {
    flex: 1 1 calc(50% - 6px);
  }
}

/* Checkbox Styles */
.suggestion-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.suggestion-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin: 12px; /* Minimum 44px touch target area when combined with width */
  accent-color: var(--brand-primary);
}


/* Custom Country Dropdown */
.custom-country-group {
  position: relative;
}

.custom-select-button {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.custom-select-button:focus {
  outline: none;
  border-color: var(--border-focus);
}

.custom-select-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flag-icon {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.custom-select-caret {
  color: #9CA3AF;
  font-size: 0.75rem;
}

.custom-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: calc(100vw - 32px);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  max-height: 250px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  padding: 4px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin: 0;
  list-style: none;
}

.custom-select-list.show {
  display: block;
}

.custom-select-list li {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.95rem;
  white-space: nowrap;
}

.custom-select-list li:hover,
.custom-select-list li.focused,
.custom-select-list li[aria-selected="true"] {
  background: var(--bg-surface);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
