/* Base styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --success-color: #16a34a;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

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

/* Stats bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Search box */
.search-box {
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--surface);
    transition: border-color 0.2s;
}

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

/* Files container */
.files-container {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
}

.files-table thead {
    background: var(--background);
}

.files-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.files-table tbody tr {
    border-top: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.files-table tbody tr:hover {
    background-color: var(--background);
}

.files-table tbody tr.hidden {
    display: none;
}

.files-table td {
    padding: 1rem;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.file-icon {
    font-size: 1.25rem;
}

.file-description {
    width: 100%;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

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

.btn-download:hover {
    background: var(--primary-hover);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    margin-right: 0.5rem;
}

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

.btn-copy:hover {
    background: #15803d;
}

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

.btn-delete:hover {
    background: var(--danger-hover);
}

/* Empty state */
.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Footer */
footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
}

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

footer a:hover {
    text-decoration: underline;
}

/* Admin specific styles */
.admin-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.admin-body .container {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.upload-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background);
    border-radius: 8px;
}

.upload-section h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--primary-color);
    background: var(--background);
}

.dropzone-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.dropzone-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.description-box {
    margin-top: 1rem;
}

.description-box label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.description-box input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9375rem;
}

.upload-progress {
    margin-top: 1rem;
}

.upload-progress.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.upload-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    display: none;
}

.upload-status.show {
    display: block;
}

.upload-status.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.upload-status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.files-section {
    padding: 1.5rem;
}

.files-section h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .files-table {
        font-size: 0.875rem;
    }
    
    .files-table th,
    .files-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .btn-small {
        display: block;
        margin-bottom: 0.25rem;
        margin-right: 0;
    }
}
