/* CU Compliance News - Stylesheet */

:root {
    --primary-color: #1a5f7a;
    --primary-dark: #134b5f;
    --secondary-color: #57837b;
    --accent-color: #c38154;
    --texas-color: #bf5700;
    --background: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --success-color: #2e7d32;
    --warning-color: #ed6c02;
    --error-color: #d32f2f;
}

/* Dark mode */
[data-theme="dark"] {
    --primary-color: #3d9cc9;
    --primary-dark: #2d7ea8;
    --secondary-color: #7ab3a9;
    --accent-color: #d9a676;
    --texas-color: #e67d22;
    --background: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #e8e8e8;
    --text-muted: #a0a0a0;
    --border-color: #2d3a5a;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
}

[data-theme="dark"] .navbar {
    background-color: #0f0f23;
}

[data-theme="dark"] .sidebar-section {
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

[data-theme="dark"] .article-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

[data-theme="dark"] .footer {
    background-color: #0f0f23;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255,255,255,0.15);
    color: white;
}

/* Theme toggle button */
.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: 0.5rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.5);
}

.theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: inline;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.sidebar-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.sidebar-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.stat-list {
    list-style: none;
}

.stat-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-list li:last-child {
    border-bottom: none;
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
}

.filter-list {
    list-style: none;
}

.filter-list li a {
    display: block;
    padding: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.filter-list li a:hover {
    background-color: var(--background);
}

.filter-list li a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Deadline Alerts */
.deadline-alerts {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.alert-danger {
    background: #ffebee;
    border-left: 4px solid #c62828;
    color: #b71c1c;
}

.alert-warning {
    background: #fff3e0;
    border-left: 4px solid #ef6c00;
    color: #e65100;
}

.alert strong {
    margin-right: 0.5rem;
}

.alert-item {
    color: inherit;
    text-decoration: none;
}

.alert-item:hover {
    text-decoration: underline;
}

.alert-item .deadline {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: 0.25rem;
}

.alert .more-link {
    color: inherit;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.75rem;
    color: var(--primary-dark);
}

/* Search Form */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 200px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Article Cards */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.article-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}

.article-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.article-card.read {
    opacity: 0.85;
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.article-title {
    flex: 1;
}

.article-title a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.source-badge {
    background: var(--background);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.category-badge {
    background: rgba(26, 95, 122, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    text-transform: capitalize;
}

.texas-badge {
    background: rgba(191, 87, 0, 0.1);
    color: var(--texas-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.priority-badge {
    background: rgba(237, 108, 2, 0.1);
    color: var(--warning-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.article-summary {
    color: var(--text-color);
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.article-signals {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid rgba(26, 95, 122, 0.12);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(26, 95, 122, 0.06), rgba(87, 131, 123, 0.06));
}

.signal-group {
    min-width: 180px;
    flex: 1 1 220px;
}

.signal-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-dark);
    margin-bottom: 0.3rem;
}

.signal-value {
    display: block;
    font-size: 1rem;
    color: var(--text-color);
}

.signal-reason {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.article-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: #456b63;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
    outline: none;
}

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

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

thead {
    background: var(--primary-color);
    color: white;
}

th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background: rgba(26, 95, 122, 0.02);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Article View */
.article-view {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.article-body {
    line-height: 1.8;
    color: var(--text-color);
}

.article-body h2,
.article-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

.article-body p {
    margin-bottom: 1rem;
}

.article-body ul,
.article-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Filters */
.filters {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.filter-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Texas Banner */
.texas-banner {
    background: linear-gradient(135deg, rgba(191, 87, 0, 0.08), rgba(26, 95, 122, 0.08));
    border: 1px solid rgba(191, 87, 0, 0.2);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.texas-banner h2 {
    font-size: 1.1rem;
    color: var(--texas-color);
    margin-bottom: 0.5rem;
}

.texas-banner p {
    color: var(--text-color);
}

/* Source List */
.source-list {
    display: grid;
    gap: 1rem;
}

.source-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.source-card h3 {
    margin-bottom: 0.5rem;
}

.source-card a {
    color: var(--primary-color);
    text-decoration: none;
}

.source-card a:hover {
    text-decoration: underline;
}

/* Footer spacing helper */
.spacer {
    height: 1rem;
}

/* Login page */
.auth-card {
    max-width: 420px;
    margin: 3rem auto;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.auth-card h1 {
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Buttons and helpers */
.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

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

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-candidate {
    background: rgba(195, 129, 84, 0.15);
    color: var(--accent-color);
}

.status-confirmed {
    background: rgba(46, 125, 50, 0.15);
    color: var(--success-color);
}

.status-review-soon {
    background: rgba(237, 108, 2, 0.14);
    color: var(--warning-color);
}

.status-usable {
    background: rgba(46, 125, 50, 0.14);
    color: var(--success-color);
}

.vault-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.actions-filters {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-info {
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.compliance-empty-state {
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    background: rgba(26, 95, 122, 0.03);
}

/* Vault compliance coverage */
.vault-home-grid,
.compliance-summary-grid,
.compliance-source-list {
    display: grid;
    gap: 1rem;
}

.compliance-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.vault-home-card,
.compliance-summary-card,
.compliance-metric-card,
.evidence-group {
    border: 1px solid rgba(26, 95, 122, 0.08);
}

.vault-home-card-featured {
    border-color: rgba(26, 95, 122, 0.22);
    box-shadow: 0 8px 24px rgba(26, 95, 122, 0.08);
}

.vault-home-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.vault-home-actions-wrap {
    flex-wrap: wrap;
}

.vault-home-card-copy {
    margin-top: 0.85rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.compliance-actions,
.compliance-filter-bar {
    margin-bottom: 1.5rem;
}

.compliance-summary-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.compliance-summary-header,
.compliance-detail-summary,
.compliance-section-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.compliance-summary-title {
    font-size: 1.15rem;
    margin: 0;
}

.compliance-summary-title a {
    color: var(--primary-dark);
    text-decoration: none;
}

.compliance-summary-title a:hover,
.evidence-group a:hover {
    text-decoration: underline;
}

.compliance-summary-copy {
    margin: 0;
    color: var(--text-color);
}

.compliance-summary-notes,
.compliance-row-note,
.compliance-section-description {
    color: var(--text-muted);
}

.compliance-score-chip,
.compliance-score-panel {
    background: linear-gradient(135deg, rgba(26, 95, 122, 0.08), rgba(87, 131, 123, 0.06));
    border: 1px solid rgba(26, 95, 122, 0.12);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    min-width: 150px;
}

.compliance-score-chip strong,
.compliance-score-panel-value {
    display: block;
    font-size: 1.6rem;
    color: var(--primary-dark);
    line-height: 1.1;
}

.compliance-score-label,
.compliance-score-panel-label,
.compliance-score-panel-confidence {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.compliance-score-panel-confidence {
    margin-top: 0.45rem;
}

.compliance-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.compliance-metrics div {
    padding: 0.8rem;
    border-radius: 10px;
    background: rgba(26, 95, 122, 0.04);
}

.compliance-metrics dt {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.compliance-metrics dd {
    margin-top: 0.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.compliance-summary-footer {
    justify-content: space-between;
}

.compliance-table-wrapper {
    overflow-x: auto;
}

.compliance-table th,
.compliance-table td {
    vertical-align: top;
}

.compliance-status-pill {
    white-space: nowrap;
}

.compliance-source-card h2,
.evidence-group h3 {
    margin-bottom: 0.35rem;
}

.evidence-group {
    padding: 1rem 0 0 0;
    border-top: 1px solid var(--border-color);
}

.evidence-group:first-child {
    border-top: none;
    padding-top: 0;
}

.compliance-source-points {
    margin: 0.5rem 0 0 1.2rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .sidebar-section {
        margin-bottom: 0;
    }
}

@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .container {
        padding: 1rem;
    }

    .article-view {
        padding: 1rem;
    }

    .actions-filters,
    .compliance-summary-header,
    .compliance-detail-summary,
    .compliance-section-header,
    .compliance-summary-footer {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Accessibility - Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Focus States for Keyboard Navigation */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Inline Forms */
.inline-form {
    display: inline;
}

/* Expandable Original Content */
.article-original-content {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.original-content-inner {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.original-content-inner::-webkit-scrollbar {
    width: 8px;
}

.original-content-inner::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.original-content-inner::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.original-content-inner::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Error Page */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    text-align: center;
}

.error-content {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 500px;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-message {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.error-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Article summary box h2 styling (for accessibility update) */
.article-summary-box h2,
.texas-reason-box h2,
.action-items-box h2 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Print Styles */
@media print {
    .navbar,
    .sidebar,
    .article-actions,
    .article-footer,
    .pagination,
    .skip-link {
        display: none !important;
    }

    .dashboard {
        grid-template-columns: 1fr;
    }

    body {
        background: white;
        color: black;
    }

    .article-card,
    .sidebar-section,
    .article-view,
    .filters,
    .source-card,
    .stat-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
