/* ==========================================================================
   0ppm Tools - Theme Architecture & Color System
   Unified Dark & Light Mode Design Tokens for 0ppm.net Civil Suite
   ========================================================================== */

:root {
    /* Color Mode */
    color-scheme: light;

    /* Brand Palette (Sky / Blue) */
    --brand-50: #f0f9ff;
    --brand-100: #e0f2fe;
    --brand-200: #bae6fd;
    --brand-300: #7dd3fc;
    --brand-400: #38bdf8;
    --brand-500: #0ea5e9;
    --brand-600: #0284c7;
    --brand-700: #0369a1;
    --brand-800: #075985;
    --brand-900: #0c4a6e;
    --brand-950: #082f49;

    /* Neutral Surface Palette (Slate) */
    --surface-50: #f8fafc;
    --surface-100: #f1f5f9;
    --surface-200: #e2e8f0;
    --surface-300: #cbd5e1;
    --surface-400: #94a3b8;
    --surface-500: #64748b;
    --surface-600: #475569;
    --surface-700: #334155;
    --surface-800: #1e293b;
    --surface-900: #0f172a;
    --surface-950: #020617;

    /* Semantic Tokens (Light Mode Default) */
    --bg-canvas: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-subtle: #f8fafc;
    --bg-surface-elevated: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);

    --border-subtle: #e2e8f0;
    --border-card: #e2e8f0;
    --border-input: #cbd5e1;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    /* Accents */
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-purple: #8b5cf6;
    --accent-rose: #f43f5e;
    --accent-cyan: #06b6d4;

    /* Shadows */
    --shadow-main-card: 0 25px 60px -15px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(226, 232, 240, 0.8);
    --shadow-card-sm: 0 2px 10px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 12px 30px -8px rgba(14, 165, 233, 0.15);
}

/* ==========================================================================
   Dark Mode Tokens
   ========================================================================== */
.dark {
    /* Color Mode */
    color-scheme: dark;

    /* Semantic Tokens (Dark Mode) */
    --bg-canvas: #090d16;
    --bg-surface: #0f172a;
    --bg-surface-subtle: #1e293b;
    --bg-surface-elevated: #1e293b;
    --bg-glass: rgba(15, 23, 42, 0.8);

    --border-subtle: #1e293b;
    --border-card: #1e293b;
    --border-input: #334155;

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

    /* Shadows */
    --shadow-main-card: 0 30px 70px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(30, 41, 59, 0.8);
    --shadow-card-sm: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 14px 35px -8px rgba(14, 165, 233, 0.25);
}

/* ==========================================================================
   Dark Mode Form Typography & Input Colors
   Guarantees high-contrast, crisp readable text colors across all form inputs
   ========================================================================== */
.dark input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([class*="dark:text-teal"]):not([class*="dark:text-amber"]):not([class*="dark:text-emerald"]):not([class*="dark:text-rose"]):not([class*="dark:text-purple"]):not([class*="dark:text-cyan"]):not([class*="dark:text-blue"]):not([class*="dark:text-indigo"]),
.dark select:not([class*="dark:text-teal"]):not([class*="dark:text-amber"]):not([class*="dark:text-emerald"]):not([class*="dark:text-rose"]):not([class*="dark:text-purple"]):not([class*="dark:text-cyan"]):not([class*="dark:text-blue"]):not([class*="dark:text-indigo"]),
.dark textarea:not([class*="dark:text-teal"]):not([class*="dark:text-amber"]):not([class*="dark:text-emerald"]):not([class*="dark:text-rose"]):not([class*="dark:text-purple"]):not([class*="dark:text-cyan"]):not([class*="dark:text-blue"]):not([class*="dark:text-indigo"]) {
    color: var(--text-primary);
}

/* Explicit override for inputs that carry light-mode text-slate-800/900 classes */
.dark input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]).text-slate-800,
.dark input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]).text-slate-900,
.dark select.text-slate-800,
.dark select.text-slate-900,
.dark textarea.text-slate-800,
.dark textarea.text-slate-900 {
    color: #f8fafc !important;
}

/* Ensure missing Tailwind utility classes resolve cleanly in dark mode */
.dark .dark\:text-slate-100,
.dark [class*="dark:text-slate-100"] {
    color: #f1f5f9 !important;
}

.dark .dark\:text-slate-50,
.dark [class*="dark:text-slate-50"] {
    color: #f8fafc !important;
}

.dark .dark\:text-slate-200,
.dark [class*="dark:text-slate-200"] {
    color: #e2e8f0 !important;
}

.dark .dark\:text-white,
.dark [class*="dark:text-white"] {
    color: #ffffff !important;
}

/* Disabled input typography in dark mode */
.dark input:disabled,
.dark textarea:disabled,
.dark select:disabled {
    color: var(--text-muted) !important;
}

/* High-contrast placeholders for dark mode */
.dark input::placeholder,
.dark textarea::placeholder {
    color: #64748b !important;
    opacity: 0.85 !important;
}

/* ==========================================================================
   Smooth Theme Transitions
   Enables fluid color shifting when toggling between dark & light modes
   ========================================================================== */
body, 
header, 
aside, 
main, 
.card, 
.glass, 
.stat-card,
table,
td,
th {
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.15s ease;
}

/* ==========================================================================
   Drawing Register Group Indicators
   ========================================================================== */
.card-group-a {
    background-color: rgba(255, 255, 255, 0.85) !important;
}

.card-group-b {
    background-color: rgba(236, 253, 245, 0.95) !important; /* Subtle Emerald Tint */
    border-left: 4px solid #10b981 !important;
}

.dark .card-group-a {
    background-color: rgba(15, 23, 42, 0.6) !important;
}

.dark .card-group-b {
    background-color: rgba(6, 78, 59, 0.3) !important; /* Deep Emerald Tint */
    border-left: 4px solid #059669 !important;
}

/* ==========================================================================
   404 / Error Page Scoped Theme
   ========================================================================== */
.error-page-container {
    background-color: #0f172a;
    color: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.error-page-container .glass {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
}

/* ==========================================================================
   Dashboard Engineering Tool Pastel Tiles
   ========================================================================== */
.tile-pastel-indigo {
    background-color: #e0e7ff !important;
    border-color: #a5b4fc !important;
}
.tile-pastel-indigo:hover {
    background-color: #d1dcfe !important;
    border-color: #818cf8 !important;
}
.dark .tile-pastel-indigo {
    background-color: rgba(49, 46, 129, 0.5) !important;
    border-color: rgba(99, 102, 241, 0.45) !important;
}
.dark .tile-pastel-indigo:hover {
    background-color: rgba(67, 56, 202, 0.6) !important;
    border-color: rgba(129, 140, 248, 0.65) !important;
}

.tile-pastel-purple {
    background-color: #f3e8ff !important;
    border-color: #d8b4fe !important;
}
.tile-pastel-purple:hover {
    background-color: #ebd5ff !important;
    border-color: #c084fc !important;
}
.dark .tile-pastel-purple {
    background-color: rgba(88, 28, 135, 0.5) !important;
    border-color: rgba(168, 85, 247, 0.45) !important;
}
.dark .tile-pastel-purple:hover {
    background-color: rgba(107, 33, 168, 0.6) !important;
    border-color: rgba(192, 132, 252, 0.65) !important;
}

.tile-pastel-teal {
    background-color: #ccfbf1 !important;
    border-color: #5eead4 !important;
}
.tile-pastel-teal:hover {
    background-color: #bbf7eb !important;
    border-color: #2dd4bf !important;
}
.dark .tile-pastel-teal {
    background-color: rgba(19, 78, 74, 0.5) !important;
    border-color: rgba(20, 184, 166, 0.45) !important;
}
.dark .tile-pastel-teal:hover {
    background-color: rgba(17, 94, 89, 0.6) !important;
    border-color: rgba(45, 212, 191, 0.65) !important;
}

.tile-pastel-amber {
    background-color: #fef3c7 !important;
    border-color: #fcd34d !important;
}
.tile-pastel-amber:hover {
    background-color: #fde68a !important;
    border-color: #fbbf24 !important;
}
.dark .tile-pastel-amber {
    background-color: rgba(120, 53, 15, 0.5) !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
}
.dark .tile-pastel-amber:hover {
    background-color: rgba(146, 64, 14, 0.6) !important;
    border-color: rgba(251, 191, 36, 0.65) !important;
}

.tile-pastel-cyan {
    background-color: #cffafe !important;
    border-color: #67e8f9 !important;
}
.tile-pastel-cyan:hover {
    background-color: #bbf7fd !important;
    border-color: #22d3ee !important;
}
.dark .tile-pastel-cyan {
    background-color: rgba(22, 78, 99, 0.5) !important;
    border-color: rgba(6, 182, 212, 0.45) !important;
}
.dark .tile-pastel-cyan:hover {
    background-color: rgba(21, 94, 117, 0.6) !important;
    border-color: rgba(34, 211, 238, 0.65) !important;
}

.tile-pastel-emerald {
    background-color: #d1fae5 !important;
    border-color: #6ee7b7 !important;
}
.tile-pastel-emerald:hover {
    background-color: #bbf7d0 !important;
    border-color: #34d399 !important;
}
.dark .tile-pastel-emerald {
    background-color: rgba(6, 78, 59, 0.5) !important;
    border-color: rgba(16, 185, 129, 0.45) !important;
}
.dark .tile-pastel-emerald:hover {
    background-color: rgba(6, 95, 70, 0.6) !important;
    border-color: rgba(52, 211, 153, 0.65) !important;
}

.tile-pastel-rose {
    background-color: #ffe4e6 !important;
    border-color: #fda4af !important;
}
.tile-pastel-rose:hover {
    background-color: #fecdd3 !important;
    border-color: #fb7185 !important;
}
.dark .tile-pastel-rose {
    background-color: rgba(136, 19, 55, 0.5) !important;
    border-color: rgba(244, 63, 94, 0.45) !important;
}
.dark .tile-pastel-rose:hover {
    background-color: rgba(159, 18, 57, 0.6) !important;
    border-color: rgba(251, 113, 133, 0.65) !important;
}

.tile-pastel-blue {
    background-color: #dbeafe !important;
    border-color: #93c5fd !important;
}
.tile-pastel-blue:hover {
    background-color: #bfdbfe !important;
    border-color: #60a5fa !important;
}
.dark .tile-pastel-blue {
    background-color: rgba(30, 58, 138, 0.5) !important;
    border-color: rgba(59, 130, 246, 0.45) !important;
}
.dark .tile-pastel-blue:hover {
    background-color: rgba(30, 64, 175, 0.6) !important;
    border-color: rgba(96, 165, 250, 0.65) !important;
}

/* Tool Icon Box - Crisp white background with dark black detail for all icons */
.tool-tile .tool-icon-box {
    background-color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
    color: #0f172a !important;
}
.tool-tile .tool-icon-box svg {
    color: #0f172a !important;
    stroke: #0f172a !important;
}

/* Bottom Left Tool Badge */
.tool-tile .tool-badge {
    background-color: rgba(255, 255, 255, 0.85) !important;
    color: #0f172a !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
.dark .tool-tile .tool-badge {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}


/* ==========================================================================
   Global Interactive Cursors
   ========================================================================== */
button, 
[role="button"],
a,
label[for],
select,
input[type="submit"],
input[type="button"],
input[type="checkbox"],
input[type="radio"] {
    cursor: pointer !important;
}


