/* 
 * SimpleFeasibility v2 - Base Styles
 * Reset, Typography, and Foundation Styles
 */

/* ═══════════════════════════════════════════════════════════════
   RESET & BOX SIZING
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    letter-spacing: var(--tracking-tight);
}

h1 {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-base);
}

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--duration-150) var(--ease-out);
}

a:hover {
    color: var(--text-link-hover);
}

strong, b {
    font-weight: var(--font-semibold);
}

small {
    font-size: var(--text-sm);
}

code, pre {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

code {
    background-color: var(--surface-secondary);
    padding: var(--space-0-5) var(--space-1-5);
    border-radius: var(--radius-md);
    color: var(--color-accent-600);
}

pre {
    background-color: var(--color-neutral-900);
    color: var(--color-neutral-100);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ═══════════════════════════════════════════════════════════════
   LISTS
   ═══════════════════════════════════════════════════════════════ */

ul, ol {
    list-style: none;
}

/* ═══════════════════════════════════════════════════════════════
   MEDIA
   ═══════════════════════════════════════════════════════════════ */

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

svg {
    display: inline-block;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS - Base Styles
   ═══════════════════════════════════════════════════════════════ */

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

input, textarea, select {
    background-color: var(--surface-primary);
    border: var(--border-width-1) solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    width: 100%;
    transition: border-color var(--duration-150) var(--ease-out),
                box-shadow var(--duration-150) var(--ease-out);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    background-size: 20px;
    padding-right: var(--space-10);
}

/* ═══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════ */

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: var(--border-width-1) solid var(--border-primary);
}

th {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    background-color: var(--surface-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-light { font-weight: var(--font-light); }
.font-normal { font-weight: var(--font-regular); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-muted); }

.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-tertiary { background-color: var(--bg-tertiary); }

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR STYLING
   ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-secondary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: var(--radius-full);
    transition: background var(--duration-150) var(--ease-out);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-secondary) var(--surface-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   SELECTION STYLING
   ═══════════════════════════════════════════════════════════════ */

::selection {
    background-color: var(--color-primary-200);
    color: var(--color-primary-900);
}

[data-theme="dark"] ::selection {
    background-color: var(--color-primary-800);
    color: var(--color-primary-100);
}

/* ═══════════════════════════════════════════════════════════════
   FOCUS VISIBLE - Accessibility
   ═══════════════════════════════════════════════════════════════ */

:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-md);
}

