:root {
    --primary: #1a56db;
    --primary-hover: #1e40af;
    --secondary: #6b7280;
    --success: #059669;
    --danger: #dc2626;
    --background: #f3f4f6;
    --white: #ffffff;
    --text-dark: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --border-dark: #d1d5db;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.upload-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

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

.progress-percent {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 35px;
    text-align: right;
}

.upload-progress-row {
    background: rgba(26, 86, 219, 0.05);
}

.loading-row td, .loading-message {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

.zip-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.zip-overlay-card {
    background: var(--white);
    width: min(420px, 90vw);
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.zip-overlay-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.zip-overlay-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.zip-overlay-bar {
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.zip-overlay-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.2s ease;
}

.zip-overlay-percent {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-dark);
    background: var(--background);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(26, 86, 219, 0.1);
}

.btn-lang {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--background);
    border: 1px solid var(--border-dark);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 0.5rem;
}

.btn-lang:hover {
    background: var(--border);
}

.admin-banner {
    background: #059669;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.9rem;
}

.admin-only {
    display: none;
}

.admin-only-header {
    display: none;
}

.hidden {
    display: none !important;
}

.main {
    flex: 1;
    padding: 2rem 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.btn-paypal {
    border-color: #0070ba;
    color: #0070ba;
}

.btn-paypal:hover {
    background: rgba(0, 112, 186, 0.08);
}

.footer-donate {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0 1rem;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-header-center {
    text-align: center;
}

.card-files .card-header {
    border-bottom: none;
    padding-top: 1.35rem;
}

.card-files .breadcrumbs {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0.75rem;
}

.card-files .card-body {
    padding-top: 0.75rem;
}

.card-files .table-container {
    margin-top: -0.25rem;
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.upload-area {
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(26, 86, 219, 0.02);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--secondary);
    margin: 0 auto 1rem;
}

.upload-content h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.upload-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.upload-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(26, 86, 219, 0.05);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

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

.btn-danger {
    background: transparent;
    color: var(--danger);
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
}

.btn-danger:hover {
    background: rgba(220, 38, 38, 0.1);
}

.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--background);
}

.table td {
    font-size: 0.9rem;
}

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

.empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.file-name {
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text-dark);
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

::placeholder {
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.5rem;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: var(--transition);
}

.post-item:hover {
    border-color: var(--border-dark);
    box-shadow: var(--shadow);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-content {
    color: var(--secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

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

.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.comments-section {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
}

.comments-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.comment {
    background: var(--background);
    padding: 0.875rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--border-dark);
}

.comment-admin {
    border-left-color: var(--primary);
    background: rgba(26, 86, 219, 0.05);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.admin-badge {
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-weight: 500;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
}

.btn-delete-comment {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0.25rem;
    line-height: 1;
}

.btn-ban-commenter {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.25rem;
    line-height: 1;
}

.comment-text {
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.5;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-author-input {
    max-width: 200px;
}

.comment-text-input {
    min-height: 60px;
}

.btn-comment {
    align-self: flex-end;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.headers-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--secondary);
    flex-wrap: wrap;
}

.breadcrumb-item {
    cursor: pointer;
    color: var(--primary);
    font-weight: 500;
}

.breadcrumb-item:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.breadcrumb-current {
    color: var(--text-dark);
    font-weight: 600;
    cursor: default;
}

.breadcrumb-current:hover {
    text-decoration: none;
}

.file-icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
    vertical-align: middle;
}

.icon-folder {
    color: #eab308;
}

.icon-file {
    color: #6b7280;
}

.file-name {
    font-weight: 500;
    cursor: pointer;
}

.file-name.is-folder:hover {
    color: var(--primary);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    line-height: 1.1;
}

.btn-action-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-action-primary:hover {
    background: rgba(26, 86, 219, 0.08);
}

.btn-action-danger {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-action-danger:hover {
    background: rgba(220, 38, 38, 0.08);
}

.btn-back {
    margin-right: 0.5rem;
}

@media (max-width: 640px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }

    .nav {
        width: 100%;
        justify-content: center;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .upload-area {
        padding: 1.5rem;
    }

    .post-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .comment-author-input {
        max-width: 100%;
    }
}
