@import 'nav.css';
@import 'hero-form.css';

/* ==========================================================================
   #Reset & Base
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    font-size: 17px;
    line-height: 1.65;
    letter-spacing: 0.01em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-text); /* Headings inherit main text color (usually darker/lighter depending on mode) */
    margin-top: 0;
    margin-bottom: 1.25rem;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }

p {
    margin: 0 0 1rem;
    max-width: 70ch;
    color: var(--color-text-muted);
    line-height: 1.7;
    font-size: 1.05rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--color-accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================================================== 
   #Layout
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.grid {
    display: grid;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    .grid-5 { grid-template-columns: repeat(5, 1fr); }
}

/* Trusted Logos Grid Styling */
.logo-grid {
    display: grid;
    gap: 2rem;
    align-items: center;
    justify-items: center;
}

@media (max-width: 767px) {
    .logo-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
    }
}

.logo-grid img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.6);
    transition: all 0.3s ease;
}

.logo-grid img:hover {
    filter: grayscale(0%) opacity(1);
    transform: translateY(-2px);
}

/* Invert logos for light-themed style kits to ensure visibility */
body.style-kit-corporate-stabilizer .logo-grid img,
body.style-kit-creative-disruptor .logo-grid img {
    filter: grayscale(100%) invert(1) opacity(0.8);
}

body.style-kit-corporate-stabilizer .logo-grid img:hover,
body.style-kit-creative-disruptor .logo-grid img:hover {
    filter: grayscale(0%) invert(1) opacity(1);
}

.section {
    padding: 4rem 0;
}

.section h2,
.section h3 {
    text-align: center;
    max-width: 26ch;
    margin-left: auto;
    margin-right: auto;
}

.bg-alt {
    background-color: var(--color-bg-alt);
}

/* ==========================================================================
   #Utilities
   ========================================================================== */
/* Layout helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.flex-grow { flex: 1 1 auto; }
.h-full { height: 100%; }
.w-100 { width: 100%; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.max-w-xs { max-width: 20rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Spacing scale */
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }

.p-0 { padding: 0; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.pt-4 { padding-top: 1rem; }
.pt-8 { padding-top: 2rem; }

.pb-4 { padding-bottom: 1rem; }
.pb-8 { padding-bottom: 2rem; }

.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

.space-y-4 > * + * { margin-top: 1rem; }
.space-y-8 > * + * { margin-top: 2rem; }

.border-t { border-top: 1px solid var(--color-border); }
.border-0 { border: 0; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-700 { border-color: #374151; }
.border-green-100 { border-color: #d1fae5; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

.overflow-hidden { overflow: hidden; }

/* Typography & color */
.block { display: block; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-center p { margin-left: auto; margin-right: auto; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-widest { letter-spacing: 0.1em; }

.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-error { color: #ef4444; }
.text-warning { color: #f59e0b; }
.text-white { color: #fff; }
.text-black { color: #000; }
.text-gray-300 { color: #d1d5db; }
.text-success { color: #10B981; }

.bg-primary { background-color: var(--color-primary); }
.bg-accent { background-color: var(--color-accent); }
.bg-success { background-color: #16a34a; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #d1fae5; }
.bg-surface { background-color: #f9fafb; }
.text-white a { color: currentColor; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* Buttons */
.btn-primary { background: var(--color-primary); color: #fff !important; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* Responsive variants */
@media (min-width: 768px) {
    .md\:flex-row { flex-direction: row; }
    .md\:items-center { align-items: center; }
    .md\:text-left { text-align: left; }
}

/* ========================================================================== 
   #Components
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: #fff !important;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--color-accent);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary) !important;
}

.btn-outline:hover {
    background: var(--color-primary);
    color: #fff !important;
}

.hero-section {
    position: relative;
}

.hero-content {
    max-width: 42rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-content p {
    color: var(--color-text);
    font-size: 1.1rem;
}

.card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
    line-height: 1.7;
}

/* Creative Disruptor specific overrides */
body.style-kit-creative-disruptor .card {
    border: var(--border-width, 1px) solid var(--color-border);
    box-shadow: 4px 4px 0 var(--color-primary);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); /* Subtle lift for readability focus */
}

/* ==========================================================================
   #Forms
   ========================================================================== */
input:not([type=range]), textarea, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg-alt);
    color: var(--color-text);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

input:not([type=range]):focus {
    outline: 2px solid var(--color-primary);
    border-color: transparent;
}

/* Range Slider Styling */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    height: 12px;
    border-radius: 6px;
    margin-top: 0.5rem;
}

input[type=range]:focus {
    outline: none;
}

/* Webkit (Chrome, Safari, Edge) */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 12px;
    cursor: pointer;
    background: #e5e7eb; /* Fallback */
    border-radius: 6px;
    border: none;
}

input[type=range]::-webkit-slider-thumb {
    height: 28px;
    width: 28px;
    border-radius: 50%;
    background: #10B981;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -8px; /* Centers thumb on track */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
}

/* Firefox */
input[type=range]::-moz-range-track {
    width: 100%;
    height: 12px;
    cursor: pointer;
    background: #e5e7eb;
    border-radius: 6px;
    border: none;
}

input[type=range]::-moz-range-thumb {
    height: 28px;
    width: 28px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #10B981;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* IE/Edge (Legacy) - Just in case */
input[type=range]::-ms-track {
    width: 100%;
    height: 12px;
    cursor: pointer;
    background: transparent;
    border-color: transparent;
    color: transparent;
}
input[type=range]::-ms-fill-lower {
    background: #10B981;
    border-radius: 6px;
}
input[type=range]::-ms-fill-upper {
    background: #e5e7eb;
    border-radius: 6px;
}
input[type=range]::-ms-thumb {
    height: 28px;
    width: 28px;
    border-radius: 50%;
    background: #10B981;
    cursor: pointer;
    margin-top: 0;
}

/* ==========================================================================
   #Header
   ========================================================================== */

.site-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(11, 15, 25, 0.8); /* Default dark background for tech-futurist */
}

body.style-kit-corporate-stabilizer .site-header {
    background: rgba(255, 255, 255, 0.9);
}

body.style-kit-creative-disruptor .site-header {
    background: var(--color-bg);
    border-bottom: var(--border-width, 1px) solid var(--color-border);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.site-branding {
    font-weight: bold;
    font-size: 1.25rem;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-branding img {
    max-height: 48px;
    width: auto;
}

.site-title {
    color: var(--color-text);
}

.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: var(--color-text);
    font-weight: 600;
    padding: 0.5rem 0.25rem;
    border-bottom: 2px solid transparent;
}

.main-navigation a:focus,
.main-navigation a:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-cta {
    display: inline-flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
}

.menu-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    margin: 4px 0;
}

@media (max-width: 960px) {
    .main-navigation {
        position: fixed;
        inset: var(--header-height) 0 auto 0;
        background: var(--color-bg);
        padding: 1rem 1.5rem 2rem;
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-100%);
        visibility: hidden;
        transition: transform 0.3s ease, visibility 0.3s ease;
        width: 100%;
        z-index: 90;
    }

    .main-navigation.is-open {
        transform: translateY(0);
        visibility: visible;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .main-navigation a {
        width: 100%;
        display: block;
        padding: 0.75rem 0;
    }

    .header-cta {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
    }
}

body.nav-open {
    overflow: hidden;
}

/* ==========================================================================
   #Footer
   ========================================================================== */
.site-footer {
    background: var(--color-bg-alt);
    padding: 4rem 0;
    border-top: 1px solid var(--color-border);
}

.roi-text-results {
    margin-top: 1rem;
}

.roi-results canvas {
    max-height: 320px;
}

.comparison-table-wrapper table {
    border-collapse: collapse;
    width: 100%;
    font-size: 1rem;
}

.comparison-table-wrapper th,
.comparison-table-wrapper td {
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.comparison-table-wrapper tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

body.style-kit-corporate-stabilizer .comparison-table-wrapper tbody tr:nth-child(odd) {
    background: rgba(15, 23, 42, 0.04);
}

.comparison-table-wrapper td strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--color-text);
}

.comparison-icon {
    width: 22px;
    height: 22px;
    display: block;
    margin: 0 auto 0.35rem;
}

/* ROI Calculator Visuals */
.roi-results canvas {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Service Placeholder */
.service-placeholder {
    border: 2px dashed var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

/* ==========================================================================
   #Accessibility & Contrast Safeguards
   ========================================================================== */

/* Force dark text on explicitly white backgrounds (e.g. Gutenberg blocks) */
.has-white-background-color,
.has-background-white,
.bg-white {
    color: #1a202c !important;
    --color-text: #1a202c;
    --color-text-muted: #4a5568;
}

.has-white-background-color h1,
.has-white-background-color h2,
.has-white-background-color h3,
.has-white-background-color h4,
.has-white-background-color h5,
.has-white-background-color h6 {
    color: #111827 !important;
}

/* Force light text on explicitly dark backgrounds */
.has-black-background-color,
.has-background-black,
.bg-black {
    color: #F3F4F6 !important;
    --color-text: #F3F4F6;
    --color-text-muted: #9CA3AF;
}

/* Table Contrast Fix */
.comparison-table-wrapper th {
    background-color: var(--color-bg-alt); /* Ensure header has background */
    color: var(--color-text);
}
