/* Cyfinoid Branding Guidelines */
:root {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #50c878;
    --text-secondary: #8a8f98;
    --text-light: #fafafa;
    --accent-yellow: #fdcb52;
    --accent-red: #d63c53;
    --accent-blue: #466fe0;
    --accent-green: #7fd1b9;
    --accent-dirty-yellow: #b6a189;
    
    /* Typography */
    --font-family: 'Sen', sans-serif;
    --font-title: 42px;
    --font-subtitle: 36px;
    --font-heading: 32px;
    --font-subheading: 24px;
    --font-section-header: 20px;
    --font-body: 16px;
    --font-caption: 14px;
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --text-primary: #2d7a4f;
    --text-secondary: #5a5f68;
    --text-light: #1e1e1e;
    --accent-yellow: #e6b84a;
    --accent-red: #c02a3e;
    --accent-blue: #3654c7;
    --accent-green: #4db593;
    --accent-dirty-yellow: #9a8a73;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Warning Banner */
.warning-banner {
    background: linear-gradient(135deg, rgba(253, 203, 82, 0.15), rgba(214, 60, 83, 0.15));
    border: 2px solid var(--accent-yellow);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0 0 0;
    box-shadow: 0 4px 12px rgba(253, 203, 82, 0.2);
}

.warning-header {
    font-size: var(--font-section-header);
    font-weight: 800;
    color: var(--accent-yellow);
    margin-bottom: 0.75rem;
    text-align: center;
}

.warning-banner p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    line-height: 1.5;
    font-size: var(--font-caption);
}

.warning-banner p:last-child {
    margin-bottom: 0;
}

.warning-banner strong {
    color: var(--accent-yellow);
    font-weight: 700;
}

/* Light mode adjustments for warning banner */
[data-theme="light"] .warning-banner {
    background: linear-gradient(135deg, rgba(230, 184, 74, 0.2), rgba(192, 42, 62, 0.2));
    box-shadow: 0 4px 12px rgba(230, 184, 74, 0.3);
}

[data-theme="light"] .warning-banner strong {
    color: var(--accent-red);
}

/* Typography */
.title {
    font-size: var(--font-title);
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: var(--font-subtitle);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.heading {
    font-size: var(--font-heading);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.subheading {
    font-size: var(--font-subheading);
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-header {
    font-size: var(--font-section-header);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.body {
    font-size: var(--font-body);
}

.caption {
    font-size: var(--font-caption);
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Header */
.header {
    text-align: center;
    padding: 1.5rem 0 1.5rem;
    border-bottom: 2px solid var(--text-primary);
    margin-bottom: 1.5rem;
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: 2px solid var(--text-primary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: var(--font-caption);
    font-weight: 700;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
}

/* Card */
.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--text-primary);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: box-shadow 0.3s ease;
}

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

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

.form-label {
    display: block;
    font-size: var(--font-section-header);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: var(--font-body);
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    color: var(--text-light);
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--text-primary);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-select {
    padding: 0.5rem 1rem;
    font-size: var(--font-body);
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    color: var(--text-light);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--text-primary);
}

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    font-size: var(--font-body);
    font-family: var(--font-family);
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: #3659c9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(70, 111, 224, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: var(--font-caption);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--text-secondary);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-state {
    text-align: center;
    padding: 2rem;
    color: var(--accent-red);
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Findings Section */
.findings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-collapse-btn {
    background: transparent;
    border: 2px solid var(--text-primary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: var(--font-caption);
    font-weight: 700;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.section-collapse-btn:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.collapsible-content {
    max-height: 10000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible-content.collapsed {
    max-height: 0;
    transition: max-height 0.3s ease-in;
}

.score-badge {
    padding: 0.75rem 1.5rem;
    border-radius: 24px;
    font-size: var(--font-subheading);
    font-weight: 700;
}

.score-badge.very-high {
    background-color: var(--accent-red);
    color: var(--text-light);
}

.score-badge.high {
    background-color: var(--accent-yellow);
    color: var(--bg-primary);
}

.score-badge.low {
    background-color: var(--accent-green);
    color: var(--bg-primary);
}

.score-badge.none {
    background-color: var(--text-secondary);
    color: var(--text-light);
}

.findings-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-primary);
    border-radius: 4px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.findings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.finding-item {
    background-color: var(--bg-primary);
    border: 1px solid var(--text-secondary);
    border-radius: 4px;
    padding: 1rem;
    transition: border-color 0.3s ease;
}

.finding-item:hover {
    border-color: var(--text-primary);
}

.finding-item.collapsed .finding-details {
    display: none;
}

.finding-collapse-icon {
    cursor: pointer;
    user-select: none;
    font-size: 16px;
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.finding-item.collapsed .finding-collapse-icon {
    transform: rotate(-90deg);
}

.finding-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.finding-checkbox {
    margin-top: 0.25rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.finding-info {
    flex: 1;
}

.finding-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.finding-title {
    font-size: var(--font-section-header);
    font-weight: 700;
    color: var(--text-primary);
}

.category-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: var(--font-caption);
    font-weight: 700;
    text-transform: uppercase;
}

.category-badge.dependencies {
    background-color: var(--accent-blue);
    color: var(--text-light);
}

.category-badge.code {
    background-color: var(--accent-yellow);
    color: var(--bg-primary);
}

.category-badge.config {
    background-color: var(--accent-green);
    color: var(--bg-primary);
}

.category-badge.ci {
    background-color: var(--accent-dirty-yellow);
    color: var(--bg-primary);
}

.category-badge.models {
    background-color: var(--accent-red);
    color: var(--text-light);
}

.category-badge.prompts {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

.category-badge.metadata {
    background-color: var(--text-secondary);
    color: var(--text-light);
}

.severity-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: var(--font-caption);
    font-weight: 700;
    text-transform: uppercase;
}

.severity-badge.high {
    background-color: var(--accent-red);
    color: var(--text-light);
}

.severity-badge.medium {
    background-color: var(--accent-yellow);
    color: var(--bg-primary);
}

.severity-badge.low {
    background-color: var(--accent-green);
    color: var(--bg-primary);
}

.finding-description {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.finding-evidence {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.evidence-item {
    background-color: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid var(--text-primary);
}

.evidence-file {
    font-weight: 700;
    color: var(--accent-blue);
    text-decoration: none;
    margin-bottom: 0.25rem;
    display: inline-block;
}

.evidence-file:hover {
    text-decoration: underline;
}

.evidence-snippet {
    font-family: 'Courier New', monospace;
    font-size: var(--font-caption);
    color: var(--text-light);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Model Card Section */
.model-card-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--text-secondary);
    border-radius: 8px;
}

.model-card-section h4 {
    color: var(--accent-blue);
    margin-bottom: 1rem;
    font-size: var(--font-section-header);
    font-weight: 600;
}

.model-card-content p {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.model-card-content strong {
    color: var(--text-primary);
    display: inline-block;
    margin-bottom: 0.25rem;
}

.ethical-considerations,
.model-references {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border-left: 3px solid var(--accent-yellow);
}

.ethical-considerations p,
.model-references p {
    margin-bottom: 0.5rem;
}

.model-references a {
    color: var(--accent-blue);
    text-decoration: none;
}

.model-references a:hover {
    text-decoration: underline;
}

/* BOM Section */
.bom-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--text-secondary);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    font-size: var(--font-body);
    font-family: var(--font-family);
    font-weight: 700;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.bom-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.code-preview {
    display: block;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    color: var(--text-light);
    overflow-x: auto;
    overflow-y: auto;
    white-space: pre;
    line-height: 1.4;
    padding: 1rem;
    margin: 0;
    max-height: 600px;
    height: auto;
    
    /* Custom scrollbar for better visibility */
    scrollbar-width: thin;
    scrollbar-color: var(--text-primary) var(--bg-secondary);
}

/* Webkit scrollbar styling for Chrome/Safari/Edge - Highly visible */
.code-preview::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

.code-preview::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid rgba(80, 200, 120, 0.2);
}

.code-preview::-webkit-scrollbar-thumb {
    background: var(--text-primary);
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 0 6px rgba(80, 200, 120, 0.3);
}

.code-preview::-webkit-scrollbar-thumb:hover {
    background: var(--accent-green);
    box-shadow: 0 0 10px rgba(127, 209, 185, 0.5);
}

.code-preview::-webkit-scrollbar-thumb:active {
    background: var(--accent-yellow);
}

.code-preview::-webkit-scrollbar-corner {
    background: var(--bg-secondary);
}

/* Parent container for tab content to provide visual context */
.tab-content pre {
    position: relative;
    background-color: var(--bg-secondary);
    border: 1px solid rgba(80, 200, 120, 0.2);
    border-radius: 6px;
    padding: 0;
    margin: 0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    max-height: 600px;
    overflow: hidden;
}

/* Light mode scrollbar adjustments */
[data-theme="light"] .code-preview::-webkit-scrollbar-track {
    border: 1px solid rgba(45, 122, 79, 0.3);
}

[data-theme="light"] .code-preview::-webkit-scrollbar-thumb {
    background: var(--text-primary);
    box-shadow: 0 0 6px rgba(45, 122, 79, 0.4);
}

[data-theme="light"] .code-preview::-webkit-scrollbar-thumb:hover {
    background: var(--accent-green);
    box-shadow: 0 0 10px rgba(77, 181, 147, 0.6);
}

[data-theme="light"] .tab-content pre {
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Analysis Notes Section */
.analysis-note-section {
    margin-bottom: 2rem;
}

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

.analysis-note-card {
    background-color: var(--bg-secondary);
    border: 1px solid rgba(80, 200, 120, 0.2);
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.analysis-note-card:hover {
    border-color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(80, 200, 120, 0.15);
}

.analysis-note-header {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(80, 200, 120, 0.2);
}

.analysis-note-body p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.analysis-note-body strong {
    color: var(--text-light);
    font-weight: 600;
}

.info-message {
    background-color: var(--bg-secondary);
    border: 1px solid rgba(80, 200, 120, 0.3);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
}

[data-theme="light"] .analysis-note-card {
    background-color: var(--bg-primary);
    border-color: rgba(45, 122, 79, 0.3);
}

[data-theme="light"] .analysis-note-card:hover {
    border-color: var(--accent-green);
    box-shadow: 0 2px 8px rgba(45, 122, 79, 0.15);
}

[data-theme="light"] .analysis-note-header {
    border-bottom-color: rgba(45, 122, 79, 0.3);
}

[data-theme="light"] .info-message {
    border-color: rgba(45, 122, 79, 0.3);
}

/* Syntax Highlighting */
.json-key {
    color: #66d9ef;
    font-weight: 600;
}

.json-string {
    color: #a6e22e;
}

.json-number {
    color: #fd971f;
}

.json-boolean {
    color: #ae81ff;
    font-weight: 600;
}

.xml-tag {
    color: #66d9ef;
    font-weight: 600;
}

.xml-attr {
    color: #a6e22e;
}

.xml-value {
    color: #e6db74;
}

/* Light mode syntax highlighting */
[data-theme="light"] .json-key {
    color: #0066cc;
}

[data-theme="light"] .json-string {
    color: #008000;
}

[data-theme="light"] .json-number {
    color: #ff6600;
}

[data-theme="light"] .json-boolean {
    color: #9370db;
}

[data-theme="light"] .xml-tag {
    color: #0066cc;
}

[data-theme="light"] .xml-attr {
    color: #008000;
}

[data-theme="light"] .xml-value {
    color: #cc6600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 24px;
    }
    
    .heading {
        font-size: 24px;
    }
    
    .findings-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .control-group {
        width: 100%;
    }
    
    .form-select {
        width: 100%;
    }
    
    .bom-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 120px;
    }
    
    .bom-actions {
        flex-direction: column;
    }
    
    .bom-actions button {
        width: 100%;
    }
}

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    border-top: 2px solid var(--text-primary);
    margin-top: 4rem;
    padding: 3rem 2rem 2rem;
}

/* Light mode footer adjustments */
[data-theme="light"] .footer {
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-heading {
    font-size: var(--font-subheading);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-text {
    font-size: var(--font-body);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-text:last-child {
    margin-bottom: 0;
}

.footer-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.footer-feature {
    font-size: var(--font-body);
    color: var(--text-secondary);
    line-height: 1.5;
}

.footer-feature strong {
    color: var(--text-primary);
}

.footer-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: var(--font-body);
    font-weight: 700;
    color: var(--text-light);
    background-color: var(--text-primary);
    border: 2px solid var(--text-primary);
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.footer-btn:hover {
    background-color: transparent;
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(80, 200, 120, 0.3);
}

.footer-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Light mode footer button adjustments */
[data-theme="light"] .footer-btn {
    color: var(--bg-primary);
    background-color: var(--text-primary);
    border-color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(45, 122, 79, 0.2);
}

[data-theme="light"] .footer-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(45, 122, 79, 0.3);
}

[data-theme="light"] .footer-btn:active {
    box-shadow: 0 2px 6px rgba(45, 122, 79, 0.2);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--text-secondary);
    font-size: var(--font-caption);
    color: var(--text-secondary);
}

.footer-bottom p {
    margin: 0;
}

.footer-bottom a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: var(--accent-green);
    text-decoration: underline;
}

/* Light mode footer link hover */
[data-theme="light"] .footer-bottom a:hover {
    color: var(--accent-blue);
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer {
        padding: 2rem 1rem 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

