/* Market Intelligence Stack Dashboard Styles */

/* === RESET & BASICS === */

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

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* === HEADER === */

.header {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem 0;
    border-bottom: 2px solid #34495e;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: white;
    border-bottom-color: #3498db;
}

/* === MAIN CONTAINER === */

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    min-height: calc(100vh - 200px);
}

/* === SECTIONS === */

.page-section {
    background-color: white;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.page-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 0.75rem;
}

.page-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #34495e;
}

.section-description {
    font-size: 0.95rem;
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

/* === INFO BOXES === */

.info-section {
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
}

.info-box {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.info-box p {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.limitations {
    list-style: none;
    padding-left: 0;
}

.limitations li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #555;
}

.limitations li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #e74c3c;
}

/* === STATUS GRID === */

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.status-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1.5rem;
    text-align: center;
}

.status-card h3 {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7f8c8d;
}

.status-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

.metric-label {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* === QUICK START === */

.quick-start {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.quick-start-card {
    background-color: #ecf0f1;
    border-radius: 4px;
    padding: 1.5rem;
    text-align: center;
}

.quick-start-card h3 {
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.quick-start-card p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1.25rem;
}

/* === HEALTH GRID === */

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border-left: 3px solid #95a5a6;
}

.health-label {
    font-weight: 500;
    color: #2c3e50;
}

.health-status {
    padding: 0.25rem 0.75rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
}

.health-status.healthy {
    background-color: #d5f4e6;
    color: #27ae60;
}

/* === FORMS === */

.search-form,
.assessment-form {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #bdc3c7;
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-range {
    width: 100%;
    height: 6px;
    cursor: pointer;
}

.form-hint {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

.form-note {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: #7f8c8d;
}

.form-note.success {
    color: #27ae60;
}

.form-note.error {
    color: #e74c3c;
}

/* === BUTTONS === */

.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #34495e;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.button:hover {
    background-color: #2c3e50;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.button-primary {
    background-color: #3498db;
}

.button-primary:hover {
    background-color: #2980b9;
}

/* === TABLES === */

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.results-table thead {
    background-color: #ecf0f1;
    border-bottom: 2px solid #bdc3c7;
}

.results-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
}

.results-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ecf0f1;
}

.results-table tbody tr:hover {
    background-color: #f8f9fa;
}

.results-table code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 2px;
    font-family: "Courier New", monospace;
    font-size: 0.85rem;
}

.results-table.compact {
    margin: 0;
}

.table-note {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
}

/* === STATE GRID === */

.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.state-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1.5rem;
}

.state-content {
    margin-top: 1rem;
}

.state-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #7f8c8d;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.state-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.state-detail {
    font-size: 0.9rem;
    color: #555;
}

.state-info {
    background-color: #fef9e7;
    border-left: 4px solid #f39c12;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 3px;
}

.state-info p {
    margin-bottom: 0.5rem;
}

.state-summary {
    background-color: #ecf0f1;
    padding: 1rem;
    border-radius: 3px;
    line-height: 1.8;
}

.analysis-insights {
    background-color: #ecf0f1;
    padding: 1rem;
    border-radius: 3px;
    line-height: 1.8;
}

/* === RESULTS CONTAINER === */

.results-container,
.analysis-container {
    margin-top: 1.5rem;
}

.results-header {
    background-color: #ecf0f1;
    padding: 1rem;
    border-radius: 3px;
    margin-bottom: 1rem;
}

.results-header p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.confidence-note {
    font-size: 0.85rem;
    color: #7f8c8d;
    font-style: italic;
}

.placeholder {
    color: #95a5a6;
    font-style: italic;
    padding: 2rem;
    text-align: center;
}

.error {
    background-color: #fadbd8;
    color: #c0392b;
    padding: 1rem;
    border-radius: 3px;
    border-left: 4px solid #e74c3c;
}

/* === ERROR CONTAINER === */

.error-container {
    background-color: #fadbd8;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    padding: 2rem;
    text-align: center;
}

.error-message {
    margin-bottom: 0.5rem;
    color: #c0392b;
    font-size: 1.05rem;
}

.error-code {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* === FOOTER === */

.footer {
    background-color: #34495e;
    color: #bdc3c7;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

.timestamp {
    font-size: 0.85rem;
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .status-grid,
    .quick-start,
    .state-grid,
    .health-grid {
        grid-template-columns: 1fr;
    }

    .page-section {
        padding: 1.5rem 1rem;
    }

    .logo {
        font-size: 1.1rem;
    }
}

/* === ACCESSIBILITY === */

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

/* === PHASE 5.4 ENHANCEMENTS === */

/* Current Market State Panel */

.current-state-panel {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.state-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #ecf0f1;
    font-size: 0.95rem;
}

.state-row:last-child {
    border-bottom: none;
}

.state-row.timestamp {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
    border-bottom: none;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.state-label {
    font-weight: 500;
    color: #2c3e50;
    flex: 0 0 auto;
    margin-right: 1rem;
}

.state-value {
    color: #34495e;
    flex: 1 1 auto;
    text-align: right;
}

/* Validation Metrics Grid */

.validation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.validation-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1.5rem;
    text-align: center;
}

.validation-metric {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.validation-card .metric-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7f8c8d;
}

.validation-card .metric-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Program Status */

.program-status {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-left: 4px solid #27ae60;
    border-radius: 4px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.program-status .status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #ecf0f1;
    font-size: 0.95rem;
}

.program-status .status-row:last-child {
    border-bottom: none;
}

.status-label {
    font-weight: 500;
    color: #2c3e50;
    flex: 0 0 auto;
    margin-right: 1rem;
}

.status-value {
    color: #34495e;
    flex: 1 1 auto;
    text-align: right;
}

.status-value.highlight {
    color: #27ae60;
    font-weight: 600;
}
