/* styles/base/reset.css */

/* Box sizing reset - from original styles.css */
*, *::before, *::after { 
    box-sizing: border-box; 
}

/* Root variables - from original styles.css */
:root {
    --theme-background: #1a1e2d; /* Dark background */
    --theme-text: #e0e0e0; /* Light text */
    --theme-text-secondary: #a0a0b0; /* Lighter secondary text */
    --theme-accent: #4a90e2; /* Accent blue */
    --theme-border: #30364f; /* Subtle border */
    --theme-section-bg: #252a3d; /* Section background */
    --theme-section-hover-bg: #2e3450; /* Section hover */
    --theme-table-header-bg: #2e3450;
    --theme-table-row-even-bg: #212534;
    --theme-chart-bg: #202433; /* Chart background */
    --theme-bullish: #00c853; /* Green */
    --theme-bearish: #ff3d71; /* Red */
    --theme-neutral: #ffaa00; /* Orange/Yellow */
    --sidebar-width: 240px;
    --sidebar-width-collapsed: 60px;
    --header-height: 60px;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-headings: 'Segoe UI', Roboto, sans-serif; /* Slightly different for headings */
    --font-data: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; /* Monospace for data */
    --font-size-base: 16px;
    --font-weight-body: 400;
    --font-weight-heading: 600;
}

/* Body styles - from original styles.css */
body {
    background-color: var(--theme-background);
    color: var(--theme-text);
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-body);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* App layout display - from original styles.css */
.app-layout {
    display: none;
    min-height: 100vh;
}

/* Show app layout when ready */
.app-layout.loaded {
    display: flex;
}

/* Main content styles - from original styles.css */
.main-content {
    flex-grow: 1;
    padding-left: var(--sidebar-width); /* Offset by sidebar width */
    transition: padding-left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed + .main-content {
    padding-left: var(--sidebar-width-collapsed); /* Adjust offset when collapsed */
}

/* Content section styles */
.content-section {
    padding: 1.5rem;
    flex-grow: 1; /* Allow content to fill space */
}

/* General section styling */
.content-section > section {
    margin-bottom: 2rem;
}

.content-section > section:last-child {
    margin-bottom: 0;
}

.content-section h2 {
    font-size: 1.3rem;
    color: var(--theme-accent);
    margin-top: 0;
    margin-bottom: 1rem;
}

.content-section h3 {
    font-size: 1.15rem;
    color: var(--theme-text);
    margin-top: 1rem;
    margin-bottom: 0.8rem;
}

/* Status bar styles */
.status-bar {
    padding: 0;
    background-color: transparent;
    font-size: 0.8rem;
    color: var(--theme-text-secondary);
    border: none;
    margin: 0;
    display: flex;
    gap: 1rem;
}

.status-item {
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.status-item code {
    font-size: 1em;
    color: var(--theme-text);
    background-color: transparent;
    padding: 0;
    word-break: break-all;
}

/* Form element base styles */
label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: var(--theme-text-secondary);
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.8rem;
    border: 1px solid var(--theme-border);
    background-color: var(--theme-section-bg);
    color: var(--theme-text);
    border-radius: 4px;
    font-size: 0.95rem;
    max-width: 400px;
}

input:focus, 
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

/* Number input improvements */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Textarea specific styles */
textarea {
    min-height: 100px;
    resize: vertical;
}

/* Horizontal rules */
hr {
    border: none;
    border-top: 1px solid var(--theme-border);
    margin: 1rem 0;
}

hr.section-divider {
    border-top: 1px dashed var(--theme-border);
    margin: 2rem 0;
}

/* Links */
a {
    color: var(--theme-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.25rem;
}

/* Code blocks */
code {
    font-family: var(--font-data);
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

pre {
    background-color: var(--theme-section-bg);
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
}

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

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--theme-border);
}

th {
    background-color: var(--theme-table-header-bg);
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: var(--theme-table-row-even-bg);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Utility classes that were in original CSS */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }

.m-0 { margin: 0; }
.p-0 { padding: 0; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }

/* Loading states */
.app-loading {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app-loading.loaded {
    opacity: 1;
}

/* Focus states for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 2px solid var(--theme-accent);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .sidebar,
    .content-header,
    .app-footer,
    .no-print {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
    }
}

/* Animation preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    button {
        border: 2px solid;
    }

    .card {
        border: 1px solid var(--theme-border);
    }
}