/* C++ Standard Evolution Viewer - Custom Styles */

/* Accessibility - Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
}

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

/* Font Declarations */
@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/SourceSansPro-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/SourceSansPro-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/SourceSansPro-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/SourceSansPro-BoldItalic.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Source Code Pro';
    src: url('../fonts/SourceCodeProNerdFont-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Source Code Pro';
    src: url('../fonts/SourceCodeProNerdFont-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #006400;
    --primary-hover: #004d00;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --text-color: #212529;
    --text-muted: #6c757d;
    --code-bg: #f5f5f5;
    --header-height: 60px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    background-color: #ffffff;
}

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

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

code {
    background-color: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Source Code Pro Nerd Font', 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

/* Font Awesome Icons - Add spacing */
.fa-solid, .fa-brands, .fa-regular {
    margin-right: 0.4em;
}

/* Landing Page */
.landing-header {
    background: #00a500;
    color: white;
    text-align: center;
    padding: 3rem 2rem;
}

.landing-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.landing-header .subtitle {
    margin: 0;
    font-size: 1.2rem;
    opacity: 0.95;
}

.landing-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.intro {
    background-color: var(--light-bg);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.version-pairs h2 {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.version-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

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

.version-card-header {
    background-color: var(--light-bg);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.version-card-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.version-card-header h3 a {
    color: var(--primary-color);
}

.diff-count {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.version-card-body {
    padding: 1.5rem;
}

.version-description {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.version-card-actions {
    margin-top: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
}

.statistics {
    margin: 3rem 0;
}

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

.stat-card {
    background-color: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

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

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

.about {
    margin: 3rem 0;
}

.about h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.about h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.about ul, .about ol {
    line-height: 1.8;
}

.landing-footer {
    background-color: var(--light-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    margin-top: 3rem;
}

/* Page Header (Overview and Diff Pages) */
.page-header {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
    padding: 1.5rem 2rem;
}

.breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--primary-color);
}

.breadcrumb .current {
    font-weight: 600;
    color: var(--text-color);
}

.page-header h1 {
    margin: 0.5rem 0;
    font-size: 2rem;
}

.version-timeline {
    margin-top: 1rem;
    padding: 0.75rem 0;
    font-size: 0.95rem;
}

.timeline-label {
    font-weight: 600;
    margin-right: 0.5rem;
    color: var(--text-muted);
}

.version-timeline a {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.version-timeline a:hover {
    background-color: rgba(0, 102, 204, 0.1);
    text-decoration: none;
}

.version-timeline a.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.version-timeline span.disabled {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    color: var(--text-muted);
    opacity: 0.5;
    cursor: not-allowed;
    font-style: italic;
}

/* Overview Page */
.overview-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.controls {
    margin-bottom: 2rem;
    background-color: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 1rem;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background-color: var(--light-bg);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sections-list {
    display: grid;
    gap: 1rem;
}

.section-item {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.section-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.section-header {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.section-header h3 a {
    color: var(--text-color);
}

.section-header h3 a:hover {
    color: var(--primary-color);
}

.section-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.size-badge {
    background-color: #e8f5e9;
    color: var(--primary-color);
}

.size-badge.large {
    background-color: #fff3cd;
    color: #856404;
}

.line-badge {
    background-color: var(--light-bg);
    color: var(--text-muted);
}

.version-badge {
    background-color: var(--primary-color);
    color: white;
}

.section-actions {
    margin-left: 1rem;
}

/* Content match indicator */
.section-item.content-match {
    border-left: 4px solid var(--success-color);
    position: relative;
    padding-left: 3rem; /* Make room for the magnifying glass icon */
}

.section-item.content-match::before {
    content: '\f002';
    font-family: 'Font Awesome 7 Free';
    font-weight: 900;
    position: absolute;
    left: 1rem; /* Position icon in the extra padding space */
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--success-color);
    opacity: 0.8;
}

.section-item.content-match .section-header h3 a {
    color: var(--success-color);
}

/* Animate content match appearance */
.section-item.content-match {
    animation: contentMatchFade 0.3s ease-in-out;
}

@keyframes contentMatchFade {
    from {
        border-left-color: transparent;
    }
    to {
        border-left-color: var(--success-color);
    }
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Diff Viewer Page (Custom Header) */
.custom-header {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
    padding: 1.5rem 2rem;
    margin-bottom: 0;
}

.custom-header .breadcrumb {
    margin-bottom: 1rem;
}

.title-section {
    margin-bottom: 1rem;
}

.title-section h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.metadata {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 0.75rem 0;
}

.external-links {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.external-links a {
    margin-right: 1rem;
    font-size: 0.95rem;
}

.warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.large-file-warning {
    font-weight: 500;
}

/* Footer */
.page-footer {
    background-color: var(--light-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    margin-top: 3rem;
    color: var(--text-muted);
}

/* Author Branding */
.author-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 165, 0, 0.1);
    border: 1px solid rgba(0, 165, 0, 0.3);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.author-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.social-icons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.social-icons a {
    font-size: 1.2rem;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.8;
}

.social-icons a:hover {
    transform: scale(1.2);
    opacity: 1;
    text-decoration: none;
}

/* Author Banner (Top of Page) */
.author-banner {
    background: #00a500;
    color: white;
    padding: 0.75rem 2rem;
    text-align: center;
    border-bottom: 2px solid #008000;
}

.author-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.author-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.author-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.author-links a {
    color: white;
    font-size: 1.3rem;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.author-links a:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.author-links i {
    margin: 0;
}

.author-footer {
    background: #00a500;
    color: white;
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-project {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 1.5rem;
}

.footer-links,
.footer-tools,
.footer-more {
    font-size: 0.95rem;
    margin: 0.5rem 0;
}

.footer-tools {
    margin: 1.5rem 0;
    opacity: 0.9;
}

.footer-tools p {
    margin: 0.5rem 0;
}

.footer-links a,
.footer-tools a,
.footer-more a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.footer-links a:hover,
.footer-tools a:hover,
.footer-more a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .landing-header h1 {
        font-size: 2rem;
    }

    .landing-header .subtitle {
        font-size: 1rem;
    }

    .landing-main,
    .overview-main {
        padding: 1rem;
    }

    .version-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .section-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .section-badges {
        width: 100%;
        justify-content: flex-start;
    }

    .section-actions {
        margin-left: 0;
        width: 100%;
    }

    .section-actions .btn {
        width: 100%;
        text-align: center;
    }

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

    .filter-buttons {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
    }

    .version-timeline {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .timeline-label {
        width: 100%;
    }

    .author-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .social-icons {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .author-footer {
        padding: 1.5rem 1rem;
    }

    .footer-project {
        font-size: 1rem;
    }

    .footer-tagline {
        font-size: 0.9rem;
    }

    .footer-links,
    .footer-more {
        font-size: 0.85rem;
    }
}

/* Dark Mode Toggle Button */
#theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

#theme-toggle:active {
    transform: scale(0.95);
}

/* Dark Theme Styles */
body.dark-theme {
    --primary-color: #00a500;
    --primary-hover: #00c800;
    --secondary-color: #9ca3af;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --light-bg: #1f2937;
    --border-color: #374151;
    --text-color: #f3f4f6;
    --text-muted: #9ca3af;
    --code-bg: #1f2937;
    background-color: #111827;
}

body.dark-theme a {
    color: var(--primary-color);
}

body.dark-theme a:hover {
    color: var(--primary-hover);
}

body.dark-theme .landing-header,
body.dark-theme .page-header {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

body.dark-theme .version-card,
body.dark-theme .stat-card,
body.dark-theme .section-item,
body.dark-theme .insight-card,
body.dark-theme .stats-table {
    background: #1f2937;
    border-color: var(--border-color);
}

body.dark-theme .stats-table thead {
    background: var(--primary-color);
}

body.dark-theme .version-card:hover,
body.dark-theme .section-item:hover,
body.dark-theme .insight-card:hover {
    box-shadow: 0 4px 12px rgba(0,165,0,0.2);
}

body.dark-theme code,
body.dark-theme .badge {
    background: var(--code-bg);
    color: var(--text-color);
}

body.dark-theme .btn {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

body.dark-theme .btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

body.dark-theme .author-banner {
    background: #1f2937;
    border-bottom-color: var(--border-color);
}

body.dark-theme .author-footer {
    background: #1f2937;
    border-top-color: var(--border-color);
}

body.dark-theme input[type="text"] {
    background: #1f2937;
    border-color: var(--border-color);
    color: var(--text-color);
}

body.dark-theme input[type="text"]::placeholder {
    color: var(--text-muted);
}

body.dark-theme .filter-btn {
    background: #1f2937;
    border-color: var(--border-color);
    color: var(--text-color);
}

body.dark-theme .filter-btn:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
}

body.dark-theme .filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

body.dark-theme #theme-toggle {
    background: var(--primary-color);
}

/* Statistics Page Styles */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

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

.stats-table th,
.stats-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.stats-table th {
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-table tbody tr:hover {
    background: var(--light-bg);
}

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

.stats-table code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9em;
}

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

.insight-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.insight-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.insight-card h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insight-card h3 i {
    color: var(--primary-color);
}

.insight-card p {
    margin: 0.5rem 0;
}

.insight-stat {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0.75rem;
}

.section-description {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1rem;
}

/* Print Styles */
@media print {
    .landing-header,
    .page-header,
    .controls,
    .version-timeline,
    .external-links,
    .landing-footer,
    .page-footer,
    .author-badge,
    .author-footer {
        display: none;
    }

    body {
        font-size: 12pt;
    }

    a {
        text-decoration: none;
        color: var(--text-color);
    }
}
