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

:root {
    --primary-color: #a855f7;
    --secondary-color: #ec4899;
    --accent-color: #f472b6;
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --bg-panel: rgba(20, 20, 20, 0.8);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-dark);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(244, 114, 182, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a1a 100%);
    z-index: -1;
    animation: backgroundShift 20s ease infinite;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

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

@media (max-width: 480px) {
    .container { padding: 0 16px; }
}

/* Header & Navigation */
header {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding-top: env(safe-area-inset-top, 0);
}

.navbar {
    padding: 0.75rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s ease;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.6));
    transition: filter 0.3s ease;
}

.logo:hover .logo-icon {
    transform: scale(1.1);
}

.logo:hover .logo-icon svg {
    filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.9)) drop-shadow(0 0 8px rgba(236, 72, 153, 0.6));
}

.nav-drawer {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    display: inline-block;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.25em 0;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    min-width: 48px;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 1px;
    transition: 0.3s ease;
}

.nav-close {
    display: none;
}

/* Upload Section */
.upload-section {
    padding: 80px 0;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
}

.main-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid var(--border-light);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.panel-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upload-area {
    flex: 1;
}

.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.02);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: rgba(168, 85, 247, 0.05);
}

.upload-zone:active {
    transform: scale(0.99);
}

.upload-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(168, 85, 247, 0.1);
}

.upload-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 16px 28px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
    display: inline-block;
    min-height: 48px;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
}

.upload-zone:hover .upload-button {
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.upload-hint {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.upload-limit {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
}

.panel-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 2rem;
}

.service-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.service-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.security-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.security-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.6));
    transition: filter 0.3s ease;
}

.security-badge:hover .security-icon svg {
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.9)) drop-shadow(0 0 5px rgba(236, 72, 153, 0.6));
    transform: scale(1.1);
}

.security-icon svg {
    transition: transform 0.3s ease;
}

.security-text strong {
    color: var(--accent-color);
    font-weight: 600;
}

/* Upload Progress */
.upload-progress-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.upload-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.file-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.file-info .file-name {
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.file-size {
    margin-left: 1rem;
    color: var(--text-tertiary);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* Files Section */
.files-section {
    padding: 60px 0;
    background: rgba(10, 10, 10, 0.5);
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.files-header h2 {
    font-size: 2rem;
    color: var(--text-primary);
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon svg {
    width: 100%;
    height: 100%;
    transition: filter 0.3s ease;
}

.search-box:hover .search-icon svg,
.search-box input:focus ~ .search-icon svg {
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.8));
}

.files-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    gap: 0.5rem;
}

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

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Files List */
.files-list {
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.5));
    transition: filter 0.3s ease;
}

.empty-state:hover .empty-icon svg {
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.8)) drop-shadow(0 0 10px rgba(236, 72, 153, 0.5));
    transform: scale(1.05);
}

.empty-icon svg {
    transition: transform 0.3s ease;
}

.empty-hint {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--text-tertiary);
}

.file-item {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    gap: 1rem;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.file-item:last-child {
    border-bottom: none;
}

.file-icon {
    font-size: 2rem;
    width: 40px;
    text-align: center;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-details .file-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.action-button {
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.download-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.download-btn:hover,
.download-btn:active {
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

.delete-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.delete-btn:hover,
.delete-btn:active {
    background: rgba(239, 68, 68, 0.3);
}

/* Footer */
footer {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-tertiary);
}

/* Responsive — планшеты */
@media (max-width: 968px) {
    .main-panel {
        grid-template-columns: 1fr;
        padding: 2rem;
    }

    .panel-right {
        padding-left: 0;
        padding-top: 2rem;
    }

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

/* Responsive — телефоны */
@media (max-width: 768px) {
    .nav-drawer {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(24px);
        padding: calc(60px + env(safe-area-inset-top)) 24px 24px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
        gap: 0;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease, visibility 0.3s;
        visibility: hidden;
        overflow-y: auto;
    }

    .nav-drawer.active {
        transform: translateX(0);
        visibility: visible;
    }

    .nav-close {
        display: flex;
        position: absolute;
        top: calc(12px + env(safe-area-inset-top));
        right: 16px;
        width: 48px;
        height: 48px;
        padding: 0;
        border: none;
        background: rgba(255,255,255,0.08);
        color: var(--text-primary);
        font-size: 1.5rem;
        line-height: 1;
        border-radius: 12px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        align-items: center;
        justify-content: center;
    }

    .nav-close:hover {
        background: rgba(255,255,255,0.12);
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin-bottom: 1.5rem;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu a {
        display: block;
        padding: 18px 0;
        font-size: 1.15rem;
        min-height: 52px;
        line-height: 1.3;
    }

    .language-switcher {
        justify-content: center;
        gap: 12px;
    }

    .menu-toggle {
        display: flex;
    }

    body.nav-open {
        overflow: hidden;
    }

    .upload-section {
        padding: 2rem 0;
        min-height: auto;
    }

    .main-panel {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .upload-zone {
        min-height: 140px;
        padding: 2rem 1rem;
    }

    .files-section {
        padding: 2.5rem 0 3rem;
    }

    .files-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .files-header h2 {
        font-size: 1.5rem;
    }

    .search-box {
        max-width: 100%;
    }

    .search-box input {
        padding: 14px 44px 14px 16px;
        font-size: 16px;
        min-height: 48px;
    }

    .files-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem 1.25rem;
        margin-bottom: 1.25rem;
    }

    .file-item {
        flex-wrap: wrap;
        padding: 1rem 1.25rem;
        gap: 0.75rem;
    }

    .file-actions {
        width: 100%;
        justify-content: stretch;
        gap: 0.5rem;
    }

    .file-actions .action-button {
        flex: 1;
    }

    .empty-state {
        padding: 2.5rem 1rem;
    }

    .empty-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 0.75rem;
    }

    footer {
        padding: 1.5rem 0;
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.25rem;
    }

    .service-title {
        font-size: 1.5rem;
        line-height: 1.25;
    }

    .service-description {
        font-size: 1rem;
    }

    .upload-button {
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    .upload-zone {
        min-height: 120px;
    }

    .file-item {
        padding: 1rem;
    }

    .file-icon {
        font-size: 1.5rem;
        width: 36px;
    }

    .action-button {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
}
