/* ==========================================================================
   AI Tools — orange theme (at- prefix)
   ========================================================================== */

/* Nav: AI Tools link active state — orange when on AI Tools / Resume Builder */
#mainNavbar a.nav-link.active[href*="ai-tools"] {
  color: #ff9900 !important;
  background: rgba(255, 153, 0, 0.18) !important;
}

#mainNavbar a.nav-link.active[href*="ai-tools"]:hover {
  color: #ffaa00 !important;
  background: rgba(255, 153, 0, 0.25) !important;
}

.at {
  --at-font-head: 'Outfit', system-ui, sans-serif;
  --at-font-body: 'DM Sans', system-ui, sans-serif;
  /* Orange palette */
  --at-primary: #ff9900;
  --at-primary-dark: #e68a00;
  --at-primary-light: #ffaa00;
  --at-primary-dim: rgba(255, 153, 0, 0.12);
  --at-primary-border: rgba(255, 153, 0, 0.35);
  --at-bg: #000000;
  --at-surface: #1a1a1a;
  --at-surface-light: #262626;
  --at-border: #333333;
  --at-border-light: #404040;
  --at-text: #ffffff;
  --at-text-secondary: #d1d5db;
  --at-text-muted: #9ca3af;
  --at-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --at-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --at-radius: 12px;
  --at-radius-lg: 16px;
  --at-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .at {
  --at-surface: #ffffff;
  --at-surface-light: #f8fafc;
  --at-border: #e2e8f0;
  --at-border-light: #cbd5e1;
  --at-text: #0f172a;
  --at-text-secondary: #475569;
  --at-text-muted: #64748b;
}

.at {
  font-family: var(--at-font-body);
  background: var(--at-bg);
  color: var(--at-text);
  min-height: 100vh;
  padding-bottom: 4rem;
}

[data-theme="light"] .at {
  background: #f8fafc;
}

/* ——— Wrapper (create-coupon style) ——— */
.at-wrapper {
  min-height: calc(100vh - 76px);
  padding: 3rem 0 4rem;
  position: relative;
}

[data-theme="light"] .at-wrapper {
  background: transparent;
}

/* ——— Header (create-coupon style) ——— */
.at-header {
  margin-bottom: 3rem;
  position: relative;
}

.at-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.at-header-text {
  flex: 1;
  min-width: 280px;
}

.at-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, var(--at-primary) 0%, var(--at-primary-dark) 100%);
  color: #ffffff;
  border-radius: 50px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(255, 153, 0, 0.4);
  border: none;
}

.at-header-badge i {
  font-size: 1rem;
  color: #ffffff;
}

.at-header-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  color: var(--at-text);
  margin: 0 0 1rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

[data-theme="light"] .at-header-title {
  background: linear-gradient(135deg, #0f172a 0%, var(--at-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.at-header-description {
  font-size: 1.125rem;
  color: var(--at-text-secondary);
  margin: 0;
  line-height: 1.7;
  max-width: 560px;
}

/* ——— Form section (coupon-form-section style) ——— */
.at-form-section {
  background: var(--at-surface);
  border: 1px solid var(--at-border);
  border-radius: var(--at-radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--at-shadow);
}

[data-theme="light"] .at-form-section {
  background: #ffffff;
  border-color: var(--at-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.at-form-section-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--at-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.at-form-section-title i {
  color: var(--at-primary);
  font-size: 1.25rem;
}

.at-form-section-desc {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: var(--at-text-muted);
}

/* ——— Tools grid ——— */
.at-tools-grid {
  display: grid;
  gap: 1.25rem;
}

.at-tool-card {
  background: var(--at-surface-light);
  border: 1px solid var(--at-border);
  border-radius: var(--at-radius);
  padding: 1.5rem;
  transition: var(--at-transition);
}

[data-theme="light"] .at-tool-card {
  background: var(--at-surface-light);
  border-color: var(--at-border);
}

.at-tool-card:hover {
  border-color: var(--at-primary-border);
  box-shadow: 0 4px 12px rgba(255, 153, 0, 0.12);
}

.at-tool-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.at-tools-grid-list .at-tool-card .at-tool-header {
  margin-bottom: 0;
}

.at-tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--at-radius);
  background: var(--at-primary-dim);
  border: 1px solid var(--at-primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--at-primary-light);
  flex-shrink: 0;
}

.at-tool-title {
  font-family: var(--at-font-head);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--at-text);
  margin: 0 0 0.25rem;
}

.at-tool-desc {
  font-size: 0.9375rem;
  color: var(--at-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ——— Listing: card + Open button ——— */
.at-tools-grid-list .at-tool-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.at-tools-grid-list .at-tool-card .at-tool-header {
  flex: 1 1 200px;
}

.at-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-family: var(--at-font-head);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: var(--at-transition);
  text-decoration: none;
}

.at-btn-primary {
  background: linear-gradient(135deg, var(--at-primary) 0%, var(--at-primary-dark) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 153, 0, 0.35);
}

.at-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 153, 0, 0.45);
  color: #ffffff;
}

.at-btn-open {
  flex-shrink: 0;
}

.at-btn-secondary {
  background: var(--at-surface-light);
  color: var(--at-text);
  border: 1px solid var(--at-border);
}

[data-theme="light"] .at-btn-secondary {
  border-color: var(--at-border);
}

.at-btn-secondary:hover:not(:disabled) {
  background: var(--at-border-light);
  border-color: var(--at-border-light);
}

.at-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ——— Placeholder card ——— */
.at-tool-card-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  text-align: center;
  opacity: 0.9;
}

.at-tool-card-placeholder .at-tool-icon {
  margin-bottom: 0.75rem;
  color: var(--at-text-muted);
  background: var(--at-surface);
  border-color: var(--at-border);
}

.at-tool-card-placeholder .at-tool-title {
  font-size: 1.1rem;
}

/* ——— Tool page layout ——— */
.at-tool-page .at-wrapper {
  padding: 2rem 0 3rem;
}

.at-tool-page .at-header {
  margin-bottom: 2rem;
}

.at-tool-page .at-header-badge {
  display: none;
}

.at-tool-page .at-header-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 0.5rem;
}

.at-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--at-primary);
  text-decoration: none;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--at-primary-border);
  border-radius: 50px;
  background: var(--at-primary-dim);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.at-back-link:hover {
  color: #000;
  background: var(--at-primary);
  border-color: var(--at-primary);
  text-decoration: none;
  transform: translateX(-2px);
}

.at-back-link i {
  font-size: 1.1rem;
}

.at-tool-page .at-form-section,
.at-tool-card-single {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.at-tool-body .at-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--at-text-muted);
  margin-bottom: 0.5rem;
}

.at-textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem 1.25rem;
  font-family: var(--at-font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--at-text);
  background: var(--at-surface-light);
  border: 1px solid var(--at-border);
  border-radius: var(--at-radius);
  resize: vertical;
  transition: var(--at-transition);
  margin-bottom: 1rem;
}

[data-theme="light"] .at-textarea {
  background: #ffffff;
  border-color: var(--at-border);
}

.at-textarea::placeholder {
  color: var(--at-text-muted);
  opacity: 0.8;
}

.at-textarea:focus {
  outline: none;
  border-color: var(--at-primary);
  box-shadow: 0 0 0 3px var(--at-primary-dim);
}

.at-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.at-btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.at-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: atSpin 0.7s linear infinite;
}

@keyframes atSpin {
  to { transform: rotate(360deg); }
}

.at-result-wrap {
  margin-top: 1rem;
}

.at-result-box {
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--at-text);
  background: var(--at-surface-light);
  border: 1px solid var(--at-border);
  border-radius: var(--at-radius);
  white-space: pre-wrap;
  word-break: break-word;
}

[data-theme="light"] .at-result-box {
  background: #ffffff;
  border-color: var(--at-border);
}

.at-error {
  font-size: 0.875rem;
  color: #ef4444;
  margin: 0.75rem 0 0;
}

.at-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.at-reveal.at-visible {
  opacity: 1;
  transform: translateY(0);
}

.at-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
