/* charts.css - Стили для чартов в стиле основного сайта idpixel.ru */

/* ===== БАЗОВЫЕ СТИЛИ (адаптированы из blog_201223.css) ===== */
@media (min-width: 48em) {
  html {
    font-size: 16px;
  }
}

body {
    min-width: 320px;
    font-family: Arial, Tahoma, sans-serif;
    color: #2c2c2c;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

/* Адаптивная ширина контейнера */
body.charts-page { max-width: 1400px; }
body.charts-list-page { max-width: 1200px; }
body.editor-page { max-width: 1600px; }
body.uploader-page { max-width: 800px; }

h1, .h1,
h2, .h2,
h3, .h3,
h4, .h4,
h5, .h5,
h6, .h6 {
    font-family: Arial, Tahoma, sans-serif;
    font-weight: normal;
    color: #2c2c2c;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
    font-weight: bold;
}

h2 {
    color: #495057;
    margin-top: 40px;
    font-size: 1.4rem;
}

h3 {
    margin-top: 0;
    color: #495057;
    font-size: 1.2rem;
}

/* ===== КОНТЕЙНЕР (стиль как в блоге) ===== */
.container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ===== ССЫЛКИ (из blog_201223.css) ===== */
a {
    color: #0275d8;
    text-decoration: none;
}

a:hover {
    color: #014c8c;
    text-decoration: none !important;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #0275d8;
    text-decoration: none;
    font-weight: bold;
}

.back-link:hover {
    color: #014c8c;
    text-decoration: underline;
}

.week-link {
    color: #0275d8;
    text-decoration: none;
    font-weight: bold;
}

.week-link:hover {
    color: #014c8c;
    text-decoration: underline;
}

/* ===== СООБЩЕНИЯ (стиль блога) ===== */
.message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    font-weight: bold;
}

.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ===== ИНФОРМАЦИОННЫЕ БЛОКИ (как sidebar-module) ===== */
.stats, .week-info {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.example {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
}

.example h3 {
    margin-top: 0;
    color: #495057;
}

.example pre {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 3px;
    overflow-x: auto;
    font-size: 12px;
}

.no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px;
}

/* ===== ФОРМЫ (адаптированы из admin.css) ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    font-size: 11px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    /*width: 100%;*/
    padding: 8px;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: Arial, Tahoma, sans-serif;
    font-size: 13px;
    color: #515151;
    outline: none;
    transition: all 0.2s ease-in-out;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #666;
    box-shadow: 0px 0 20px rgba(25, 101, 181, 0.20);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

/* Специальные стили для textarea */
textarea {
    min-height: 300px;
    padding: 15px;
    border: 2px solid #bdbdbd;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
}

textarea:focus {
    border-color: #4CAF50;
    outline: none;
}

/* ===== КНОПКИ (в стиле admin.css) ===== */
.btn {
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    opacity: 1;
    cursor: pointer;
    border: none;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    -webkit-font-smoothing: antialiased;
    text-shadow: none;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    font-size: 14px;
    text-decoration: none;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn:hover {
    opacity: 0.8;
}

.btn:active {
    opacity: 1;
    box-shadow: inset 0px 2px 2px rgba(0, 0, 0, 0.4);
}

.btn-primary { 
    background-color: #1965b5; 
    color: white; 
}

.btn-success { 
    background-color: #009d76; 
    color: white; 
}

.btn-danger { 
    background-color: #f51a00; 
    color: white; 
}

.btn-secondary { 
    background-color: #666; 
    color: white; 
}

/* Специальная кнопка для загрузчика (в стиле блога) */
button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

.add-row-btn {
    margin: 20px 0;
}

/* ===== ТАБЛИЦЫ (стиль блога + admin) ===== */
.weeks-table, 
.chart-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 16px;
    color: #333;
}

.weeks-table th, 
.weeks-table td,
.chart-table th, 
.chart-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ebebeb;
    vertical-align: top;
}

/* Для редактора добавляем границы */
.chart-table th,
.chart-table td {
    border: 1px solid #ddd;
}

.weeks-table th, 
.chart-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #777;
    font-size: 12px;
    text-transform: uppercase;
    text-align: center;
    position: sticky;
    top: 0;
}

.weeks-table tr:hover, 
.chart-table tr:hover {
    background-color: #f5f5f5;
}

/* Альтернативные строки как в box_office */
.weeks-table tr:nth-child(even) {
    background-color: #ffffff;
}

.weeks-table tr:nth-child(odd) {
    background-color: #f8f8f8;
}

/* ===== ШИРИНЫ КОЛОНОК ДЛЯ РЕДАКТОРА ===== */
.position-col { width: 80px; }
.title-col { width: 200px; }
.publisher-col { width: 150px; }
.platforms-col { width: 240px; }
.platforms-ids-col { width: 40px; }
.codename-col { width: 180px; }  /* было 120px, стало 180px */
.price-col { width: 80px; }
.actions-col { width: 60px; }

/* ===== ИНПУТЫ В ТАБЛИЦАХ (стиль admin) ===== */
.chart-table input {
    width: 100%;
    padding: 5px;
    border: 1px solid #bdbdbd;
    border-radius: 3px;
    box-sizing: border-box;
    font-family: Arial, Tahoma, sans-serif;
    font-size: 14px;
    color: #515151;
    outline: none;
    transition: all 0.2s ease-in-out;
}

.chart-table input:focus {
    border-color: #666;
    box-shadow: 0px 0 20px rgba(25, 101, 181, 0.20);
}

.chart-table input[type="number"] {
    width: 80px;
}

/* ===== ПОЗИЦИИ И ИЗМЕНЕНИЯ (в стиле блога) ===== */
.position {
    font-weight: bold;
    font-size: 1.2em;
    text-align: center;
    width: 60px;
}

.position-1 { color: #ffd700; }
.position-2 { color: #c0c0c0; }
.position-3 { color: #cd7f32; }

.position-change {
    text-align: center;
    font-weight: bold;
    width: 80px;
}

.position-up { color: #3caa3c; }
.position-down { color: #ff0000; }
.position-same { color: #9f9f9f; }
.new-entry { 
    color: #1965b5; 
    font-size: 0.8em;
    font-weight: bold;
}

/* ===== КОНТЕНТ ИГРЫ ===== */
.game-title {
    font-weight: bold;
    min-width: 200px;
    color: #2c2c2c;
}

.publisher {
    color: #9f9f9f;
    font-style: italic;
}

.platforms {
    font-size: 0.9em;
}

.platform-tag {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 4px;
    display: inline-block;
    margin-bottom: 2px;
    font-size: 0.8em;
    color: #666;
}

.price {
    font-weight: bold;
    color: #3caa3c;
    text-align: right;
}

.currency {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    color: #666;
}

/* ===== АВТОКОМПЛИТ (из admin.css) ===== */
.autocomplete-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.autocomplete-suggestions {
    text-align: left; 
    cursor: default; 
    border: 1px solid #ccc; 
    border-top: 0; 
    background: #fff; 
    box-shadow: -1px 1px 3px rgba(0,0,0,.1);
    position: absolute; 
    display: none; 
    z-index: 9999; 
    max-height: 254px; 
    overflow: hidden; 
    overflow-y: auto; 
    box-sizing: border-box;
    min-width: 300px;
}

.autocomplete-suggestion { 
    position: relative; 
    padding: 0 .6em; 
    line-height: 23px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    font-size: 1.02em; 
    color: #333;
}

.autocomplete-suggestion b { 
    font-weight: normal; 
    color: #1965b5; 
}

.autocomplete-suggestion.selected { 
    background: #f0f0f0; 
}

.autocomplete-suggestion:hover {
    background-color: #f0f0f0;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.suggestion-codename {
    font-weight: bold;
    color: #1965b5;
}

.suggestion-title {
    color: #666;
    font-size: 0.9em;
    margin-left: 10px;
}

.codename-input.empty-field {
    border: 2px solid #f51a00 !important;
    background-color: #fff5f5;
}

/* ===== СПЕЦИАЛЬНЫЕ КЛАССЫ ===== */
.delete-row {
    background-color: #f8d7da;
}

/* ===== МЕТА-ИНФОРМАЦИЯ (в стиле блога) ===== */
.blog-post-meta {
    margin-bottom: 0.5rem;
    color: #9f9f9f;
    font-size: 0.8rem;
}

.blog-post-meta a {
    color: #3b6785;
}

.blog-post-meta a:hover {
    color: #0275d8;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1200px) {
    .container {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .chart-table,
    .weeks-table {
        font-size: 14px;
    }
    
    .chart-table th,
    .chart-table td {
        padding: 6px;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    .platform-tag {
        font-size: 0.7em;
        padding: 1px 4px;
    }
}

@media (max-width: 430px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 15px;
    }
    
    .chart-table,
    .weeks-table {
        font-size: 11px;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 12px;
    }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ В СТИЛЕ БЛОГА ===== */
.blog-post-title {
    margin-bottom: .5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c2c2c;
}

.blog-post-title a {
    color: #2c2c2c !important;
}

.blog-post-title a:hover {
    color: #0275d8 !important;
}

/* Цветовая схема для разных категорий (из blog) */
.games_cat .currency,
.games_cat .platform-tag {
    border-color: #e14000;
    color: #e14000;
}

.movies_cat .currency,
.movies_cat .platform-tag {
    border-color: #009d76;
    color: #009d76;
}

.tv_cat .currency,
.tv_cat .platform-tag {
    border-color: #631cc4;
    color: #631cc4;
}

.anime_cat .currency,
.anime_cat .platform-tag {
    border-color: #c124a2;
    color: #c124a2;
}

/* Стили для dotted ссылок */
.dotted {
    border-bottom: 1px dotted;
    cursor: pointer;
}

.dashed {
    border-bottom: 1px dashed;
    cursor: pointer;
}

.blue {
    border-color: #0275d8;
    color: #0275d8;
    cursor: pointer;
}

.grey {
    border-color: #9f9f9f;
    color: #9f9f9f;
    cursor: pointer;
}

.red {
    color: #ff0000;
}

.green {
    color: #3caa3c;
}

.hidden {
    display: none !important;
}

.edit-link {
    display: inline-block;
    margin-bottom: 20px;
    margin-left: 20px;
    color: #e14000;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

.edit-link:hover {
    color: #ff5518;
    text-decoration: underline;
}

/* В таблицах - просто значок рядом */
.weeks-table .edit-link {
    margin: 0 0 0 8px;
    font-size: 1rem;
    text-decoration: none;
}

.weeks-table .edit-link:hover {
    text-decoration: none;
}

.external-links {
    margin-top: 4px;
    font-size: 10px;
}

.external-link {
    display: inline-block;
    padding: 1px 4px;
    margin-right: 4px;
    font-size: 10px;
    font-weight: normal;
    text-transform: uppercase;
    text-decoration: none;
    color: #666;
    border-bottom: 1px dotted #666;
    background-color: transparent;
    transition: all 0.2s ease;
}

.sc-link {
    background-color: transparent;
}

.sc-link:hover {
    color: #631cc4;
    border-bottom-color: #631cc4;
    background-color: transparent;
}

.moby-link {
    background-color: transparent;
}

.moby-link:hover {
    color: #009d76;
    border-bottom-color: #009d76;
    background-color: transparent;
}

.message a.btn {
    display: inline-block;
    margin-top: 10px;
    text-decoration: none;
}

.message a.btn:hover {
    text-decoration: none;
    opacity: 0.8;
}

.suggestion-extra {
    color: #999;
    font-size: 0.8em;
    margin-left: 5px;
    font-style: italic;
}

.autocomplete-suggestion {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 6px 12px;
}