/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Хедер */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 0;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    opacity: 0.9;
    font-size: 1.1em;
    max-width: 600px;
    margin: 0 auto;
}

/* Загрузчик */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    font-size: 1.2em;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #667eea;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 15px;
    font-size: 1.1em;
    color: #333;
    text-align: center;
    max-width: 400px;
}

/* Подсветка языка */
.highlight-language {
    color: #dc3545 !important;
    font-weight: 800 !important;
    background-color: rgba(220, 53, 69, 0.15) !important;
    padding: 3px 8px !important;
    border-radius: 5px !important;
    border: 2px solid #f5c6cb !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
    display: inline-block;
    margin: 1px;
    font-size: 1.05em;
}

/* Контейнер поиска */
.search-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.search-container h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* Форма поиска */
.search-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #444;
    font-size: 1.1em;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group select[multiple] {
    height: auto;
    min-height: 150px;
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Опции подсветки языка */
.highlight-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-langs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.lang-tag {
    background: #e9ecef;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #dee2e6;
}

.lang-tag:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Чекбокс */
.form-group label input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* Кнопка поиска */
.btn-search {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-search:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-search:active {
    transform: translateY(-1px);
}

/* Примеры игр */
.examples {
    margin-top: 40px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-left: 5px solid #667eea;
}

.examples h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-examples {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.game-examples a {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.95em;
    font-weight: 500;
    display: block;
}

.game-examples a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.examples-note {
    color: #6c757d;
    font-size: 0.9em;
    text-align: center;
    margin-top: 10px;
}

/* Хедер результатов */
.results-header {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    transition: color 0.2s;
}

.back-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.results-header h1 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #333;
}

.game-title {
    color: #667eea;
    font-weight: 700;
}

.search-info {
    margin-top: 20px;
}

.info-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.info-box p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.highlight-lang {
    background: #fff3cd;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Контейнер результатов */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* Карточка игры */
.game-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.game-card.error {
    border-left: 5px solid #dc3545;
}

.game-card.error:hover {
    transform: none;
}

.card-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.3em;
    color: white;
    margin: 0;
    font-weight: 600;
}

/* Бейджи */
.badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-trial {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    color: white;
}

.badge-included {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.badge-error {
    background: #dc3545;
    color: white;
}

/* Тело карточки */
.card-body {
    padding: 25px;
}

.info-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f3f4;
}

.info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-section h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.05em;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

/* Платформа */
.platform-info .platforms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.platform-badge-tag {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
    display: inline-block;
}

.platform-badge-tag:nth-child(2) {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

/* Языки */
.languages {
    color: #333;
    line-height: 1.8;
    font-size: 1.05em;
}

/* Цены */
.price-info .price {
    font-size: 1.4em;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 5px;
}

.price-info .price small {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: normal;
    margin-left: 10px;
}

/* Скидки */
.discount-price {
    margin-bottom: 10px;
}

.price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.price-old small {
    font-size: 0.8em;
    color: #999;
}

.price-new {
    color: #28a745;
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 5px;
}

.discount-badge {
    background: #dc3545;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    display: inline-block;
    margin-left: 10px;
}

.price-note {
    color: #6c757d;
    font-size: 0.95em;
    margin-top: 8px;
}

/* Ссылка на магазин */
.link-section {
    text-align: center;
    padding-top: 20px !important;
}

.store-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 28px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.05em;
    transition: all 0.3s ease;
    width: 100%;
    border: none;
    cursor: pointer;
}

.store-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    color: white;
}

/* Сообщения об ошибках */
.error-msg {
    color: #dc3545;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Нет результатов */
.no-results {
    background: white;
    padding: 50px 40px;
    text-align: center;
    border-radius: 15px;
    grid-column: 1 / -1;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border: 2px dashed #dee2e6;
}

.no-results h3 {
    color: #6c757d;
    margin-bottom: 25px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.no-results p {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.no-results ul {
    list-style: none;
    margin: 25px auto;
    text-align: left;
    display: inline-block;
    max-width: 500px;
}

.no-results li {
    margin: 12px 0;
    padding-left: 25px;
    position: relative;
    color: #6c757d;
}

.no-results li:before {
    content: "➤";
    position: absolute;
    left: 0;
    color: #667eea;
}

.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 35px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1em;
    margin-top: 20px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    color: white;
}

/* Статистика результатов */
.results-summary {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-top: 40px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.results-summary h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-number {
    display: block;
    font-size: 2.5em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
    line-height: 1;
}

.stat-label {
    color: #6c757d;
    font-size: 1em;
    font-weight: 500;
}

/* Нет данных */
.no-data {
    color: #6c757d;
    font-style: italic;
    font-size: 1em;
}

/* Футер */
footer {
    margin-top: 60px;
    padding: 30px 0;
    background: #2c3e50;
    color: white;
    text-align: center;
}

footer .container {
    max-width: 1000px;
}

footer p {
    margin-bottom: 10px;
    opacity: 0.9;
}

.disclaimer {
    font-size: 0.9em;
    opacity: 0.7;
    margin: 15px 0;
    line-height: 1.5;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.version {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 20px;
    color: #bdc3c7;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        padding: 20px 0;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .search-container {
        padding: 20px;
    }
    
    .results-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-examples {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .info-box p {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .card-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .card-header h3 {
        font-size: 1.2em;
    }
    
    .badge {
        font-size: 0.8em;
        padding: 6px 12px;
    }
}
