/* style.css - Consolidated styles for CyberPunk CCG */

/* ===== BASE STYLES ===== */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #0c0c0c;
    color: #e0e0e0;
}

html {
    scroll-behavior: smooth;
}

/* ===== ERROR CONTAINER ===== */
.error-container {
    max-width: 600px;
    margin: 100px auto;
    padding: 20px;
    text-align: center;
    background: #222;
    border-radius: 8px;
    border: 1px solid #ff004f;
}

.error-container h1 { 
    color: #ff004f; 
    margin-bottom: 20px; 
}

.error-container a { 
    color: #ff8c00; 
    text-decoration: none; 
}

.error-container a:hover { 
    color: #ff004f; 
}

/* ===== FIXED NAVIGATION PANEL ===== */
.fixed-navigation {
    position: fixed;
    bottom: 0;
    left: 200px; /* ширина сайдбара */
    right: 0;
    background: rgba(17, 17, 17, 0.95);
    border-top: 2px solid #ff004f;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.7);
}

/* Группы навигации */
.nav-left-group,
.nav-right-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Контейнер для информации о навигации */
.nav-info-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(34, 34, 34, 0.8);
    border-radius: 6px;
    padding: 8px 15px;
    border: 1px solid #444;
    min-width: 200px;
}

/* Счетчик карточек */
.nav-counter {
    font-size: 14px;
    color: #ff8c00;
    font-weight: bold;
    padding: 6px 12px;
    background: #1a1a1a;
    border-radius: 4px;
    border: 1px solid #ff8c00;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.2);
}

/* Фильтр */
.nav-filter {
    font-size: 12px;
    color: #bbb;
    padding: 4px 8px;
    background: #222;
    border-radius: 4px;
    border: 1px solid #444;
    white-space: nowrap;
}

/* Информация о текущей карте */
.current-card-info {
    text-align: right;
    background: rgba(34, 34, 34, 0.8);
    border-radius: 6px;
    padding: 8px 15px;
    border: 1px solid #444;
    min-width: 150px;
}

.current-card-label {
    color: #bbb;
    font-size: 11px;
    margin-bottom: 2px;
}

.current-card-title {
    color: #ff8c00;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Кнопки навигации */
.nav-btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    color: #ff8c00;
    background: #333;
    border: 1px solid #ff8c00;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    min-width: 120px;
    white-space: nowrap;
}

.nav-btn:hover {
    color: #000;
    background: #ff8c00;
    border-color: #ff004f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 140, 0, 0.3);
}

.prev-btn {
    background: linear-gradient(90deg, #333, #222);
}

.next-btn {
    background: linear-gradient(90deg, #222, #333);
}

/* ===== QUALITY INDICATORS ===== */
.quality-good {
    background: linear-gradient(135deg, rgba(17, 234, 46, 0.15), rgba(17, 234, 46, 0.05));
    color: #11ea2e;
    border: 1px solid rgba(17, 234, 46, 0.3);
    text-shadow: 0 0 8px rgba(17, 234, 46, 0.5);
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

.quality-moderate {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.15), rgba(255, 140, 0, 0.05));
    color: #ff8c00;
    border: 1px solid rgba(255, 140, 0, 0.3);
    text-shadow: 0 0 8px rgba(255, 140, 0, 0.5);
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: smaller;
}

.quality-bad {
    background: linear-gradient(135deg, rgba(234, 49, 3, 0.15), rgba(234, 49, 3, 0.05));
    color: #ea3103;
    border: 1px solid rgba(234, 49, 3, 0.3);
    text-shadow: 0 0 8px rgba(234, 49, 3, 0.5);
    padding: 10px;
    border-radius: 6px;
    font-size: smaller;
}

/* ===== SIDEBARS (COMMON STYLES) ===== */
.sidebar, .toc-sidebar {
    width: 200px;
    background: #111;
    border-right: 2px solid #222;
    overflow-y: auto;
    padding: 20px 15px;
    position: fixed;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    scroll-behavior: smooth;
}

.sidebar-header {
    margin-bottom: 20px;
}

.sidebar-header a, .toc-sidebar a.home-button {
    text-decoration: none;
    color: inherit;
}

.sidebar-header h2, .toc-sidebar h2 {
    margin-top: 0;
    font-size: 16px;
    color: #ff004f;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.sidebar a, .toc-sidebar a {
    display: block;
    color: #bbb;
    text-decoration: none;
    padding: 6px 0;
    font-size: 14px;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.p a{
    display: block;
    color: #bbb;
    text-decoration: none;
    padding: 6px 0;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.sidebar a:hover, .toc-sidebar a:hover, p a:hover {
    color: #fff;
    border-left-color: #ff8c00;
    padding-left: 8px;
}

.sidebar a.active, .toc-sidebar a.active, p a.active {
    color: #ff8c00;
    border-left-color: #ff004f;
    padding-left: 8px;
    font-weight: bold;
}

.cards-list {
    flex: 1;
    overflow-y: auto;
}

.toc-subsection {
    padding-left: 15px;
    margin: 5px 0;
    border-left: 1px solid #333;
}

.sidebar a:focus, .toc-sidebar a:focus {
    outline: none;
}

/* ===== MAIN CONTENT AREAS ===== */
.container {
    display: flex;
    min-height: 100vh;
}

.main-content-wrapper {
    display: flex;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    padding: 20px 20px;
    gap: 40px;
    overflow-y: auto;
    align-items: flex-start;
    margin-left: 220px;
    margin-right: 180px;
    margin-bottom: 80px;
    box-sizing: border-box;
}

.rules-main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    color: #e0e0e0;
    line-height: 1.6;
    margin-left: 200px;
}

/* ===== CARD DISPLAY STYLES ===== */
.card-image {
    width: 320px;
    height: auto;
    max-height: 480px;
    background: #333;
    border: 2px solid #444;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-data {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-data h1, .welcome-section h1, .rules-header h1 {
    font-size: 28px;
    margin: 0 0 10px 0;
    background: linear-gradient(90deg, #ff004f, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rules-header h1 {
    font-size: 36px;
}

.card-attributes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 16px;
    color: #ddd;
}

.attribute-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.attribute-row div span {
    color: #ff8c00;
    font-weight: bold;
}

.card-action {
    background: #222;
    display: inline-block;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 16px;
    color: #ddd;
    line-height: 1.5;
    margin-top: 12px;
}

.flavor {
    font-style: italic;
    color: #ffa500;
    border-left: 3px solid #ff8c00;
    padding-left: 12px;
    margin-top: 16px;
}

.flavor .author {
    display: block;
    margin-top: 6px;
    font-weight: bold;
    color: #ff8c00;
    text-align: right;
}

.card-footer {
    margin-top: 12px;
    font-size: 16px;
    color: #ddd;
}

.card-footer div span {
    color: #ff8c00;
    font-weight: bold;
}

/* Скрываем обычные кнопки навигации в card-footer */
.card-navigation {
    display: none;
}

/* ===== RULES PAGE SPECIFIC ===== */
.rules-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ff004f;
}

.rules-header .subtitle {
    color: #bbb;
    font-size: 18px;
}

.page-section {
    margin-bottom: 25px;
    padding: 25px;
    background: #0a0a0a;
    border-radius: 6px;
    border-left: 4px solid #ff004f;
}

.page-section h2 {
    color: #ff8c00;
    margin-top: 0;
    font-size: 24px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    scroll-margin-top: 20px;
}

.page-section h3 {
    color: #ffa500;
    font-size: 20px;
    margin: 25px 0 15px 0;
    scroll-margin-top: 20px;
}

.page-section h4 {
    color: #ff8c00;
    font-size: 18px;
    margin: 20px 0 10px 0;
    scroll-margin-top: 20px;
}

.page-section p {
    margin: 15px 0;
    color: #ddd;
}

.page-section ul, .page-section ol {
    margin: 15px 0;
    padding-left: 30px;
    color: #ddd;
}

.page-section li {
    margin: 8px 0;
}

/* ===== RULES COMPONENTS ===== */
.card-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.card-type {
    background: #222;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #333;
}

.card-type h4 {
    color: #ff004f;
    margin: 0 0 10px 0;
}

.faction-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.faction {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.faction img {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.faction-government {
    background: rgba(0, 100, 255, 0.1);
    border: 1px solid #0064ff;
}

.faction-corporate {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid #ffd700;
}

.faction-street {
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid #808080;
}

.sponsor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.sponsor {
    padding: 20px;
    border-radius: 6px;
}

.sponsor h4, .character-type b {
    color: #ff8c00;
    margin: 0 0 10px 0;
}

.character-type-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.character-type {
    background: #222;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 10px;
}

.character-type .character-text-left {
    flex: 1;
    min-width: 0;
}

.character-type .character-right {
    flex-shrink: 0;
    width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.character-type .character-right h4 {
    color: #ff004f;
    margin: 0 0 15px 0;
    font-size: 20px;
    width: 100%;
    padding-bottom: 8px;
    border-bottom: 1px solid #444;
}

.character-type .character-image {
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
}

.character-type .character-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.character-type .character-text-left p {
    margin: 10px 0;
    color: #ddd;
    line-height: 1.6;
}

.character-type .character-text-left p:first-of-type {
    margin-top: 0;
}

.phase-list {
    background: #222;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
}

.phase-list li {
    padding: 10px 0;
    border-bottom: 1px solid #333;
}

.phase-list li:last-child {
    border-bottom: none;
}

.definition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.definition {
    padding: 15px;
    background: #222;
    border-radius: 6px;
    border-left: 3px solid #ff8c00;
}

.definition strong {
    color: #ff8c00;
}

.note {
    background: rgba(255, 0, 79, 0.1);
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #ff004f;
    margin: 20px 0;
}

.picture-example {
    background: #222;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #333;
    width: 50%;
    height: 50%;
    display: block;
    margin: auto;
}
.types-example {
    background: #222;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #333;
    width: 95%;
    display: block;
    margin: auto;
}
.two-decks-example {
    background: #222;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #333;
    width: 70%;
    display: block;
    margin: auto;
}

/* ===== HOME PAGE STYLES ===== */
.welcome-section {
    padding: 40px;
    max-width: 800px;
    margin-left: 220px;
}

.stats {
    display: flex;
    gap: 30px;
    margin: 40px 0;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: #222;
    border-radius: 8px;
    min-width: 120px;
    border: 1px solid #333;
}

.ready-item {
    font-size: 2.5em;
    margin: 0;
    color: #11ea2e;
}

.bad-item {
    font-size: 2.5em;
    margin: 0;
    color: #ff8c00;
}

.miss-item {
    font-size: 2.5em;
    margin: 0;
    color: #ea3103;
}

.stat-item p {
    margin: 5px 0 0 0;
    color: #bbb;
}

.quick-info {
    margin-top: 40px;
    padding: 25px;
    background: #222;
    border-radius: 8px;
    border: 1px solid #333;
}

.quick-info h2 {
    color: #ff004f;
    margin-top: 0;
}

.quick-info ul {
    list-style-type: none;
    padding-left: 20px;
}

.quick-info li {
    margin: 10px 0;
    padding-left: 25px;
    position: relative;
    color: #ddd;
}

.quick-info li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4CAF50;
}

.home-link {
    text-decoration: none;
    color: #ff004f;
    display: inline-block;
    margin-bottom: 15px;
}

.home-link:hover {
    color: #ff8c00;
}

/* ===== FILTER BUTTONS ===== */
.filters-container {
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #333;
}

.filter-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.filter-btn {
    display: block;
    padding: 8px 5px;
    font-size: 11px;
    color: #bbb;
    background: #222;
    border: 1px solid #444;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    min-height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-btn:hover {
    color: #fff;
    background: #333;
    border-color: #ff8c00;
}

.filter-btn.active {
    color: #000;
    background: #ff8c00;
    border-color: #ff004f;
    font-weight: bold;
}

.filter-btn-all.active {
    color: #000;
    background: linear-gradient(135deg, #ff8c00, #ff5500);
    border-color: #ff004f;
    font-weight: bold;
}
/* Добавьте эти стили в конец файла style.css, перед медиа-запросами */

/* ===== RULES BUTTON ===== */
.rules-button-container {
    text-align: center;
    margin: 40px 0;
}

.rules-btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 18px;
    color: #ff004f;
    background: #333;
    border: 2px solid #ff004f;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
}

.rules-btn:hover {
    color: #000;
    background: #ff004f;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(255, 0, 79, 0.3);
}

/* ===== MISSING CARDS SECTION ===== */
.missing-cards-section {
    margin-top: 40px;
    padding: 25px;
    background: #222;
    border-radius: 8px;
    border: 1px solid #333;
}

.missing-cards-section h2 {
    color: #ff004f;
    margin-top: 0;
}

.missing-cards-table {
    margin-top: 20px;
    overflow-x: auto;
}

.missing-cards-table table {
    width: 100%;
    border-collapse: collapse;
}

.missing-cards-table th {
    background: #333;
    color: #ff8c00;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #444;
}

.missing-cards-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #444;
    color: #ddd;
}

.missing-cards-table tr:hover {
    background: #2a2a2a;
}

.missing-cards-table tr:nth-child(even) {
    background: rgba(255, 140, 0, 0.05);
}

.contact-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 140, 0, 0.1);
    border-radius: 6px;
    border: 1px solid #ff8c00;
}

.contact-info p {
    margin: 0;
    color: #ff8c00;
}

.contact-info em {
    color: #fff;
    font-style: normal;
    font-weight: bold;
}

/* ===== MOBILE ADAPTIVE ===== */
@media (max-width: 768px) {
    /* Скрываем сайдбар на мобильных */
    .sidebar {
        left: -200px;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    /* Адаптация фиксированной панели навигации */
    .fixed-navigation {
        left: 0 !important;
        right: 0 !important;
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .nav-left-group,
    .nav-right-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-info-container {
        order: 2;
        justify-content: center;
        min-width: 100%;
        margin: 10px 0;
    }
    
    .nav-counter {
        min-width: 70px;
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .nav-filter {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .current-card-info {
        min-width: 120px;
        padding: 6px 10px;
    }
    
    .current-card-label {
        font-size: 10px;
    }
    
    .current-card-title {
        font-size: 12px;
        max-width: 150px;
    }
    
    .nav-btn {
        padding: 8px 15px;
        font-size: 13px;
        min-width: 100px;
        order: 1;
    }
        .rules-button-container {
        margin: 30px 0;
    }
    
    .rules-btn {
        padding: 10px 20px;
        font-size: 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .missing-cards-section {
        margin-top: 30px;
        padding: 15px;
    }
    
    .missing-cards-table table {
        font-size: 14px;
    }
    
    .missing-cards-table th,
    .missing-cards-table td {
        padding: 8px 10px;
    }
    
    .contact-info {
        padding: 12px;
        font-size: 14px;
    }
    
    /* Для левой группы: кнопка слева, информация справа */
    .nav-left-group {
        flex-wrap: wrap;
    }
    
    .nav-left-group .nav-btn {
        order: 1;
    }
    
    .nav-left-group .nav-info-container {
        order: 2;
        width: 100%;
        margin-top: 10px;
    }
    
    /* Для правой группы: информация слева, кнопка справа */
    .nav-right-group {
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .nav-right-group .current-card-info {
        order: 1;
        flex: 1;
    }
    
    .nav-right-group .nav-btn {
        order: 2;
    }
    
    /* Уменьшаем отступ для основного контента на мобильных */
    .main-content {
        margin-bottom: 180px !important;
        margin-left: 0;
        margin-right: 0;
        padding: 60px 20px 20px 20px;
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .rules-main-content {
        margin-left: 0;
        padding: 60px 20px 20px 20px;
    }
    
    .card-image {
        width: 80%;
        max-height: none;
    }
    
    .attribute-row {
        grid-template-columns: 1fr;
    }
    
    .flavor .author {
        text-align: left;
    }
    
    .character-type {
        flex-direction: column;
        gap: 20px;
    }
    
    .character-type .character-right {
        width: 100%;
        order: 1;
    }
    
    .character-type .character-text-left {
        order: 2;
    }
    
    .character-type .character-image {
        height: 200px;
    }
    
    .rules-header h1 {
        font-size: 28px;
    }
    
    .page-section {
        padding: 15px;
    }
    
    .picture-example {
        width: 90%;
        height: auto;
    }
    
    .welcome-section {
        padding: 20px 15px;
        margin-left: 0;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .quick-info {
        padding: 15px;
    }
    
    .filter-buttons {
        gap: 3px;
    }
    
    .filter-btn {
        font-size: 10px;
        padding: 4px 6px;
        min-width: 50px;
        max-width: 60px;
    }
    
    .card-navigation {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .nav-btn {
        width: 100%;
        min-width: 0;
        padding: 12px 15px;
    }
    
    .nav-counter {
        width: 100%;
        order: -1;
    }
}