/* ======================================= */
/* ========== ТАБЛИЦА КЛАССОВ (СПИСОК) ========== */
/* ======================================= */

.class-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.class-table th,
.class-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.class-table th {
    background: #4a4a8a;
    font-weight: 700;
    color: white;
}

.class-table td {
    color: #000000;
    font-weight: 500;
}

.class-table .icon {
    width: 50px;
    text-align: center;
}

.class-table .icon img {
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
}

.class-table .name-cell {
    text-align: left;
    font-weight: 600;
}

.class-table .race-cell,
.class-table .grade-cell {
    font-weight: 600;
}

.class-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.class-table tbody tr:hover {
    background-color: #e8e8ff;
    cursor: pointer;
}

/* ======================================= */
/* ========== БЕЙДЖИКИ ========== */
/* ======================================= */

.race-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.race-badge.race-0 {
    background: #28a745;
    color: white;
}

.race-badge.race-1 {
    background: #17a2b8;
    color: white;
}

.race-badge.race-2 {
    background: #dc3545;
    color: white;
}

.grade-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    background: #6c757d;
    color: white;
}

.grade-badge.grade-0 { background: #6c757d; }
.grade-badge.grade-1 { background: #ffc107; color: #333; }
.grade-badge.grade-2 { background: #fd7e14; }
.grade-badge.grade-3 { background: #dc3545; }

.upgrade-lv {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.8em;
    color: #900;
}

/* ======================================= */
/* ========== СКИЛЛЫ В ТАБЛИЦЕ ========== */
/* ======================================= */

.skills-cell {
    text-align: left;
}

.skill-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.skill-icon {
    width: 44px;
    height: 44px;
    background: #f0f0f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
}

.skill-icon img {
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
}

/* ======================================= */
/* ========== ПАГИНАЦИЯ ========== */
/* ======================================= */

.results-info {
    margin: 15px 0;
    padding: 10px 15px;
    background: rgba(74, 74, 138, 0.2);
    border-left: 4px solid #4a4a8a;
    color: #ffffff;
    font-weight: 600;
    border-radius: 0 5px 5px 0;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination a {
    display: inline-block;
    padding: 10px 15px;
    background: #1a1a2e;
    border: 1px solid #4a4a8a;
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 5px;
}

.pagination a:hover {
    background: #4a4a8a;
    color: white;
}

.pagination a.active {
    background: #4a4a8a;
    color: white;
    font-weight: bold;
}

/* ======================================= */
/* ========== ДЕТАЛЬНАЯ СТРАНИЦА КЛАССА ========== */
/* ======================================= */

/* Хедер класса */
.class-header {
    margin: 20px 0;
    padding: 25px;
    background: linear-gradient(135deg, #4a4a8a 0%, #2c3e50 100%);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.class-icon-large {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.class-icon-large img {
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
}

.class-title {
    flex: 1;
}

.class-title h1 {
    margin: 0 0 5px 0;
    font-size: 2em;
}

.class-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* Следующие профессии (горизонтальные карточки) */
.next-class-section {
    margin: 25px 0;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.next-class-section h2 {
    color: #4a4a8a;
    font-size: 1.3em;
    margin-bottom: 15px;
    border-bottom: 2px solid #4a4a8a;
    padding-bottom: 8px;
}

.next-class-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.next-class-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9f9f9;
    padding: 6px 14px;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.2s;
    border: 1px solid #e0e0e0;
}

.next-class-item:hover {
    transform: translateY(-2px);
    background: #e8e8ff;
}

.next-class-item img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.next-class-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.next-class-grade {
    font-size: 0.75em;
    color: #4a4a8a;
    background: rgba(74,74,138,0.1);
    padding: 2px 8px;
    border-radius: 20px;
}

/* Скиллы класса (горизонтальные карточки) */
.skills-section {
    margin: 25px 0;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.skills-section h2 {
    color: #4a4a8a;
    font-size: 1.3em;
    margin-bottom: 15px;
    border-bottom: 2px solid #4a4a8a;
    padding-bottom: 8px;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9f9f9;
    padding: 6px 14px;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.2s;
    border: 1px solid #e0e0e0;
}

.skill-item:hover {
    transform: translateY(-2px);
    background: #e8e8ff;
}

.skill-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.skill-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

/* Статистика класса (сетка 2 колонки) */
.class-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.stat-card h3 {
    margin: 0 0 15px 0;
    color: #4a4a8a;
    font-size: 1.2em;
    border-bottom: 2px solid #4a4a8a;
    padding-bottom: 8px;
}

.stat-card.compact {
    padding: 15px;
}

.compact-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.compact-row:last-child {
    border-bottom: none;
}

.compact-label {
    color: #555;
    font-weight: 500;
    font-size: 0.95em;
}

.stat-value {
    font-weight: 700;
    color: #2c3e50;
}

/* Мастерства (Бонусы ПТ) */
.masteries-section {
    margin: 25px 0;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.masteries-section h2 {
    color: #4a4a8a;
    font-size: 1.3em;
    margin-bottom: 15px;
    border-bottom: 2px solid #4a4a8a;
    padding-bottom: 8px;
}

.masteries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.mastery-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.mastery-label {
    font-weight: 600;
    color: #555;
}

.mastery-value {
    font-weight: 700;
    color: #28a745;
}

/* Ранги мастерства */
.ranks-section {
    margin: 25px 0;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ranks-section h2 {
    color: #4a4a8a;
    font-size: 1.3em;
    margin-bottom: 15px;
    border-bottom: 2px solid #4a4a8a;
    padding-bottom: 8px;
}

.ranks-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-group {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 12px 15px;
}

.rank-title {
    font-weight: 700;
    font-size: 1em;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
    color: #4a4a8a;
}

.rank-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Стихийные ранги */
.elements-ranks-section {
    margin: 25px 0;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.elements-ranks-section h2 {
    color: #4a4a8a;
    font-size: 1.3em;
    margin-bottom: 15px;
    border-bottom: 2px solid #4a4a8a;
    padding-bottom: 8px;
}

.elements-ranks-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.element-rank-group {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 12px 15px;
}

.element-rank-title {
    font-weight: 700;
    font-size: 1em;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

.element-rank-title.fire { color: #e74c3c; }
.element-rank-title.water { color: #3498db; }
.element-rank-title.earth { color: #27ae60; }
.element-rank-title.wind { color: #1abc9c; }

.element-rank-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Бейджики рангов */
.rank-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
}

.rank-badge.ученик { background: #e8f5e9; color: #2e7d32; }
.rank-badge.эксперт { background: #e3f2fd; color: #1565c0; }
.rank-badge.элита { background: #fff3e0; color: #e65100; }
.rank-badge.магистр { background: #f3e5f5; color: #6a1b9a; }

/* ======================================= */
/* ========== НАГРАДЫ ========== */
/* ======================================= */

.rewards-section {
    margin: 25px 0;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.rewards-section h2 {
    color: #4a4a8a;
    font-size: 1.3em;
    margin-bottom: 15px;
    border-bottom: 2px solid #4a4a8a;
    padding-bottom: 8px;
}

.rewards-note {
    background: #e3f2fd;
    padding: 6px 12px;
    border-radius: 8px;
    color: #1565c0;
    font-weight: 500;
    margin-bottom: 15px;
    display: inline-block;
    font-size: 0.85em;
}

.rewards-horizontal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.reward-horizontal-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 6px 14px 6px 10px;
    cursor: default;
}

.reward-horizontal-icon {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    padding: 3px;
}

.reward-horizontal-icon img {
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
}

.reward-horizontal-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.reward-horizontal-name {
    font-weight: 600;
    color: #333;
    font-size: 0.85em;
}

.reward-horizontal-amount {
    font-weight: 600;
    color: #e67e22;
    font-size: 0.8em;
    background: #2c3e50;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.reward-horizontal-amount::before {
    content: "×";
    font-weight: 700;
    margin-right: 2px;
}

/* ======================================= */
/* ========== АДАПТИВНОСТЬ ========== */
/* ======================================= */

@media (max-width: 768px) {
    .class-table {
        font-size: 0.85em;
    }
    
    .class-table th,
    .class-table td {
        padding: 8px;
    }
    
    .skill-icon {
        width: 28px;
        height: 28px;
    }
    
    .skill-icon img {
        max-width: 20px;
        max-height: 20px;
    }
    
    .class-header {
        flex-direction: column;
        text-align: center;
    }
    
    .class-meta {
        justify-content: center;
    }
    
    .masteries-grid {
        grid-template-columns: 1fr;
    }
    
    .class-stats-grid {
        grid-template-columns: 1fr;
    }
}