/* Global styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --light-color: #f1f5f9;
    --dark-color: #1e293b;
    --success-color: #10b981;
    --border-radius: 4px;
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #334155;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 0;
    border-bottom: 1px solid #e2e8f0;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 700;
}

header p {
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.cdn-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--light-color);
    padding: 10px 20px;
    border-radius: var(--border-radius);
}

.stat-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.stat-item span {
    font-weight: 600;
    color: var(--dark-color);
}

/* Search bar */
.search-bar {
    display: flex;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#search-input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-size: 16px;
    outline: none;
}

#search-input:focus {
    border-color: var(--accent-color);
}

#search-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    transition: background-color 0.3s;
}

#search-button:hover {
    background-color: var(--secondary-color);
}

/* Files table */
.files-container {
    margin-bottom: 40px;
    overflow-x: auto;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.files-table th {
    background-color: var(--light-color);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 1px solid #e2e8f0;
}

.files-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
}

.file-row {
    transition: background-color 0.2s;
}

.file-row:hover {
    background-color: #f8fafc;
}

.file-name a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
}

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

.file-name a:before {
    content: '\f15b';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 8px;
    color: var(--accent-color);
}

.file-size, .file-date, .file-items {
    color: #64748b;
    font-size: 0.9rem;
}

.file-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 5px;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.copy-link:hover {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

.copy-code:hover {
    color: var(--dark-color);
    background-color: rgba(30, 41, 59, 0.1);
}

.download-file:hover {
    color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.1);
}

.view-data:hover {
    color: var(--accent-color);
    background-color: rgba(59, 130, 246, 0.1);
}

/* File preview */
.file-preview-row {
    background-color: #f8fafc;
}

.file-preview {
    padding: 0;
    border-bottom: 1px solid #e2e8f0;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.preview-header h3 {
    color: var(--dark-color);
    font-size: 1rem;
    font-weight: 600;
}

.preview-tabs {
    display: flex;
    gap: 5px;
}

.tab-btn {
    padding: 6px 12px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    color: #64748b;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: #f8fafc;
}

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

.preview-content {
    padding: 0;
}

.tab-content {
    display: none;
    max-height: 400px;
    overflow: auto;
}

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

.json-preview {
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    max-height: 400px;
    overflow: auto;
}

pre {
    margin: 0;
    padding: 15px;
    background-color: #f8fafc;
    overflow: auto;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #334155;
}

.loading {
    text-align: center;
    color: #64748b;
    padding: 20px;
}

.hidden {
    display: none;
}

/* CDN Instructions */
.cdn-instructions {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--box-shadow);
}

.cdn-instructions h2 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.cdn-instructions p {
    color: #64748b;
    margin-bottom: 20px;
}

.code-block {
    background-color: #f1f5f9;
    padding: 15px;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.code-block code {
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
}

.copy-button {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 5px 10px;
    margin-left: 10px;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.copy-button:hover {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

.cdn-instructions h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
    font-size: 1.2rem;
}

.cdn-instructions ul {
    list-style: none;
}

.cdn-instructions li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.cdn-instructions li i {
    color: var(--success-color);
    margin-right: 10px;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: opacity 0.3s, transform 0.3s;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(30px);
    pointer-events: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: #64748b;
    background-color: white;
    border-top: 1px solid #e2e8f0;
}

/* No files message */
.no-files {
    text-align: center;
    padding: 40px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.no-files p {
    color: #64748b;
    font-size: 1.1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .preview-tabs {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .cdn-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .files-table {
        width: 100%;
        display: block;
        overflow-x: auto;
    }
}