/* =========================================================
   OmniTools - UI Components, Modals, SEO & Ads
   ========================================================= */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: normal;
  text-align: center;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
  color: #ffffff;
}

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

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

.btn-success {
  background: var(--accent-emerald);
  color: #ffffff;
}

.btn-success:hover {
  background: #059669;
  color: #ffffff;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

/* Universal Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  padding: 1.75rem;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-backdrop.active .modal-card {
  transform: scale(1);
}

/* Command Palette Modal (Ctrl + K) */
.cmd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 1.5rem 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.cmd-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.cmd-modal {
  width: 100%;
  max-width: 620px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(-20px) scale(0.98);
  transition: transform var(--transition-fast);
}

.cmd-modal-backdrop.active .cmd-modal {
  transform: translateY(0) scale(1);
}

.cmd-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.75rem;
}

.cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.cmd-input::placeholder {
  color: var(--text-muted);
}

.cmd-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.cmd-item:hover, .cmd-item.selected {
  background: var(--bg-tertiary);
}

.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cmd-item-category {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.cmd-footer {
  padding: 0.65rem 1.25rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toast Notifications (Positioned safely above floating buttons) */
.toast-container {
  position: fixed;
  bottom: 84px;
  right: 24px;
  z-index: 100001;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}

.toast {
  padding: 0.9rem 1.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  animation: slideInToast 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
  backdrop-filter: blur(12px);
}

.toast-success {
  border-left: 4px solid var(--accent-emerald);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
}

.toast-error {
  border-left: 4px solid var(--accent-rose);
  box-shadow: 0 10px 25px rgba(244, 63, 94, 0.2);
}

@keyframes slideInToast {
  from { transform: translateY(16px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@media (max-width: 640px) {
  .toast-container {
    bottom: 80px;
    right: 16px;
    left: 16px;
    align-items: center;
  }
  .toast {
    width: 100%;
    justify-content: center;
  }
}

/* Drop Zone Component */
.drop-zone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent-blue);
  background: var(--accent-blue-light);
}

.drop-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--accent-blue);
}

.drop-zone-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.drop-zone-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.drop-zone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

/* Drop Zone Active File Selected State (Mobile & Desktop) */
.drop-zone.file-selected {
  border-color: var(--accent-emerald) !important;
  background: rgba(16, 185, 129, 0.08) !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
  border-style: solid !important;
}

.drop-zone-selected-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: pulseSuccess 0.35s ease-out;
  pointer-events: none;
}

.selected-file-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 4px 10px rgba(16, 185, 129, 0.3));
}

.selected-file-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  max-width: 90%;
  word-break: break-all;
  line-height: 1.35;
}

.selected-file-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
}

.selected-file-change-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

@keyframes pulseSuccess {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

/* SEO Content & FAQ Section */
.seo-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border-subtle);
}

.seo-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.seo-text {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.seo-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.seo-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.seo-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.1rem 1.25rem;
  background: transparent;
  border: none;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.faq-question:hover {
  background: var(--bg-tertiary);
}

.faq-answer {
  padding: 0 1.25rem 1.1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}

.faq-arrow {
  transition: transform var(--transition-fast);
}

/* Monetization / AdSlot Component */
.ad-slot {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 2rem 0;
  text-align: center;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ad-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-placeholder-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}
