/* Основные стили для справочника "Стальные Воины" */

/* Общие настройки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    font-size: 16px;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Шапка сайта */
header {
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Навигация */
nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

nav li {
    margin: 0 5px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: block;
    background: rgba(255, 255, 255, 0.1);
}

nav a:hover {
    background: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

nav a.active {
    background: #3498db;
    font-weight: 600;
}

/* Основной контент */
main {
    padding: 2rem 0;
}

.hero {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.hero h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

.content {
    background-color: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.content h3 {
    color: #2c3e50;
    margin: 1.5rem 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.content h4 {
    color: #3498db;
    margin: 1.2rem 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Документы */
.document-content {
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.document-content pre {
    white-space: pre-wrap;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #444;
    margin: 0;
}

/* Подвал */
footer {
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

/* Страница фракций */
.faction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.faction-card {
    background: linear-gradient(135deg, #ffffff, #f1f3f5);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.faction-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.faction-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 1.2rem;
    text-align: center;
}

.faction-header h4 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.faction-content {
    padding: 1.5rem;
}

.faction-content h3 {
    margin-top: 0;
    border: none;
    padding: 0;
}

.faction-content h4 {
    color: #3498db;
    margin-top: 1rem;
}

/* Таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e3f2fd;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Адаптивность */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    nav li {
        margin: 5px 0;
        width: 90%;
    }
    
    nav a {
        text-align: center;
        padding: 12px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .hero h2 {
        font-size: 1.6rem;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .content {
        padding: 1.5rem;
    }
    
    .faction-grid {
        grid-template-columns: 1fr;
    }
    
    .faction-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .hero h2 {
        font-size: 1.3rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .content h3 {
        font-size: 1.3rem;
    }
    
    .content h4 {
        font-size: 1.1rem;
    }
}

/* Улучшения для доступности */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ссылки */
a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Списки документов */
.related-documents {
    list-style: none;
    padding: 0;
}

.related-documents li {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.related-documents li:last-child {
    border-bottom: none;
}

.related-documents a {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.related-documents a:hover {
    background-color: #e3f2fd;
    text-decoration: none;
}

.related-documents a::before {
    content: "📄";
    margin-right: 10px;
}