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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0d1117;
    color: #f0f6fc;
    height: 100vh;
    overflow: hidden;
}

.header {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
}

.header h1 a {
    color: #f0f6fc;
    text-decoration: none;
}

.header h1 a:hover {
    color: #f0f6fc;
}

.repo-info a {
    color: #58a6ff;
    text-decoration: none;
    font-weight: 500;
}

.repo-info a:hover {
    text-decoration: underline;
}

.container {
    display: flex;
    height: calc(100vh - 73px);
}

.sidebar {
    width: 320px;
    background-color: #0d1117;
    border-right: 1px solid #30363d;
    overflow-y: auto;
}

.file-tree {
    padding: 16px 0;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 4px 16px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    user-select: none;
}

.tree-item:hover {
    background-color: #21262d;
}

.tree-item.selected {
    background-color: #1f6feb;
}

.tree-item.directory {
    font-weight: 500;
}

.tree-item .icon {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.tree-item .name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-item.nested {
    padding-left: 32px;
}

.tree-item.nested-2 {
    padding-left: 48px;
}

/* Expandable tree styles */
.expand-icon {
    width: 12px;
    text-align: center;
    font-size: 10px;
    color: #8b949e;
    transition: transform 0.2s ease;
}

.expand-icon:hover {
    color: #58a6ff;
}

.tree-children {
    margin-left: 20px;
    border-left: 1px solid #30363d;
    padding-left: 4px;
}

.tree-children .tree-item {
    padding-left: 12px;
}

.tree-children .tree-children {
    margin-left: 16px;
}

.tree-children .tree-children .tree-item {
    padding-left: 8px;
}

.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.breadcrumb {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 12px 24px;
    font-size: 14px;
    color: #8b949e;
}

.breadcrumb a {
    color: #58a6ff;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.breadcrumb a:hover {
    text-decoration: underline;
    background-color: rgba(88, 166, 255, 0.1);
}

.breadcrumb a:active {
    background-color: rgba(88, 166, 255, 0.2);
}

.content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.welcome {
    text-align: center;
    margin-top: 100px;
}

.welcome h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #f0f6fc;
}

.welcome p {
    color: #8b949e;
    font-size: 16px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #8b949e;
}

.directory-summary, .file-analysis {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.directory-summary h3, .file-analysis h3 {
    color: #f0f6fc;
    margin-bottom: 12px;
}

.directory-summary h4, .file-analysis h4 {
    color: #f0f6fc;
    margin: 16px 0 8px 0;
    font-size: 16px;
    font-weight: bold;
    font-style: italic;
}

.directory-summary p, .file-analysis p {
    color: #8b949e;
    line-height: 1.6;
    margin-bottom: 12px;
}

.summary-content {
    color: #8b949e;
    line-height: 1.6;
}

.summary-content h4 {
    color: #58a6ff;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
}

.summary-content ul {
    margin: 10px 0 10px 20px;
}

.summary-content li {
    margin-bottom: 4px;
    color: #8b949e;
}

.summary-content strong {
    color: #f0f6fc;
    font-weight: 600;
}

.content-link {
    color: #58a6ff;
    text-decoration: none;
}

.content-link:hover {
    text-decoration: underline;
}


.code-snippet {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
}

.code-snippet pre {
    color: #f0f6fc;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.github-link {
    display: inline-block;
    background-color: #238636;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    margin-top: 12px;
}

.github-link:hover {
    background-color: #2ea043;
}

.section {
    margin-bottom: 24px;
}

.section h4 {
    color: #f0f6fc;
    margin-bottom: 8px;
    font-size: 16px;
}

.section ul {
    color: #8b949e;
    padding-left: 20px;
}

.section li {
    margin-bottom: 4px;
}

.error {
    color: #f85149;
    background-color: #161b22;
    border: 1px solid #da3633;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
}

/* Cache Management Styles */
.cache-status {
    display: flex;
    align-items: center;
}

.cache-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.cache-indicator {
    font-size: 16px;
}

.cache-text {
    color: #8b949e;
}

.cache-button {
    background: none;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.cache-button:hover {
    background-color: #21262d;
    border-color: #58a6ff;
    color: #58a6ff;
}

.cache-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.cache-modal-content {
    background-color: #161b22;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #30363d;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.cache-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #30363d;
}

.cache-modal-header h3 {
    margin: 0;
    color: #f0f6fc;
    font-size: 18px;
}

.cache-close {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.cache-close:hover {
    background-color: #21262d;
    color: #f0f6fc;
}

.cache-modal-body {
    padding: 20px;
}

.cache-stats {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
}

.stat-item {
    margin-bottom: 8px;
    color: #8b949e;
    display: flex;
    justify-content: space-between;
}

.stat-item strong {
    color: #f0f6fc;
    margin-right: 8px;
}

.cache-note {
    margin-top: 12px;
    font-style: italic;
    color: #6e7681;
    display: block;
}

.cache-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cache-actions button {
    background-color: #21262d;
    border: 1px solid #30363d;
    color: #f0f6fc;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.cache-actions button:hover {
    background-color: #30363d;
    border-color: #58a6ff;
}

.cache-refresh:hover {
    background-color: #1f6feb;
    border-color: #1f6feb;
}

.cache-clear:hover {
    background-color: #da3633;
    border-color: #da3633;
}

.cache-export:hover, .cache-import:hover {
    background-color: #238636;
    border-color: #238636;
}

/* Code block styling */
pre {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 16px 20px;
    margin: 16px 0;
    margin-left: 24px; /* More indentation */
    margin-right: 12px;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 1.3; /* Normal line spacing */
}

pre code {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    color: #e6edf3;
}

/* Inline code styling */
code {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 85%;
    color: #e6edf3;
}

/* File lists - general styling for file/directory lists */
.file-list,
.summary-content .file-list {
    background-color: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
    padding: 16px !important;
    margin: 16px 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    list-style: none !important;
    max-height: 400px;
    overflow-y: auto;
}

/* Directory structure lists */
.directory-structure,
.summary-content .directory-structure {
    background-color: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
    padding: 16px !important;
    margin: 16px 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    list-style: none !important;
    max-height: 400px;
    overflow-y: auto;
}

.file-list li,
.directory-structure li,
.summary-content .file-list li,
.summary-content .directory-structure li {
    margin: 6px 0 !important;
    color: #e6edf3 !important;
    padding: 2px 0;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.file-list li:hover,
.directory-structure li:hover,
.summary-content .file-list li:hover,
.summary-content .directory-structure li:hover {
    background-color: rgba(88, 166, 255, 0.05);
}

.file-list .comment,
.directory-structure .comment,
.summary-content .file-list .comment,
.summary-content .directory-structure .comment {
    color: #8b949e !important;
    font-style: italic;
    margin-left: 8px;
}

/* File links styling */
.file-link {
    color: #58a6ff;
    text-decoration: none;
    border-radius: 3px;
    padding: 1px 3px;
    transition: background-color 0.2s;
}

.file-link:hover {
    text-decoration: underline;
    background-color: rgba(88, 166, 255, 0.1);
}

.directory-link {
    color: #f0b429;
    text-decoration: none;
    border-radius: 3px;
    padding: 1px 3px;
    transition: background-color 0.2s;
}

.directory-link:hover {
    text-decoration: underline;
    background-color: rgba(240, 180, 41, 0.1);
}

/* Sidebar note styling */
.sidebar-note {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px;
    margin: 16px 0;
    color: #8b949e;
    font-style: italic;
    text-align: center;
}

.sidebar-note em {
    color: #58a6ff;
}
