package com.mygdx.game;

import com.badlogic.gdx.graphics.Color;

/**
 * Конфигурация игры - все цвета, константы и настройки в одном месте.
 */
public class GameConfig {
    
    // ==================== РАЗМЕРЫ ЭКРАНА ====================
    public static final int WIDTH = 1700;
    public static final int HEIGHT = 950;
    public static final int UI_INPUT_HEIGHT = 210;
    
    // ==================== ЦВЕТА UI ====================
    public static final Color UI_PANEL_BG = new Color(0.2f, 0.3f, 0.4f, 0.95f);
    public static final Color UI_PANEL_BORDER = new Color(0.4f, 0.6f, 0.8f, 1f);
    public static final Color UI_INPUT_BG = new Color(0.3f, 0.4f, 0.5f, 0.8f);
    public static final Color UI_WRONG_ANSWER_BG = new Color(1f, 0.2f, 0.2f, 0.3f);
    
    // ==================== ЦВЕТА МЕНЮ ====================
    public static final Color MENU_SPACE_BG = new Color(0.05f, 0.05f, 0.1f, 1f);
    public static final Color MENU_BUTTON_BORDER = new Color(1f, 1f, 1f, 0.3f);
    public static final Color MENU_BUTTON_HOVER = new Color(1f, 1f, 1f, 0.1f);
    
    // Цвета кнопок главного меню
    public static final Color BUTTON_NEW_GAME = new Color(0.2f, 0.5f, 0.8f, 0.9f);
    public static final Color BUTTON_NEW_GAME_HOVER = new Color(0.3f, 0.6f, 0.9f, 1f);
    public static final Color BUTTON_PLANET = new Color(0.8f, 0.4f, 0.2f, 0.9f);
    public static final Color BUTTON_PLANET_HOVER = new Color(0.9f, 0.5f, 0.3f, 1f);
    public static final Color BUTTON_HELP = new Color(0.2f, 0.7f, 0.3f, 0.9f);
    public static final Color BUTTON_HELP_HOVER = new Color(0.3f, 0.8f, 0.4f, 1f);
    public static final Color BUTTON_ABOUT = new Color(0.7f, 0.2f, 0.7f, 0.9f);
    public static final Color BUTTON_ABOUT_HOVER = new Color(0.8f, 0.3f, 0.8f, 1f);
    public static final Color BUTTON_EXIT = new Color(0.8f, 0.2f, 0.2f, 0.9f);
    public static final Color BUTTON_EXIT_HOVER = new Color(0.9f, 0.3f, 0.3f, 1f);
    public static final Color BUTTON_BACK = new Color(0.4f, 0.4f, 0.4f, 0.9f);
    public static final Color BUTTON_BACK_HOVER = new Color(0.5f, 0.5f, 0.5f, 1f);
    
    // Цвета кнопок планет
    public static final Color BUTTON_EARTH = new Color(0.3f, 0.6f, 0.9f, 0.9f);
    public static final Color BUTTON_EARTH_HOVER = new Color(0.4f, 0.7f, 1.0f, 1f);
    public static final Color BUTTON_MARS = new Color(0.8f, 0.3f, 0.2f, 0.9f);
    public static final Color BUTTON_MARS_HOVER = new Color(0.9f, 0.4f, 0.3f, 1f);
    public static final Color BUTTON_VENUS = new Color(1.0f, 0.7f, 0.2f, 0.9f);
    public static final Color BUTTON_VENUS_HOVER = new Color(1.0f, 0.8f, 0.3f, 1f);
    
    // ==================== НАЗВАНИЯ ЗДАНИЙ ПО ПЛАНЕТАМ ====================
    public static final String[][] BUILDING_TYPES_BY_PLANET = {
        // Земля
        {
            "✨ Уютный Домик ✨",
            "🏥 Детская Больница 🏥",
            "🎒 Весёлая Школа 🎒",
            "🎪 Игровая Площадка 🎪",
            "💰 Надёжный Банк 💰",
            "💊 Здоровая Аптека 💊",
            "🎭 Волшебный Театр 🎭",
            "🎬 КиноМир 🎬"
        },
        // Марс
        {
            "🚀 Марсианская База 🚀",
            "🔴 Красная Лаборатория 🔴",
            "🛰️ Космопорт 🛰️",
            "⚡ Энергокупол ⚡",
            "💧 Водородный Завод 💧",
            "🌌 Обсерватория 🌌",
            "🤖 Робо-Фабрика 🤖",
            "🧪 Биокупол 🧪"
        },
        // Венера
        {
            "🌋 Вулканический Дом 🌋",
            "🔥 Термальная Станция 🔥",
            "🌅 Золотой Дворец 🌅",
            "☁️ Облачный Город ☁️",
            "💎 Кристальная Шахта 💎",
            "🌡️ Теплица 🌡️",
            "🌀 Вихревой Генератор 🌀",
            "✨ Сияющая Башня ✨"
        }
    };
    
    // ==================== ЦВЕТА ЗДАНИЙ ПО ПЛАНЕТАМ ====================
    public static final Color[][][] BUILDING_COLOR_THEMES_BY_PLANET = {
        // 0. Земля - тёплые цвета
        {
            // Дома
            { new Color(1.0f, 0.85f, 0.7f, 1), new Color(0.95f, 0.9f, 0.75f, 1), new Color(0.9f, 0.8f, 0.85f, 1) },
            // Больницы
            { new Color(1.0f, 1.0f, 1.0f, 1), new Color(0.98f, 0.98f, 1.0f, 1), new Color(0.96f, 1.0f, 0.98f, 1) },
            // Школы
            { new Color(1.0f, 0.95f, 0.8f, 1), new Color(0.85f, 0.95f, 1.0f, 1), new Color(0.95f, 0.85f, 1.0f, 1) },
            // Игровые площадки
            { new Color(1.0f, 0.9f, 0.8f, 1), new Color(0.9f, 1.0f, 0.9f, 1), new Color(0.9f, 0.9f, 1.0f, 1) },
            // Банки
            { new Color(0.95f, 0.95f, 0.9f, 1), new Color(0.9f, 0.92f, 0.85f, 1), new Color(0.85f, 0.89f, 0.8f, 1) },
            // Аптеки
            { new Color(1.0f, 1.0f, 1.0f, 1), new Color(0.98f, 1.0f, 0.98f, 1), new Color(0.96f, 0.98f, 1.0f, 1) },
            // Театры
            { new Color(0.95f, 0.9f, 0.95f, 1), new Color(0.9f, 0.95f, 1.0f, 1), new Color(1.0f, 0.95f, 0.9f, 1) },
            // Кинотеатры
            { new Color(0.2f, 0.2f, 0.3f, 1), new Color(0.3f, 0.2f, 0.4f, 1), new Color(0.4f, 0.3f, 0.5f, 1) }
        },
        // 1. Марс - красные, оранжевые, коричневые
        {
            { new Color(0.8f, 0.3f, 0.2f, 1), new Color(0.9f, 0.5f, 0.3f, 1), new Color(0.7f, 0.4f, 0.3f, 1) },
            { new Color(0.9f, 0.4f, 0.4f, 1), new Color(1.0f, 0.6f, 0.5f, 1), new Color(0.8f, 0.5f, 0.5f, 1) },
            { new Color(0.7f, 0.5f, 0.4f, 1), new Color(0.8f, 0.6f, 0.5f, 1), new Color(0.6f, 0.4f, 0.3f, 1) },
            { new Color(0.9f, 0.6f, 0.3f, 1), new Color(1.0f, 0.7f, 0.4f, 1), new Color(0.8f, 0.5f, 0.2f, 1) },
            { new Color(0.6f, 0.7f, 0.8f, 1), new Color(0.7f, 0.8f, 0.9f, 1), new Color(0.5f, 0.6f, 0.7f, 1) },
            { new Color(0.3f, 0.4f, 0.6f, 1), new Color(0.4f, 0.5f, 0.7f, 1), new Color(0.2f, 0.3f, 0.5f, 1) },
            { new Color(0.5f, 0.5f, 0.5f, 1), new Color(0.6f, 0.6f, 0.6f, 1), new Color(0.4f, 0.4f, 0.4f, 1) },
            { new Color(0.4f, 0.7f, 0.4f, 1), new Color(0.5f, 0.8f, 0.5f, 1), new Color(0.3f, 0.6f, 0.3f, 1) }
        },
        // 2. Венера - желтые, золотые, оранжевые
        {
            { new Color(1.0f, 0.7f, 0.3f, 1), new Color(1.0f, 0.8f, 0.4f, 1), new Color(0.9f, 0.6f, 0.2f, 1) },
            { new Color(1.0f, 0.6f, 0.2f, 1), new Color(1.0f, 0.7f, 0.3f, 1), new Color(0.9f, 0.5f, 0.1f, 1) },
            { new Color(1.0f, 0.9f, 0.3f, 1), new Color(1.0f, 1.0f, 0.5f, 1), new Color(0.9f, 0.8f, 0.2f, 1) },
            { new Color(1.0f, 0.95f, 0.8f, 1), new Color(1.0f, 1.0f, 0.9f, 1), new Color(0.95f, 0.9f, 0.7f, 1) },
            { new Color(0.8f, 0.9f, 1.0f, 1), new Color(0.9f, 1.0f, 1.0f, 1), new Color(0.7f, 0.8f, 0.9f, 1) },
            { new Color(0.7f, 0.9f, 0.6f, 1), new Color(0.8f, 1.0f, 0.7f, 1), new Color(0.6f, 0.8f, 0.5f, 1) },
            { new Color(0.9f, 0.8f, 0.5f, 1), new Color(1.0f, 0.9f, 0.6f, 1), new Color(0.8f, 0.7f, 0.4f, 1) },
            { new Color(1.0f, 0.95f, 0.7f, 1), new Color(1.0f, 1.0f, 0.8f, 1), new Color(0.95f, 0.9f, 0.6f, 1) }
        }
    };
    
    // ==================== ЦВЕТА КРЫШ ПО ПЛАНЕТАМ ====================
    public static final Color[][][] ROOF_COLORS_BY_PLANET = {
        // Земля
        {
            { new Color(0.9f, 0.3f, 0.2f, 1), new Color(0.7f, 0.4f, 0.2f, 1) },
            { new Color(1.0f, 0.8f, 0.8f, 1), new Color(0.9f, 0.7f, 0.7f, 1) },
            { new Color(0.4f, 0.7f, 1.0f, 1), new Color(0.3f, 0.6f, 0.9f, 1) },
            { new Color(1.0f, 0.8f, 0.4f, 1), new Color(0.9f, 0.5f, 0.9f, 1) },
            { new Color(1.0f, 0.9f, 0.3f, 1), new Color(0.9f, 0.8f, 0.2f, 1) },
            { new Color(0.4f, 0.9f, 0.5f, 1), new Color(0.3f, 0.8f, 0.4f, 1) },
            { new Color(0.8f, 0.4f, 1.0f, 1), new Color(0.7f, 0.3f, 0.9f, 1) },
            { new Color(0.3f, 0.3f, 0.4f, 1), new Color(0.4f, 0.3f, 0.5f, 1) }
        },
        // Марс
        {
            { new Color(0.7f, 0.2f, 0.1f, 1), new Color(0.6f, 0.1f, 0.0f, 1) },
            { new Color(0.8f, 0.3f, 0.2f, 1), new Color(0.7f, 0.2f, 0.1f, 1) },
            { new Color(0.5f, 0.4f, 0.3f, 1), new Color(0.4f, 0.3f, 0.2f, 1) },
            { new Color(0.8f, 0.5f, 0.2f, 1), new Color(0.7f, 0.4f, 0.1f, 1) },
            { new Color(0.4f, 0.5f, 0.7f, 1), new Color(0.3f, 0.4f, 0.6f, 1) },
            { new Color(0.2f, 0.3f, 0.5f, 1), new Color(0.1f, 0.2f, 0.4f, 1) },
            { new Color(0.4f, 0.4f, 0.4f, 1), new Color(0.3f, 0.3f, 0.3f, 1) },
            { new Color(0.3f, 0.6f, 0.3f, 1), new Color(0.2f, 0.5f, 0.2f, 1) }
        },
        // Венера
        {
            { new Color(0.8f, 0.4f, 0.1f, 1), new Color(0.7f, 0.3f, 0.0f, 1) },
            { new Color(0.9f, 0.5f, 0.1f, 1), new Color(0.8f, 0.4f, 0.0f, 1) },
            { new Color(1.0f, 0.8f, 0.1f, 1), new Color(0.9f, 0.7f, 0.0f, 1) },
            { new Color(1.0f, 1.0f, 0.8f, 1), new Color(0.9f, 0.9f, 0.7f, 1) },
            { new Color(0.7f, 0.8f, 0.9f, 1), new Color(0.6f, 0.7f, 0.8f, 1) },
            { new Color(0.6f, 0.8f, 0.5f, 1), new Color(0.5f, 0.7f, 0.4f, 1) },
            { new Color(0.8f, 0.7f, 0.4f, 1), new Color(0.7f, 0.6f, 0.3f, 1) },
            { new Color(0.95f, 0.9f, 0.6f, 1), new Color(0.85f, 0.8f, 0.5f, 1) }
        }
    };
    
    // ==================== МАСШТАБЫ ЗДАНИЙ ПО ПЛАНЕТАМ ====================
    public static final float[][] SIZE_SCALE_FACTORS_BY_PLANET = {
        // Земля
        {1.0f, 0.75f, 0.8f, 0.85f, 0.7f, 0.65f, 0.8f, 0.85f},
        // Марс (компактнее)
        {0.9f, 0.7f, 0.8f, 0.75f, 0.65f, 0.6f, 0.7f, 0.75f},
        // Венера (выше)
        {1.1f, 1.0f, 1.05f, 1.0f, 0.9f, 0.85f, 1.0f, 1.05f}
    };
    
    // ==================== ЦВЕТА ДЕТАЛЕЙ ПО ПЛАНЕТАМ ====================
    public static final Color[][] DETAIL_COLORS_BY_PLANET = {
        // Земля
        {
            new Color(1.0f, 0.9f, 0.2f, 1),
            new Color(1.0f, 0.5f, 0.5f, 1),
            new Color(0.5f, 0.8f, 1.0f, 1),
            new Color(0.8f, 1.0f, 0.5f, 1),
            new Color(1.0f, 0.7f, 1.0f, 1)
        },
        // Марс
        {
            new Color(1.0f, 0.6f, 0.2f, 1),
            new Color(0.8f, 0.3f, 0.2f, 1),
            new Color(0.9f, 0.8f, 0.4f, 1),
            new Color(0.7f, 0.8f, 0.9f, 1),
            new Color(0.4f, 0.7f, 0.4f, 1)
        },
        // Венера
        {
            new Color(1.0f, 0.9f, 0.3f, 1),
            new Color(1.0f, 0.7f, 0.2f, 1),
            new Color(1.0f, 1.0f, 0.8f, 1),
            new Color(0.9f, 0.6f, 0.1f, 1),
            new Color(0.8f, 0.9f, 1.0f, 1)
        }
    };
    
    // ==================== ЦВЕТА НАЗВАНИЙ ЗДАНИЙ ПО ПЛАНЕТАМ ====================
    public static final Color[][] GLOWING_NAME_COLORS_BY_PLANET = {
        // Земля
        {
            new Color(0.3f, 0.7f, 1.0f, 1),
            new Color(1.0f, 0.4f, 0.4f, 1),
            new Color(0.3f, 0.9f, 0.3f, 1),
            new Color(1.0f, 0.7f, 0.2f, 1),
            new Color(0.8f, 0.4f, 1.0f, 1)
        },
        // Марс
        {
            new Color(1.0f, 0.5f, 0.3f, 1),
            new Color(0.8f, 0.3f, 0.2f, 1),
            new Color(0.9f, 0.7f, 0.4f, 1),
            new Color(0.6f, 0.8f, 0.9f, 1),
            new Color(0.4f, 0.6f, 0.3f, 1)
        },
        // Венера
        {
            new Color(1.0f, 0.9f, 0.3f, 1),
            new Color(1.0f, 0.7f, 0.2f, 1),
            new Color(1.0f, 1.0f, 0.6f, 1),
            new Color(0.9f, 0.5f, 0.1f, 1),
            new Color(1.0f, 0.95f, 0.8f, 1)
        }
    };
    
    // ==================== ЦВЕТА ПЛАНЕТ ДЛЯ UI ====================
    public static Color getPlanetUIColor(Planet planet) {
        switch (planet) {
            case EARTH: return new Color(0.3f, 0.7f, 1.0f, 1);
            case MARS: return new Color(1.0f, 0.4f, 0.3f, 1);
            case VENUS: return new Color(1.0f, 0.8f, 0.3f, 1);
            default: return Color.WHITE;
        }
    }
    
    public static String getPlanetEmoji(Planet planet) {
        switch (planet) {
            case EARTH: return "🌍";
            case MARS: return "♂️";
            case VENUS: return "♀️";
            default: return "🪐";
        }
    }
}

