/* ============================================
   ОСНОВНЫЕ СТИЛИ
   ============================================ */

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

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #6c757d;
    --success: #06d6a0;
    --danger: #ef476f;
    --danger-dark: #d43f5e;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --border: #dee2e6;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ============================================
   КОНТЕЙНЕРЫ
   ============================================ */

.app-container, .container {
    max-width: 800px;
    width: 100%;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, #4895ef 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.app-header.compact {
    padding: 1rem 2rem;
}

.app-header.compact .app-title {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.app-header.compact .app-subtitle {
    font-size: 0.9rem;
}

.app-nav {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.app-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.app-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto;
}

.app-main {
    flex: 1;
    padding: 2rem;
    background: white;
}

.app-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 1rem;
    text-align: center;
    color: var(--gray);
    font-size: 0.875rem;
}

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

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

/* ============================================
   УПРАВЛЕНИЕ СОСТОЯНИЯМИ
   ============================================ */

.state {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.state.visible {
    display: block;
    opacity: 1;
}

.state.hidden {
    display: none;
}

/* ============================================
   СООБЩЕНИЯ ОБ ОШИБКАХ
   ============================================ */

.error-message {
    background: #fee;
    border-left: 4px solid var(--danger);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-icon {
    font-size: 1.2rem;
}

.error-text {
    flex: 1;
    color: var(--danger);
}

.error-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--gray);
    padding: 0 0.5rem;
}

.error-close:hover {
    color: var(--danger);
}

/* ============================================
   ЗОНА ЗАГРУЗКИ
   ============================================ */

.upload-area {
    border: 3px dashed var(--border);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--light);
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: var(--primary);
    background: #f0f4ff;
}

.upload-area.dragover {
    border-color: var(--primary);
    background: #e2e8ff;
    transform: scale(1.02);
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-message {
    pointer-events: none;
    z-index: 1;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.upload-text {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.link-like {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--gray);
}

/* ============================================
   БАЗОВЫЙ СТИЛЬ ВСЕХ КНОПОК
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    height: 48px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn:active {
    transform: translateY(0);
}

.btn-icon-only {
    width: 48px;
    padding: 0.75rem 0;
}

.btn-with-text {
    min-width: 140px;
}

/* ============================================
   ЦВЕТОВЫЕ ВАРИАНТЫ КНОПОК
   ============================================ */

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

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

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e9ecef;
}

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

.btn-link:hover {
    background: rgba(67, 97, 238, 0.1);
    border-color: var(--primary);
    text-decoration: none;
}

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

.btn-danger:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
}

.btn-copy {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    height: 48px;
}

.btn-copy:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-icon {
    font-size: 1.2rem;
}

/* ============================================
   КОНТЕЙНЕРЫ ДЛЯ КНОПОК
   ============================================ */

.preview-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.action-buttons .btn-primary,
.action-buttons .btn-secondary:not(.btn-icon-only) {
    min-width: 140px;
    flex: 1 1 auto;
}

.download-section {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* ============================================
   КНОПКИ В ОДНУ СТРОКУ (НА ГЛАВНОЙ)
   ============================================ */

.action-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0 1rem 0;
    width: 100%;
}

.action-btn {
    flex: 0 1 auto;
    min-width: 200px;
    background: var(--light);
    color: var(--dark);
    border: 1px solid var(--border);
}

.action-btn:hover {
    background: #e9ecef;
}

.paste-hint {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-left: 0.25rem;
}

/* ============================================
   ПРЕДПРОСМОТР
   ============================================ */

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

.file-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.file-meta {
    flex: 1;
}

.filename {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    word-break: break-word;
}

.filesize {
    font-size: 0.875rem;
    color: var(--gray);
}

.file-type {
    font-size: 0.8rem;
    color: var(--gray);
    display: block;
    margin-top: 0.25rem;
}

.preview-container {
    background: var(--light);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    min-height: 300px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.preview-placeholder {
    color: var(--gray);
    text-align: center;
    padding: 2rem;
}

.preview-image {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.preview-iframe {
    width: 100%;
    height: 500px;
    border: none;
}

.preview-video {
    max-width: 100%;
    max-height: 500px;
}

.preview-audio {
    width: 100%;
    max-width: 500px;
    margin: 1rem auto;
}

.preview-unsupported {
    text-align: center;
    padding: 2rem;
}

.file-detail {
    font-size: 0.9rem;
    color: var(--gray);
    margin: 0.25rem 0;
}

/* ============================================
   КАРТОЧКА ФАЙЛА
   ============================================ */

.file-card {
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.file-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
    word-break: break-word;
}

.file-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--border-radius-sm);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--gray);
    font-size: 0.9rem;
}

/* ============================================
   ЗАГОЛОВОК С ИМЕНЕМ ФАЙЛА (МЕЖДУ КНОПКАМИ И ИНФОРМАЦИЕЙ)
   ============================================ */

.file-header-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    text-align: center;
}

.file-icon-large {
    font-size: 3rem;
    flex-shrink: 0;
}

.file-title {
    font-size: 1.5rem;
    color: var(--dark);
    word-break: break-word;
    margin: 0;
    line-height: 1.4;
    max-width: 600px;
}

/* ============================================
   ИНФОРМАЦИЯ О ФАЙЛЕ (СЕТКА)
   ============================================ */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    background: var(--light);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    margin: 0.5rem 0;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.25rem;
}

.info-label {
    font-size: 0.7rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

/* ============================================
   РЕЗУЛЬТАТ (ССЫЛКА СОЗДАНА)
   ============================================ */

.result-card {
    text-align: center;
    padding: 2rem 1rem;
}

.success-animation {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pop 0.5s ease;
}

@keyframes pop {
    0% { transform: scale(0); }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.result-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--success);
}

.result-subtitle {
    color: var(--gray);
    margin-bottom: 2rem;
}

.link-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto 2rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.link-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    outline: none;
    font-size: 1rem;
    background: var(--light);
    height: 48px;
}

/* ============================================
   ИНДИКАТОР ЗАГРУЗКИ
   ============================================ */

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--border-radius-sm);
    margin-top: 1rem;
}

.loading-indicator.hidden {
    display: none;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   СЕКЦИЯ КОММЕНТАРИЕВ
   ============================================ */

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

.comments-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
}

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

.comment {
    background: var(--light);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    border-left: 3px solid var(--primary);
}

.comment.deletion-reason {
    border-left-color: var(--danger);
    background: rgba(239, 71, 111, 0.05);
}

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

.comment-author {
    font-weight: 600;
    color: var(--primary);
    margin-right: 0.5rem;
}

.comment.deletion-reason .comment-author {
    color: var(--danger);
}

.comment-date {
    font-size: 0.8rem;
    color: var(--gray);
}

.comment-type-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--danger);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
}

.comment-text {
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.no-comments {
    text-align: center;
    color: var(--gray);
    font-style: italic;
    padding: 2rem;
    background: var(--light);
    border-radius: var(--border-radius-sm);
}

/* ============================================
   ФОРМА КОММЕНТАРИЯ (В СЕРОЙ РАМКЕ)
   ============================================ */

.comment-form-wrapper {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
    margin-top: 2rem;
}

.comment-form-title {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
}

/* ============================================
   СЕКЦИЯ УДАЛЕНИЯ
   ============================================ */

.delete-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--danger);
}

.delete-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--danger);
}

.delete-warning {
    background: #fee;
    color: var(--danger);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--danger);
}

.delete-form {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
}

/* ============================================
   ФОРМЫ (ОБЩЕЕ)
   ============================================ */

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.author-input,
.delete-reason-input,
.captcha-input,
.comment-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    height: 48px;
}

.comment-input {
    height: auto;
    min-height: 100px;
    resize: vertical;
}

.author-input:focus,
.captcha-input:focus,
.comment-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.delete-reason-input:focus {
    outline: none;
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 71, 111, 0.1);
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

.form-submit {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.form-submit .btn {
    min-width: 200px;
}

/* ============================================
   КАПЧА
   ============================================ */

.captcha-question {
    margin-bottom: 1rem;
}

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

.captcha-question strong {
    font-size: 1.2rem;
    color: var(--primary);
    background: white;
    padding: 0.3rem 0.8rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
    display: inline-block;
    margin-top: 0.3rem;
}

.captcha-answer {
    margin-bottom: 1.5rem;
}

/* ============================================
   ТЕМНАЯ ТЕМА
   ============================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --light: #2d2d2d;
        --dark: #e9ecef;
        --border: #404040;
        --gray: #a0a0a0;
        --gray-light: #363636;
    }

    body {
        background: #1a1a1a;
    }

    .app-container, .container {
        background: #2d2d2d;
    }

    .app-main {
        background: #2d2d2d;
    }

    .app-footer {
        background: #2d2d2d;
        border-top-color: #404040;
    }

    .upload-area {
        background: #363636;
    }

    .preview-container {
        background: #363636;
        border-color: #404040;
    }

    .link-input {
        background: #363636;
        color: white;
    }

    .btn-secondary,
    .action-btn {
        background: #363636;
        color: white;
        border-color: #404040;
    }

    .btn-secondary:hover,
    .action-btn:hover {
        background: #404040;
    }

    .btn-icon-only {
        background: #363636;
        color: white;
        border-color: #404040;
    }

    .btn-icon-only:hover {
        background: #404040;
    }

    .btn-link:hover {
        background: rgba(123, 156, 255, 0.2);
        border-color: #7b9cff;
    }

    .loading-indicator {
        background: #363636;
    }

    .file-card {
        background: #2d2d2d;
    }

    .file-meta,
    .info-grid,
    .comment-form-wrapper,
    .delete-form {
        background: #363636;
    }

    .comment {
        background: #363636;
    }

    .comment.deletion-reason {
        background: rgba(239, 71, 111, 0.15);
    }

    .delete-warning {
        background: #442222;
        color: #ff8a8a;
    }

    .delete-reason-input,
    .author-input,
    .captcha-input,
    .comment-input {
        background: #363636;
        color: white;
        border-color: #404040;
    }

    .delete-reason-input:focus {
        border-color: var(--danger);
    }

    .author-input:focus,
    .captcha-input:focus,
    .comment-input:focus {
        border-color: var(--primary);
    }

    .captcha-question strong {
        background: #2d2d2d;
        color: #7b9cff;
    }

    .no-comments {
        background: #363636;
    }

    .error-message {
        background: #442222;
        border-left-color: #ff8a8a;
    }

    .error-text {
        color: #ff8a8a;
    }

    .comment-author {
        color: #7b9cff;
    }
}

/* ============================================
   АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ
   ============================================ */

@media (max-width: 768px) {
    .app-container, .container {
        min-height: auto;
        border-radius: var(--border-radius-sm);
    }

    .app-header {
        padding: 1.5rem;
    }

    .app-header.compact {
        padding: 1rem;
    }

    .app-header.compact .app-title {
        font-size: 1.75rem;
    }

    .app-title {
        font-size: 2rem;
    }

    .app-subtitle {
        font-size: 0.875rem;
    }

    .app-main {
        padding: 1.5rem;
    }

    .app-nav {
        position: static;
        margin-bottom: 1rem;
        text-align: left;
    }

    .upload-area {
        padding: 2rem 1rem;
        min-height: 250px;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .upload-text {
        font-size: 1rem;
    }

    .preview-actions {
        flex-direction: column;
        width: 100%;
    }

    .preview-actions .btn {
        width: 100%;
    }

    .preview-container {
        min-height: 200px;
        max-height: 400px;
    }

    .preview-iframe {
        height: 400px;
    }

    .result-title {
        font-size: 1.5rem;
    }

    .result-actions {
        flex-direction: column;
        width: 100%;
    }

    .result-actions .btn {
        width: 100%;
    }

    .link-box {
        flex-direction: column;
        border: none;
        gap: 0.5rem;
        width: 100%;
    }

    .link-input {
        border: 2px solid var(--border);
        border-radius: var(--border-radius-sm);
        text-align: center;
        width: 100%;
        height: 48px;
    }

    .btn-copy {
        width: 100%;
        border-radius: var(--border-radius-sm);
    }

    .file-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .download-section {
        flex-direction: column;
        width: 100%;
    }

    .download-section .btn {
        width: 100%;
    }

    .delete-form,
    .comment-form-wrapper {
        padding: 1rem;
    }

    .delete-form .btn,
    .comment-form-wrapper .btn {
        width: 100%;
    }

    .comment-form button {
        width: 100%;
    }

    .file-badge {
        flex-wrap: wrap;
    }

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

    .filename {
        font-size: 1rem;
    }

    .preview-iframe {
        height: 300px;
    }

    .action-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .action-btn {
        width: 100%;
        min-width: auto;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .file-header-centered {
        flex-direction: column;
        gap: 0.5rem;
        margin: 1.5rem 0;
    }

    .file-title {
        font-size: 1.2rem;
        text-align: center;
    }

    .form-submit {
        justify-content: center;
    }

    .form-submit .btn {
        width: 100%;
    }

    .error-message {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   АДАПТИВНАЯ РАСКЛАДКА КНОПОК (НОВОЕ)
   ============================================ */

/* Десктоп - все в ряд */
@media (min-width: 769px) {
    .action-buttons {
        flex-direction: row;
        display: flex;
        gap: 1rem;
        align-items: center;
        justify-content: center;
    }

    .btn-download {
        flex: 0 1 auto;
        min-width: 160px;
    }

    .action-row-mobile {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .btn-link-mobile {
        min-width: 100px;
    }
}

/* Мобильные - особая раскладка */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .btn-download {
        width: 100%;
        flex: none;
    }

    .action-row-mobile {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .btn-link-mobile {
        flex: 1;
        min-width: 0;
    }

    .btn-icon-only {
        width: 48px;
        flex-shrink: 0;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .btn-link-mobile {
        font-size: 0.9rem;
        padding: 0.6rem 0.5rem;
    }

    .btn-icon-only {
        width: 42px;
        height: 42px;
    }
}

/* ============================================
   МОБИЛЬНЫЕ ОПТИМИЗАЦИИ ДЛЯ view.html
   ============================================ */

/* Компактный заголовок */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.app-nav {
    position: static;
}

/* Контейнер для имени файла */
.filename-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 0.5rem;
    background: var(--light);
    border-radius: var(--border-radius-sm);
    word-break: break-word;
}

.file-icon-small {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.file-title-mobile {
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark);
    margin: 0;
    line-height: 1.3;
}

/* Кнопки для мобильных */
.btn-mobile {
    min-width: 0;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

/* Компактная статистика */
.file-stats {
    background: var(--light);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    margin: 0.75rem 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--gray);
}

.stat-value {
    font-weight: 500;
    color: var(--dark);
    text-align: right;
}

/* Комментарии */
.comment-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 0.8rem;
}

.comment-author {
    font-weight: 600;
    color: var(--primary);
}

.comment-date {
    color: var(--gray);
}

.comment-type-badge {
    font-size: 0.8rem;
    background: transparent;
    padding: 0;
}

/* Формы */
.form-hint {
    font-size: 0.7rem;
}