/* Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: #f8f9fa;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo:hover {
    color: #2d3748;
    transform: scale(1.05);
}

.nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: #4a5568;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    color: #1a202c;
    background: #f7fafc;
}

.nav-text {
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-link, .logout-btn {
    background: none;
    border: none;
    color: #4a5568;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: underline;
    font-size: inherit;
    font-weight: 500;
}

.logout-link:hover, .logout-btn:hover {
    color: #1a202c;
    background: #f7fafc;
}

/* Main content */
.main {
    flex: 1;
    padding: 2rem 0;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    color: #1a202c;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a202c;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Upload section */
.upload-section {
    max-width: 600px;
    margin: 0 auto;
}

.upload-zone {
    background: #ffffff;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.upload-zone h3,
.upload-zone p {
    pointer-events: none;
    user-select: none;
}

.upload-zone .upload-icon {
    pointer-events: none;
    user-select: none;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: #1a202c;
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.upload-zone.clipboard-paste {
    border-color: #48bb78;
    background: #f0fff4;
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.3);
    animation: clipboardPulse 0.6s ease-in-out;
}

@keyframes clipboardPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1.02); }
}

.clipboard-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #48bb78;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10;
    animation: feedbackFadeIn 0.3s ease-in-out;
}

@keyframes feedbackFadeIn {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-zone h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #1a202c;
    font-weight: 600;
}

.upload-zone p {
    color: #4a5568;
    margin-bottom: 1.5rem;
}

.clipboard-hint {
    background: #e6fffa;
    border: 1px solid #38b2ac;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #2d3748;
}

/* File preview */
.file-preview {
    margin: 1.5rem 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: previewSlideIn 0.3s ease-out;
}

@keyframes previewSlideIn {
    0% { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.preview-image {
    position: relative;
}

.preview-image img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.preview-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-info strong {
    font-weight: 600;
    font-size: 0.9rem;
}

.preview-info span {
    font-size: 0.8rem;
    opacity: 0.9;
}

.file-input {
    display: none;
}

.upload-btn, .upload-submit-btn {
    background: #1a202c;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.upload-btn:hover, .upload-submit-btn:hover {
    background: #2d3748;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.password-section {
    margin: 1.5rem 0;
    text-align: left;
}

.password-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1a202c;
}

.password-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.password-section small {
    color: #718096;
    font-size: 0.875rem;
}

.user-info, .auth-links {
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #4a5568;
}

.user-info a, .auth-links a {
    color: #667eea;
    text-decoration: none;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.user-info a:hover, .auth-links a:hover {
    text-decoration: underline;
}

/* Progress */
.upload-progress {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #1a202c;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: #4a5568;
    font-weight: 500;
}

/* Result */
.upload-result {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2rem;
}

.result-success {
    text-align: center;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.result-info {
    margin: 1.5rem 0;
    text-align: left;
}

.result-info p {
    margin-bottom: 0.5rem;
}

.result-link {
    margin: 1.5rem 0;
    display: flex;
    gap: 0.5rem;
}

.link-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: #f7fafc;
}

.copy-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #38a169;
}

.new-upload-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 1rem;
}

/* Recent files */
.recent-files {
    max-width: 800px;
    margin: 3rem auto 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2rem;
}

.recent-files h3 {
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.file-item:hover {
    background: #e2e8f0;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-arrow {
    margin-left: auto;
    font-size: 1.2rem;
    color: #4a5568;
    opacity: 0;
    transition: all 0.3s ease;
}

.file-item:hover .file-arrow {
    opacity: 1;
    transform: translateX(4px);
}

.file-icon {
    font-size: 1.5rem;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #2d3748;
}

.file-meta {
    font-size: 0.875rem;
    color: #718096;
}

/* Forms */
.auth-form, .admin-login, .password-prompt {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.form-container, .login-form, .password-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.form-container h2, .login-form h2, .password-form h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.form-subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2d3748;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #1a202c;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #2d3748;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
    margin-left: 1rem;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.form-footer {
    text-align: center;
    margin-top: 2rem;
}

.form-footer p {
    margin-bottom: 0.5rem;
    color: #718096;
    font-size: 0.9rem;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Password prompt */
.password-icon {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.file-info h3 {
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.file-info p {
    color: #718096;
    margin-bottom: 1.5rem;
}

/* Admin dashboard */
.admin-dashboard h2 {
    color: white;
    margin-bottom: 2rem;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 600;
    color: #2d3748;
}

.files-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2rem;
}

.files-section h3 {
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.files-table {
    overflow-x: auto;
}

.files-table table {
    width: 100%;
    border-collapse: collapse;
}

.files-table th,
.files-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.files-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.protected-badge, .user-badge {
    font-size: 0.8rem;
}

.ip-cell {
    font-family: monospace;
    font-size: 0.875rem;
}

.file-type {
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.no-files {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.login-info {
    background: #e6fffa;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    border-left: 4px solid #38b2ac;
}

.login-info p {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: #2d3748;
}

/* File page */
.file-page {
    max-width: 800px;
    margin: 0 auto;
}

.file-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-icon-large {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.file-header h1 {
    color: #1a202c;
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 600;
    word-break: break-word;
}

.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    color: #4a5568;
    font-size: 0.9rem;
}

.file-meta span {
    background: #f7fafc;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

.file-protected {
    background: #fed7d7 !important;
    color: #c53030 !important;
}

.file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.file-preview {
    margin-bottom: 3rem;
    text-align: center;
}

.file-preview h3 {
    color: #1a202c;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.preview-image-large {
    max-width: 100%;
    max-height: 500px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    object-fit: contain;
}

.file-info {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-info h3 {
    color: #1a202c;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.info-item strong {
    color: #1a202c;
    font-weight: 600;
    font-size: 0.9rem;
}

.info-item span {
    color: #4a5568;
    font-size: 1rem;
}

/* Error page */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.error-content {
    background: #ffffff;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.error-content h2 {
    color: #1a202c;
    margin-bottom: 1rem;
    font-weight: 600;
}

.error-content .error-message {
    color: #4a5568;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.error-actions .btn {
    width: auto;
    min-width: 120px;
}

/* Footer */
.footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    color: #4a5568;
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .result-link {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .files-table {
        font-size: 0.875rem;
    }
    
    .file-actions {
        flex-direction: column;
    }
}
