* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
    font-weight: 300;
}

main {
    padding: 40px;
    min-height: 400px;
}

.no-documents {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-documents p {
    font-size: 1.2em;
    margin-bottom: 15px;
}

.no-documents .hint {
    margin-top: 30px;
    font-size: 1em;
    color: #888;
}

.no-documents .example {
    font-family: 'Courier New', monospace;
    background: #f5f5f5;
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
    margin: 5px;
    color: #555;
    border: 1px solid #e0e0e0;
}

code {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #d73502;
}

.stats {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    padding: 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
}

.stat-item {
    flex: 1;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2.5em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-section {
    margin-bottom: 40px;
    background: #fafafa;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #e0e0e0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.category-title {
    font-size: 1.5em;
    color: #444;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    font-size: 1.2em;
}

.document-count {
    margin-left: auto;
    background: #667eea;
    color: white;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
}

.documents-list {
    display: grid;
    gap: 15px;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
    transition: all 0.3s ease;
    cursor: pointer;
}

.document-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 15px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.document-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.document-info {
    flex: 1;
}

.document-title {
    font-size: 1.1em;
    margin-bottom: 8px;
}

.document-title a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.document-title a:hover {
    color: #667eea;
}

.document-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.85em;
    color: #666;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filename {
    color: #999;
    font-style: italic;
}

footer {
    background: #f8f9fa;
    padding: 40px;
    border-top: 1px solid #e0e0e0;
}

.legend {
    margin-bottom: 30px;
}

.legend h3 {
    color: #444;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.legend-code {
    font-weight: 700;
    color: #667eea;
    background: #f0f4ff;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    min-width: 45px;
    text-align: center;
}

.legend-name {
    color: #555;
    font-size: 0.95em;
}

.copyright {
    text-align: center;
    color: #888;
    font-size: 0.9em;
    margin-top: 20px;
}

/* Адаптивность */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .stats {
        flex-direction: column;
        gap: 20px;
    }
    
    main {
        padding: 20px;
    }
    
    .legend-items {
        grid-template-columns: 1fr;
    }
    
    .document-meta {
        flex-direction: column;
        gap: 5px;
    }
}

/* Анимация при загрузке */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-section {
    animation: fadeIn 0.5s ease-out;
}

.document-item {
    animation: fadeIn 0.3s ease-out;
}

/* Стиль для ссылок на скачивание */
.document-title a::after {
    content: ' ↗';
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.document-title a:hover::after {
    opacity: 1;
}