/* Changelog styles - used for both standalone pages and sidebar */

/* Body background for standalone changelog pages */
body:has(.changelog) {
    background: #f5f5f5;
}

/* Base styles for changelog pages */
.changelog {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px 20px 20px 20px;
}

/* Headings */
.changelog h1 {
    color: #1a1a1a;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 8px;
}

.changelog h2 {
    color: #1a1a1a;
    margin-top: 40px;
    padding: 10px 15px;
    background: #e9ecef;
    border-radius: 6px;
    font-size: 1.1em;
}

.changelog h2 a {
    color: inherit;
    text-decoration: none;
}

.changelog h2 a:visited {
    color: inherit;
}

.changelog h2 a:hover {
    text-decoration: underline;
}

.changelog h3 {
    color: #333;
    margin-top: 20px;
    font-size: 1em;
}

/* Meta info */
.changelog .meta {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.changelog .subtitle {
    color: #666;
    margin-bottom: 20px;
}

/* Change entries */
.changelog .change {
    background: white;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 6px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.changelog .change-added { border-left: 4px solid #28a745; }
.changelog .change-removed { border-left: 4px solid #dc3545; }
.changelog .change-modified { border-left: 4px solid #ffc107; }
.changelog .change-introduced { border-left: 4px solid #17a2b8; }

.changelog .change-type {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.7em;
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.changelog .change-added .change-type { color: #28a745; }
.changelog .change-removed .change-type { color: #dc3545; }
.changelog .change-modified .change-type { color: #b38600; }
.changelog .change-introduced .change-type { color: #17a2b8; }

.changelog .item-type {
    color: #666;
    font-size: 0.85em;
}

.changelog .item-name {
    font-weight: 600;
    color: #1a1a1a;
}

.changelog .item-name a {
    color: inherit;
    text-decoration: none;
}

.changelog .item-name a:visited {
    color: inherit;
}

.changelog .item-name a:hover {
    text-decoration: underline;
}

/* Change details (what specifically changed) */
.changelog .change-details {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    margin: 4px 0;
}

/* Code signatures */
.changelog .signature {
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: 0.85em;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 5px 0;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

/* Diff highlighting */
.changelog .diff-removed { color: #dc3545; font-weight: 600; }
.changelog .diff-added { color: #28a745; font-weight: 600; }

/* Misc */
.changelog .no-changes {
    color: #666;
    font-style: italic;
    padding: 10px 0;
}

.changelog .version-section {
    margin-bottom: 30px;
}

/* Index page - stats */
.changelog .stats {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.changelog .stat {
    text-align: center;
    min-width: 100px;
}

.changelog .stat-value {
    font-size: 2em;
    font-weight: bold;
}

.changelog .stat-label {
    color: #666;
    font-size: 0.9em;
}

.changelog .stat-introduced .stat-value { color: #17a2b8; }
.changelog .stat-added .stat-value { color: #28a745; }
.changelog .stat-removed .stat-value { color: #dc3545; }
.changelog .stat-modified .stat-value { color: #b38600; }

/* Index page - package list */
.changelog .package-group {
    margin: 12px 0;
}

.changelog .package-name {
    font-weight: 600;
    color: #333;
    margin: 10px 0 3px 0;
    font-size: 1.1em;
}

.changelog .type-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changelog .type-item {
    background: white;
    margin: 2px 0;
    padding: 5px 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.changelog .type-item a {
    color: #0066cc;
    text-decoration: none;
}

.changelog .type-item a:hover {
    text-decoration: underline;
}

.changelog .change-summary {
    font-size: 0.85em;
    color: #666;
}

.changelog .count-added { color: #28a745; }
.changelog .count-removed { color: #dc3545; }
.changelog .count-modified { color: #b38600; }
.changelog .count-introduced { color: #17a2b8; }

.changelog .version-count {
    color: #666;
    margin-left: 10px;
}

/* =============================================================================
   VERSION SUMMARY PAGE
   ============================================================================= */

/* Summary page specific - more compact than changelog */
.summary-page {
    max-width: 1000px;
}

.summary-page h1 {
    font-size: 1.5em;
}

/* Stats line */
.summary-stats {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.summary-stats .stat-added { color: #28a745; font-weight: 600; }
.summary-stats .stat-removed { color: #dc3545; font-weight: 600; }
.summary-stats .stat-modified { color: #b38600; font-weight: 600; }

/* Collapsible sections */
.summary-section {
    margin: 4px 0;
    border-radius: 6px;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: #e9ecef;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.section-header::-webkit-details-marker {
    display: none;
}

.section-header::before {
    content: "▶";
    font-size: 0.7em;
    transition: transform 0.15s ease;
    color: #666;
}

details[open] > .section-header::before {
    transform: rotate(90deg);
}

.section-header .section-title {
    font-weight: 500;
    color: #495057;
    flex: 1;
}

.section-header .section-count {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Section colors */
.section-added { border-left: 4px solid #28a745; }
.section-removed { border-left: 4px solid #dc3545; }
.section-modified { border-left: 4px solid #ffc107; }

.section-added .section-count { color: #28a745; }
.section-removed .section-count { color: #dc3545; }
.section-modified .section-count { color: #b38600; }

.section-body {
    padding: 4px 0;
}

/* Type cards - collapsible */
.type-card {
    margin: 3px 0;
    background: white;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
}

.type-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.type-card-header::-webkit-details-marker {
    display: none;
}

.type-card-header::before {
    content: "▶";
    font-size: 0.65em;
    transition: transform 0.15s ease;
    color: #999;
    flex-shrink: 0;
}

details.type-card[open] > .type-card-header::before {
    transform: rotate(90deg);
}

.type-card-header .type-kind {
    font-size: 0.75em;
    color: #666;
    text-transform: lowercase;
    flex-shrink: 0;
}

.type-card-header .type-name {
    font-weight: 500;
    font-size: 0.9em;
    color: #0066cc;
    text-decoration: none;
    word-break: break-word;
}

.type-card-header .type-name:hover {
    text-decoration: underline;
}

.type-card-header .change-count {
    font-size: 0.8em;
    color: #666;
    margin-left: auto;
    flex-shrink: 0;
    line-height: 1;
}

.type-card-header .changelog-link {
    font-size: 0.8em;
    color: #999;
    text-decoration: none;
    flex-shrink: 0;
    line-height: 1;
}

.type-card-header .changelog-link:hover {
    color: #0066cc;
    text-decoration: underline;
}

.type-card-body {
    padding: 2px 8px 8px 8px;
    border-top: 1px solid #f0f0f0;
}

/* Simple type cards (non-collapsible for added/removed) */
.type-card-simple .type-card-header {
    cursor: default;
    user-select: auto;
}

.type-card-simple .type-card-header::before {
    display: none;
}

.type-card-simple .type-card-header .type-name {
    flex: 1;
}

.type-card-header .type-label {
    font-size: 0.8em;
    color: #666;
    line-height: 1;
}

/* Color bars on headers - only in package view */
.view-package .type-card-added > .type-card-header {
    border-left: 3px solid #28a745;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.view-package .type-card-removed > .type-card-header {
    border-left: 3px solid #dc3545;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.view-package details.type-card > .type-card-header {
    border-left: 3px solid #ffc107;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.view-package details.type-card[open] > .type-card-header {
    border-bottom-left-radius: 0;
}

/* Compact change entries - specificity must match .changelog .change */
.change.change-compact {
    padding: 3px 6px;
    margin: 2px 0;
    font-size: 0.9em;
    box-shadow: none;
    border-radius: 3px;
}

/* Remove color bars from individual changes on summary page (keep on full changelog) */
.summary-page .change.change-compact {
    border-left: none;
}

.change.change-compact .item-name {
    font-size: 0.85em;
}

.change-details-inline {
    font-size: 0.9em;
    color: #666;
    margin-left: 8px;
}

/* Compact signatures - specificity must match .changelog .signature */
.signature.signature-compact {
    padding: 2px 6px;
    margin: 2px 0;
    font-size: 0.82em;
}

/* Old/new signature diff display */
.signature-old {
    color: #666;
}

.signature-new {
    color: #666;
}

/* =============================================================================
   VIEW TOGGLE (API Changes page)
   ============================================================================= */

.view-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.view-toggle-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    color: #666;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-toggle-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.view-toggle-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.view-toggle-btn:hover {
    background: #e8e8e8;
}

.view-toggle-btn.active {
    background: #dee2e6;
    border-color: #dee2e6;
    color: #212529;
}

/* View switching */
[data-view="change-type"] .view-package {
    display: none;
}

[data-view="package"] .view-change-type {
    display: none;
}

/* Package section header */
.section-package {
    border-left: 4px solid #6c757d;
}

.section-package .section-title {
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: 0.9em;
}

.section-package .section-count {
    background: none;
    font-weight: 400;
    color: #666;
}

/* =============================================================================
   DARK MODE
   ============================================================================= */

/* Body background for standalone pages */
html.dark-mode body:has(.changelog) {
    background: #0f1419;
}

/* Base container */
html.dark-mode .changelog {
    color: #e7e9ea;
}

/* Headings */
html.dark-mode .changelog h1 {
    color: #c9d1d9;
    border-bottom-color: #2f3640;
}

html.dark-mode .changelog h2 {
    color: #c9d1d9;
    background: #252b33;
}

html.dark-mode .changelog h2 a,
html.dark-mode .changelog h2 a:visited {
    color: inherit;
}

html.dark-mode .changelog h3 {
    color: #c9d1d9;
}

/* Meta info */
html.dark-mode .changelog .meta,
html.dark-mode .changelog .subtitle {
    color: #bdc4cc;
}

/* Change entries */
html.dark-mode .changelog .change {
    background: #1a1f26;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

html.dark-mode .changelog .item-type {
    color: #bdc4cc;
}

html.dark-mode .changelog .item-name {
    color: #e7e9ea;
}

html.dark-mode .changelog .item-name a,
html.dark-mode .changelog .item-name a:visited {
    color: inherit;
}

/* Change details */
html.dark-mode .changelog .change-details {
    color: #bdc4cc;
}

/* Code signatures */
html.dark-mode .changelog .signature {
    background: #252b33;
    color: #e7e9ea;
}

/* Misc */
html.dark-mode .changelog .no-changes {
    color: #bdc4cc;
}

/* Index page - stats */
html.dark-mode .changelog .stats {
    background: #1a1f26;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

html.dark-mode .changelog .stat-label {
    color: #bdc4cc;
}

/* Index page - package list */
html.dark-mode .changelog .package-name {
    color: #c9d1d9;
}

html.dark-mode .changelog .type-item {
    background: #1a1f26;
}

html.dark-mode .changelog .type-item a {
    color: #58a6ff;
}

html.dark-mode .changelog .change-summary {
    color: #bdc4cc;
}

html.dark-mode .changelog .version-count {
    color: #bdc4cc;
}

/* Accent colors - lighter pastel versions for dark mode */
html.dark-mode .changelog .change-added { border-left-color: #86efac; }
html.dark-mode .changelog .change-removed { border-left-color: #fca5a5; }
html.dark-mode .changelog .change-modified { border-left-color: #fde68a; }
html.dark-mode .changelog .change-introduced { border-left-color: #7dd3fc; }

html.dark-mode .changelog .change-added .change-type { color: #86efac; }
html.dark-mode .changelog .change-removed .change-type { color: #fca5a5; }
html.dark-mode .changelog .change-modified .change-type { color: #fde68a; }
html.dark-mode .changelog .change-introduced .change-type { color: #7dd3fc; }

/* Diff highlighting */
html.dark-mode .changelog .diff-removed { color: #fca5a5; }
html.dark-mode .changelog .diff-added { color: #86efac; }

/* Stat values */
html.dark-mode .changelog .stat-introduced .stat-value { color: #7dd3fc; }
html.dark-mode .changelog .stat-added .stat-value { color: #86efac; }
html.dark-mode .changelog .stat-removed .stat-value { color: #fca5a5; }
html.dark-mode .changelog .stat-modified .stat-value { color: #fde68a; }

/* Count indicators */
html.dark-mode .changelog .count-added { color: #86efac; }
html.dark-mode .changelog .count-removed { color: #fca5a5; }
html.dark-mode .changelog .count-modified { color: #fde68a; }
html.dark-mode .changelog .count-introduced { color: #7dd3fc; }

/* =============================================================================
   DARK MODE - VERSION SUMMARY
   ============================================================================= */

/* Stats line */
html.dark-mode .summary-stats {
    color: #bdc4cc;
}

html.dark-mode .summary-stats .stat-added { color: #86efac; }
html.dark-mode .summary-stats .stat-removed { color: #fca5a5; }
html.dark-mode .summary-stats .stat-modified { color: #fde68a; }

/* Section headers */
html.dark-mode .section-header {
    background: #252b33;
}

html.dark-mode .section-header::before {
    color: #bdc4cc;
}

html.dark-mode .section-header .section-title {
    color: #bdc4cc;
}

html.dark-mode .section-header .section-count {
    background: rgba(255,255,255,0.1);
}

html.dark-mode .section-added { border-left-color: #86efac; }
html.dark-mode .section-removed { border-left-color: #fca5a5; }
html.dark-mode .section-modified { border-left-color: #fde68a; }

html.dark-mode .section-added .section-count { color: #86efac; }
html.dark-mode .section-removed .section-count { color: #fca5a5; }
html.dark-mode .section-modified .section-count { color: #fde68a; }

/* Type cards */
html.dark-mode .type-card {
    background: #1a1f26;
    border-color: #2f3640;
}

html.dark-mode .type-card-header::before {
    color: #bdc4cc;
}

html.dark-mode .type-card-header .type-kind {
    color: #bdc4cc;
}

html.dark-mode .type-card-header .type-name {
    color: #58a6ff;
}

html.dark-mode .type-card-header .change-count {
    color: #bdc4cc;
}

html.dark-mode .type-card-header .changelog-link {
    color: #6e7681;
}

html.dark-mode .type-card-header .changelog-link:hover {
    color: #58a6ff;
}

html.dark-mode .type-card-body {
    border-top-color: #2f3640;
}

html.dark-mode .type-card-header .type-label {
    color: #bdc4cc;
}

/* Color bars on headers - dark mode (package view only) */
html.dark-mode .view-package .type-card-added > .type-card-header {
    border-left-color: #86efac;
}

html.dark-mode .view-package .type-card-removed > .type-card-header {
    border-left-color: #fca5a5;
}

html.dark-mode .view-package details.type-card > .type-card-header {
    border-left-color: #fde68a;
}

/* Compact change entries */
html.dark-mode .change.change-compact {
    box-shadow: none;
}

html.dark-mode .change-details-inline {
    color: #bdc4cc;
}

html.dark-mode .signature-old,
html.dark-mode .signature-new {
    color: #bdc4cc;
}

/* View toggle */
html.dark-mode .view-toggle-btn {
    background: #252b33;
    border-color: #3d4450;
    color: #bdc4cc;
}

html.dark-mode .view-toggle-btn:hover {
    background: #2f3640;
}

html.dark-mode .view-toggle-btn.active {
    background: #4b5563;
    border-color: #4b5563;
    color: white;
}

/* Package section */
html.dark-mode .section-package {
    border-left-color: #6b7280;
}

html.dark-mode .section-package .section-count {
    color: #9ca3af;
}
