.json-file-display-container {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

/* List View */
.json-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.json-file-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin: 8px 0;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.json-file-item:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-icon {
    margin-right: 15px;
    font-size: 24px;
    flex-shrink: 0;
}

.file-info {
    flex-grow: 1;
}

.file-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 4px;
}

/* File actions (chat and download icons) */
.file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.file-chat-icon,
.download-icon,
.details-icon {
    display: inline-flex;
    align-items: center;
    font-size: 32px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    text-decoration: none;
    position: relative;
}

.file-chat-icon:hover,
.download-icon:hover,
.details-icon:hover {
    transform: scale(1.2);
    opacity: 0.8;
    text-decoration: none;
}

.details-icon.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.details-icon.disabled:hover {
    transform: none;
    opacity: 0.4;
}

.file-chat-icon .chat-count {
    background-color: #d63638;
    color: white;
    padding: 1px 5px;
    border-radius: 10px;
    font-size: 10px;
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 14px;
    text-align: center;
    line-height: 1.2;
}

.file-link {
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    flex-grow: 1;
}

.file-link:hover {
    color: #005177;
    text-decoration: underline;
}

.file-link.disabled {
    color: #666;
    cursor: default;
    font-weight: 600;
    text-decoration: none;
}

.file-link.disabled:hover {
    color: #666;
    text-decoration: none;
    cursor: help;
}


.file-description {
    font-size: 13px;
    color: #555;
    margin: 8px 0;
    line-height: 1.4;
    font-style: italic;
}

.file-meta {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Grid View */
.json-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
}

.json-file-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 180px;
}

.json-file-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: #0073aa;
}

.json-file-card .file-icon {
    font-size: 48px;
    margin-bottom: 15px;
    margin-right: 0;
}

.json-file-card .file-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.json-file-card .file-link {
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    text-align: center;
    font-size: 16px;
    margin-bottom: 10px;
    display: block;
    word-break: break-word;
    flex-grow: 0;
}

.json-file-card .file-link:hover {
    color: #005177;
    text-decoration: underline;
}

.file-link.disabled {
    color: #666;
    cursor: default;
    font-weight: 600;
    text-decoration: none;
}

.file-link.disabled:hover {
    color: #666;
    text-decoration: none;
    cursor: help;
}


.json-file-card .file-description {
    font-size: 12px;
    color: #555;
    text-align: center;
    margin: 10px 0;
    line-height: 1.4;
    font-style: italic;
    padding: 0 5px;
}

.json-file-card .file-meta {
    font-size: 11px;
    color: #666;
    text-align: center;
    margin-top: 8px;
}

.json-file-card .file-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 10px 0;
}

/* Error and No Files */
.json-file-display-error {
    color: #d63638;
    font-weight: 600;
    padding: 15px;
    background: #fff2f2;
    border: 1px solid #f0a0a0;
    border-radius: 5px;
    margin: 10px 0;
}

.json-file-display-no-files {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 30px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
}

/* Pagination Styles */
.json-pagination-info {
    text-align: center;
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
    background: #fff;
    padding: 10px;
    border: 1px solid #e1e1e1;
    border-radius: 3px;
}

.json-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
}

.json-page-btn {
    padding: 8px 12px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.json-page-btn:hover {
    background: #005177;
    color: white;
    text-decoration: none;
}

.json-page-btn.disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    opacity: 0.7;
}

.json-page-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.json-page-number {
    display: inline-block;
    padding: 6px 10px;
    background: #f8f9fa;
    color: #0073aa;
    text-decoration: none;
    border: 1px solid #e1e1e1;
    border-radius: 3px;
    font-size: 14px;
    min-width: 32px;
    text-align: center;
    transition: all 0.2s;
}

.json-page-number:hover {
    background: #e9ecef;
    border-color: #0073aa;
    text-decoration: none;
}

.json-page-number.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    font-weight: 600;
}

.json-page-dots {
    padding: 6px 4px;
    color: #666;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .json-file-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-icon {
        margin-bottom: 10px;
    }
    
    .file-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }
    
    
    /* Mobile Pagination */
    .json-pagination {
        flex-wrap: wrap;
        gap: 5px;
        padding: 10px;
    }
    
    .json-page-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .json-page-numbers {
        gap: 3px;
    }
    
    .json-page-number {
        padding: 4px 6px;
        font-size: 12px;
        min-width: 24px;
    }
    
    .json-pagination-info {
        font-size: 12px;
        padding: 8px;
        margin-bottom: 10px;
    }
}

/* Markdown Preview Styles */
.markdown-preview {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.markdown-content {
    font-family: Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    white-space: pre-wrap;
    font-size: 13px;
}

.view-full-link {
    display: inline-block;
    margin-top: 10px;
    color: #0073aa;
    text-decoration: none;
    font-size: 12px;
}

.view-full-link:hover {
    text-decoration: underline;
}


/* Markdown Rendering Styles */
.markdown-rendered-container {
    margin-top: 15px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    max-height: 600px;
    overflow-y: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.markdown-rendered {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.markdown-rendered h1,
.markdown-rendered h2,
.markdown-rendered h3,
.markdown-rendered h4,
.markdown-rendered h5,
.markdown-rendered h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.markdown-rendered h1 { font-size: 2em; }
.markdown-rendered h2 { font-size: 1.5em; }
.markdown-rendered h3 { font-size: 1.25em; }

.markdown-rendered p {
    margin-bottom: 1em;
}

.markdown-rendered code {
    background-color: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.9em;
}

.markdown-rendered pre {
    background-color: #f4f4f4;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1em 0;
}

.markdown-rendered pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-rendered blockquote {
    border-left: 4px solid #ddd;
    margin-left: 0;
    padding-left: 16px;
    color: #666;
}

.markdown-rendered table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.markdown-rendered th,
.markdown-rendered td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.markdown-rendered th {
    background-color: #f4f4f4;
    font-weight: bold;
}

.markdown-rendered ul,
.markdown-rendered ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.markdown-rendered a {
    color: #0073aa;
    text-decoration: none;
}

.markdown-rendered a:hover {
    text-decoration: underline;
}

.markdown-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.markdown-error {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
}

.markdown-plain pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}



/* Folder Management Styles */
.json-folders-list {
    margin-bottom: 10px;
}

.json-folder-item {
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

.json-folder-item input[type="text"] {
    margin-right: 10px;
    margin-bottom: 5px;
}

.json-folder-item .remove-folder {
    margin-left: 10px;
}

@media (max-width: 768px) {
    .json-folder-item input[type="text"] {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .json-folder-item .remove-folder {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Tag Management Styles */
.json-tags-list {
    margin-bottom: 10px;
}

.json-tag-item {
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

.json-tag-item input[type="text"] {
    margin-right: 10px;
    margin-bottom: 5px;
}

.json-tag-item .remove-tag {
    margin-left: 10px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .json-tag-item input[type="text"] {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .json-tag-item .remove-tag {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Screen Reader Only Text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Download Button Styles */
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 8px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1;
}

.download-btn:hover {
    background: #218838;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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


/* Responsive adjustments for download button */
@media (max-width: 768px) {
    .download-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
        margin-left: 6px;
    }
    
}