/**
 * Agency Pro Theme — Dark Mode integration
 * Polished, layered dark palette for mytheme (theme-startup).
 *
 * @package AgencyProDarkMode
 */

html.apdm-dark,
html[data-apdm-theme="dark"] {
	color-scheme: dark;

	/* Map theme tokens → dark palette (admin colors override via inline CSS) */
	--color-slate-50: var(--apdm-bg, #0b1120);
	--color-slate-100: var(--apdm-surface, #151c2c);
	--color-slate-200: var(--apdm-border, #283246);
	--color-slate-300: #3d4a5f;
	--color-slate-400: var(--apdm-muted, #94a3b8);
	--color-slate-500: #7c8ba0;
	--color-slate-600: #a8b4c4;
	--color-slate-700: #c4cdd8;
	--color-slate-800: var(--apdm-text, #f1f5f9);
	--color-slate-900: var(--apdm-text, #f8fafc);

	--color-primary-50: rgba(129, 140, 248, 0.12);
	--color-primary-100: rgba(129, 140, 248, 0.18);
	--color-primary-200: rgba(129, 140, 248, 0.28);
	--color-primary-300: #a5b4fc;
	--color-primary-400: var(--apdm-primary, #818cf8);
	--color-primary-500: var(--apdm-primary, #818cf8);
	--color-primary-600: var(--apdm-primary, #818cf8);
	--color-primary-700: #6366f1;
	--color-primary-900: #c7d2fe;

	--surface: var(--apdm-surface, #151c2c);
	--apdm-surface-alt: var(--apdm-surface-alt, #0f1628);
	--apdm-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
	--apdm-shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.45);
	--apdm-shadow-accent: 0 16px 40px rgba(99, 102, 241, 0.15);
}

/* ── Base & layout ─────────────────────────────────────────────── */

html.apdm-dark body,
html[data-apdm-theme="dark"] body {
	background: var(--apdm-bg, #0b1120);
	color: var(--apdm-text, #f1f5f9);
}

html.apdm-dark .site-main,
html[data-apdm-theme="dark"] .site-main {
	background: var(--apdm-bg, #0b1120);
}

html.apdm-dark.theme-startup,
html[data-apdm-theme="dark"].theme-startup {
	--surface: var(--apdm-surface, #151c2c);
}

/* ── Utility overrides (hardcoded light values in main.css) ─────── */

html.apdm-dark .bg-white,
html[data-apdm-theme="dark"] .bg-white {
	background-color: var(--apdm-surface, #151c2c) !important;
}

html.apdm-dark .bg-slate-50,
html[data-apdm-theme="dark"] .bg-slate-50 {
	background-color: var(--apdm-surface-alt, #0f1628) !important;
}

html.apdm-dark .bg-slate-100,
html[data-apdm-theme="dark"] .bg-slate-100 {
	background-color: var(--apdm-surface, #151c2c) !important;
}

html.apdm-dark .text-slate-900,
html[data-apdm-theme="dark"] .text-slate-900 {
	color: var(--apdm-text, #f8fafc) !important;
}

html.apdm-dark .text-slate-800,
html[data-apdm-theme="dark"] .text-slate-800 {
	color: var(--apdm-text, #f1f5f9) !important;
}

html.apdm-dark .text-slate-700,
html[data-apdm-theme="dark"] .text-slate-700 {
	color: #dbe4ee !important;
}

html.apdm-dark .text-slate-600,
html[data-apdm-theme="dark"] .text-slate-600 {
	color: var(--apdm-muted, #a8b4c4) !important;
}

html.apdm-dark .text-slate-500,
html[data-apdm-theme="dark"] .text-slate-500 {
	color: var(--apdm-muted, #94a3b8) !important;
}

html.apdm-dark .border-slate-200,
html.apdm-dark .border-slate-300,
html[data-apdm-theme="dark"] .border-slate-200,
html[data-apdm-theme="dark"] .border-slate-300 {
	border-color: var(--apdm-border, #283246) !important;
}

html.apdm-dark .hover\:bg-slate-50:hover,
html.apdm-dark .hover\:bg-slate-100:hover,
html[data-apdm-theme="dark"] .hover\:bg-slate-50:hover,
html[data-apdm-theme="dark"] .hover\:bg-slate-100:hover {
	background-color: rgba(255, 255, 255, 0.06) !important;
}

html.apdm-dark .btn-white,
html[data-apdm-theme="dark"] .btn-white {
	background: var(--apdm-surface, #151c2c);
	color: var(--apdm-text, #f1f5f9);
	border: 1px solid var(--apdm-border, #283246);
}

html.apdm-dark .btn-white:hover,
html[data-apdm-theme="dark"] .btn-white:hover {
	background: rgba(255, 255, 255, 0.08);
}

html.apdm-dark .btn-outline,
html[data-apdm-theme="dark"] .btn-outline {
	border-color: var(--apdm-border, #283246);
	color: var(--apdm-text, #f1f5f9);
}

html.apdm-dark .btn-outline:hover,
html[data-apdm-theme="dark"] .btn-outline:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(129, 140, 248, 0.45);
}

/* ── Sections & rhythm ─────────────────────────────────────────── */

html.apdm-dark .home-section,
html[data-apdm-theme="dark"] .home-section {
	background: var(--apdm-bg, #0b1120);
}

html.apdm-dark .home-section--alt,
html.apdm-dark .stats-section,
html[data-apdm-theme="dark"] .home-section--alt,
html[data-apdm-theme="dark"] .stats-section {
	background: var(--apdm-surface-alt, #0f1628);
	border-color: var(--apdm-border, #283246);
}

html.apdm-dark .section-heading__title,
html[data-apdm-theme="dark"] .section-heading__title {
	color: var(--apdm-text, #f8fafc);
}

html.apdm-dark .section-heading__desc,
html[data-apdm-theme="dark"] .section-heading__desc {
	color: var(--apdm-muted, #94a3b8);
}

html.apdm-dark .section-heading__eyebrow,
html[data-apdm-theme="dark"] .section-heading__eyebrow {
	color: var(--apdm-primary, #818cf8);
}

html.apdm-dark .theme-startup .section-heading__eyebrow,
html[data-apdm-theme="dark"] .theme-startup .section-heading__eyebrow {
	background: rgba(129, 140, 248, 0.12);
	color: var(--apdm-primary, #a5b4fc);
}

html.apdm-dark .section-empty,
html[data-apdm-theme="dark"] .section-empty {
	background: var(--apdm-surface, #151c2c);
	border-color: var(--apdm-border, #283246);
	color: var(--apdm-muted, #94a3b8);
}

/* ── Trust bar ─────────────────────────────────────────────────── */

html.apdm-dark .trust-bar,
html[data-apdm-theme="dark"] .trust-bar {
	background: var(--apdm-surface-alt, #0f1628);
	border-bottom-color: var(--apdm-border, #283246);
}

html.apdm-dark .trust-bar__chip,
html[data-apdm-theme="dark"] .trust-bar__chip {
	background: var(--apdm-surface, #151c2c);
	border-color: var(--apdm-border, #283246);
	color: var(--apdm-muted, #a8b4c4);
}

html.apdm-dark a.trust-bar__chip:hover,
html[data-apdm-theme="dark"] a.trust-bar__chip:hover {
	border-color: rgba(129, 140, 248, 0.4);
	box-shadow: var(--apdm-shadow-accent);
	color: var(--apdm-text, #f1f5f9);
}

html.apdm-dark .trust-bar__icon,
html[data-apdm-theme="dark"] .trust-bar__icon {
	background: rgba(129, 140, 248, 0.14);
	color: var(--apdm-primary, #818cf8);
}

/* ── Cards (stats, services, portfolio, blog, testimonials) ──── */

html.apdm-dark .stat-card,
html.apdm-dark .theme-startup .stat-card,
html[data-apdm-theme="dark"] .stat-card,
html[data-apdm-theme="dark"] .theme-startup .stat-card {
	background: var(--apdm-surface, #151c2c);
	border-color: var(--apdm-border, #283246);
	box-shadow: var(--apdm-shadow);
}

html.apdm-dark .stat-card:hover,
html[data-apdm-theme="dark"] .stat-card:hover {
	border-color: rgba(129, 140, 248, 0.35);
	box-shadow: var(--apdm-shadow-accent);
}

html.apdm-dark .stat-card__label,
html[data-apdm-theme="dark"] .stat-card__label {
	color: var(--apdm-muted, #94a3b8);
}

html.apdm-dark .theme-startup .service-card__surface,
html.apdm-dark .theme-startup .service-card__link,
html.apdm-dark .theme-startup .content-card__surface,
html.apdm-dark .theme-startup .blog-card__surface,
html[data-apdm-theme="dark"] .theme-startup .service-card__surface,
html[data-apdm-theme="dark"] .theme-startup .service-card__link,
html[data-apdm-theme="dark"] .theme-startup .content-card__surface,
html[data-apdm-theme="dark"] .theme-startup .blog-card__surface {
	background: var(--apdm-surface, #151c2c);
	border-color: var(--apdm-border, #283246);
	box-shadow: var(--apdm-shadow);
}

html.apdm-dark .theme-startup .service-card__surface:hover,
html.apdm-dark .theme-startup .service-card__link:hover,
html.apdm-dark .theme-startup .content-card__surface:hover,
html.apdm-dark .theme-startup .blog-card__surface:hover,
html[data-apdm-theme="dark"] .theme-startup .service-card__surface:hover,
html[data-apdm-theme="dark"] .theme-startup .service-card__link:hover,
html[data-apdm-theme="dark"] .theme-startup .content-card__surface:hover,
html[data-apdm-theme="dark"] .theme-startup .blog-card__surface:hover {
	border-color: rgba(129, 140, 248, 0.38);
	box-shadow: var(--apdm-shadow-accent);
}

html.apdm-dark .content-card__image,
html[data-apdm-theme="dark"] .content-card__image {
	background: var(--apdm-surface-alt, #0f1628);
}

html.apdm-dark .blog-card__peek,
html[data-apdm-theme="dark"] .blog-card__peek {
	background: rgba(129, 140, 248, 0.1);
	border-color: rgba(129, 140, 248, 0.25);
}

/* ── Inner pages & content panels ──────────────────────────────── */

html.apdm-dark .theme-startup .inner-section .content-panel,
html[data-apdm-theme="dark"] .theme-startup .inner-section .content-panel {
	background: var(--apdm-surface, #151c2c);
	border-color: var(--apdm-border, #283246);
	box-shadow: var(--apdm-shadow-lg);
}

html.apdm-dark .inner-page-actions,
html.apdm-dark .service-cta-inline,
html[data-apdm-theme="dark"] .inner-page-actions,
html[data-apdm-theme="dark"] .service-cta-inline {
	border-top-color: var(--apdm-border, #283246);
}

html.apdm-dark .service-detail__media--wide,
html[data-apdm-theme="dark"] .service-detail__media--wide {
	border-color: var(--apdm-border, #283246);
}

html.apdm-dark .prose,
html.apdm-dark .entry-content,
html[data-apdm-theme="dark"] .prose,
html[data-apdm-theme="dark"] .entry-content {
	color: #dbe4ee;
}

html.apdm-dark .prose h1,
html.apdm-dark .prose h2,
html.apdm-dark .prose h3,
html.apdm-dark .prose h4,
html[data-apdm-theme="dark"] .prose h1,
html[data-apdm-theme="dark"] .prose h2,
html[data-apdm-theme="dark"] .prose h3,
html[data-apdm-theme="dark"] .prose h4 {
	color: var(--apdm-text, #f8fafc);
}

html.apdm-dark .prose a,
html[data-apdm-theme="dark"] .prose a {
	color: var(--apdm-primary, #a5b4fc);
}

/* ── Testimonials ──────────────────────────────────────────────── */

html.apdm-dark .p-6.lg\:p-8.bg-white,
html[data-apdm-theme="dark"] .p-6.lg\:p-8.bg-white {
	background: var(--apdm-surface, #151c2c) !important;
	border-color: var(--apdm-border, #283246) !important;
}

/* ── Forms & comments ──────────────────────────────────────────── */

html.apdm-dark .comment-form input[type="text"],
html.apdm-dark .comment-form input[type="email"],
html.apdm-dark .comment-form textarea,
html.apdm-dark .contact-form-section .apcf-form-wrap--home .apcf-field input,
html.apdm-dark .contact-form-section .apcf-form-wrap--home .apcf-field select,
html.apdm-dark .contact-form-section .apcf-form-wrap--home .apcf-field textarea,
html[data-apdm-theme="dark"] .comment-form input[type="text"],
html[data-apdm-theme="dark"] .comment-form input[type="email"],
html[data-apdm-theme="dark"] .comment-form textarea,
html[data-apdm-theme="dark"] .contact-form-section .apcf-form-wrap--home .apcf-field input,
html[data-apdm-theme="dark"] .contact-form-section .apcf-form-wrap--home .apcf-field select,
html[data-apdm-theme="dark"] .contact-form-section .apcf-form-wrap--home .apcf-field textarea {
	background: var(--apdm-surface-alt, #0f1628);
	border-color: var(--apdm-border, #283246);
	color: var(--apdm-text, #f1f5f9);
}

html.apdm-dark .comment-form input:focus,
html.apdm-dark .comment-form textarea:focus,
html.apdm-dark .contact-form-section .apcf-form-wrap--home .apcf-field input:focus,
html.apdm-dark .contact-form-section .apcf-form-wrap--home .apcf-field select:focus,
html.apdm-dark .contact-form-section .apcf-form-wrap--home .apcf-field textarea:focus,
html[data-apdm-theme="dark"] .comment-form input:focus,
html[data-apdm-theme="dark"] .comment-form textarea:focus,
html[data-apdm-theme="dark"] .contact-form-section .apcf-form-wrap--home .apcf-field input:focus,
html[data-apdm-theme="dark"] .contact-form-section .apcf-form-wrap--home .apcf-field select:focus,
html[data-apdm-theme="dark"] .contact-form-section .apcf-form-wrap--home .apcf-field textarea:focus {
	border-color: var(--apdm-primary, #818cf8);
	box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

html.apdm-dark .contact-form-section .apcf-form-wrap--home .apcf-field-row label,
html[data-apdm-theme="dark"] .contact-form-section .apcf-form-wrap--home .apcf-field-row label {
	color: var(--apdm-muted, #a8b4c4);
}

/* ── Language switcher ─────────────────────────────────────────── */

html.apdm-dark .lang-switcher__toggle,
html[data-apdm-theme="dark"] .lang-switcher__toggle {
	background: var(--apdm-surface, #151c2c);
	border-color: var(--apdm-border, #283246);
	color: var(--apdm-text, #f1f5f9);
}

html.apdm-dark .lang-switcher__dropdown,
html[data-apdm-theme="dark"] .lang-switcher__dropdown {
	background: var(--apdm-surface, #151c2c);
	border-color: var(--apdm-border, #283246);
	box-shadow: var(--apdm-shadow-lg);
}

html.apdm-dark .lang-switcher__dropdown-link,
html[data-apdm-theme="dark"] .lang-switcher__dropdown-link {
	color: var(--apdm-muted, #a8b4c4);
}

html.apdm-dark .lang-switcher__dropdown-link:hover,
html[data-apdm-theme="dark"] .lang-switcher__dropdown-link:hover {
	background: rgba(255, 255, 255, 0.06);
	color: var(--apdm-text, #f1f5f9);
}

/* ── Service modal ─────────────────────────────────────────────── */

html.apdm-dark .service-modal__dialog,
html[data-apdm-theme="dark"] .service-modal__dialog {
	background: var(--apdm-surface, #151c2c);
	border-color: var(--apdm-border, #283246);
	color: var(--apdm-text, #f1f5f9);
	box-shadow: var(--apdm-shadow-lg);
}

html.apdm-dark .service-modal__close,
html[data-apdm-theme="dark"] .service-modal__close {
	background: var(--apdm-surface-alt, #0f1628);
	border-color: var(--apdm-border, #283246);
	color: var(--apdm-muted, #a8b4c4);
}

html.apdm-dark .service-modal__close:hover,
html[data-apdm-theme="dark"] .service-modal__close:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--apdm-text, #f1f5f9);
	border-color: rgba(129, 140, 248, 0.35);
}

html.apdm-dark .service-modal__backdrop,
html[data-apdm-theme="dark"] .service-modal__backdrop {
	background: rgba(2, 6, 16, 0.78);
}

/* ── Pagination ────────────────────────────────────────────────── */

html.apdm-dark .pagination a,
html.apdm-dark .pagination span,
html[data-apdm-theme="dark"] .pagination a,
html[data-apdm-theme="dark"] .pagination span {
	background: var(--apdm-surface, #151c2c);
	border-color: var(--apdm-border, #283246);
	color: var(--apdm-muted, #a8b4c4);
}

html.apdm-dark .pagination a:hover,
html[data-apdm-theme="dark"] .pagination a:hover {
	border-color: rgba(129, 140, 248, 0.4);
	color: var(--apdm-text, #f1f5f9);
}

/* ── Footer (subtle refinement) ─────────────────────────────────── */

html.apdm-dark .site-footer,
html[data-apdm-theme="dark"] .site-footer {
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}

html.apdm-dark .theme-startup .site-footer,
html[data-apdm-theme="dark"] .theme-startup .site-footer {
	background: linear-gradient(180deg, #070b14 0%, #030508 100%);
}

/* ── Images (subtle depth) ─────────────────────────────────────── */

html.apdm-dark .content-card__img,
html.apdm-dark .service-detail__img,
html.apdm-dark .portfolio-detail__img,
html[data-apdm-theme="dark"] .content-card__img,
html[data-apdm-theme="dark"] .service-detail__img,
html[data-apdm-theme="dark"] .portfolio-detail__img {
	filter: saturate(0.92) brightness(0.95);
}
