/* style.css */

/* Базовые настройки */
body {
    margin: 0;
    background: #231F20;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    text-align: center;
    padding: 0;
    border: 0;
}

/* Прелоадер */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #231F20 url('loading-bg.jpg') no-repeat center center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.progress-container {
    position: absolute;
    bottom: 80px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader-text {
    color: white;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 10px;
    max-width: 300px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.progress {
    height: 100%;
    background: #4CAF50;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.bottom-notice {
    position: absolute;
    bottom: 30px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
    text-align: center;
    width: 100%;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.bottom-notice a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
}

.bottom-notice a:hover {
    text-decoration: underline;
}

.version-info {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
}

/* Модальное окно ошибки */
.error-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.error-modal.active {
    display: flex;
}

.error-modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.error-modal-header {
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: #d32f2f;
    margin-bottom: 15px;
    text-align: center;
}

.error-modal-body {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    max-height: 50vh;
}

.error-text {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #333;
    white-space: pre-wrap;
    word-break: break-all;
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
    line-height: 1.4;
}

.error-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    min-width: 140px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.error-btn:active {
    transform: scale(0.98);
}

.copy-btn {
    background: #4CAF50;
    color: white;
}
.copy-btn:hover {
    background: #45a049;
}

.close-btn {
    background: #f44336;
    color: white;
}
.close-btn:hover {
    background: #d32f2f;
}

.refresh-btn {
    background: #2196F3;
    color: white;
}
.refresh-btn:hover {
    background: #1976D2;
}

/* Уведомление о копировании */
.copy-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.copy-notification.active {
    opacity: 1;
}

/* Дополнительные стили для адаптивности */
canvas, body {
    touch-action: none;
    overscroll-behavior: none;
}

/* Если на странице есть канвас (в билдах), то канвас занимает весь экран */
#unity-canvas {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: #231F20;
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 360px) {
    .loader-text {
        font-size: 14px;
        max-width: 260px;
    }
    .progress-bar {
        width: 160px;
    }
    .error-modal-content {
        width: 95%;
        padding: 15px;
    }
    .error-btn {
        min-width: 120px;
        font-size: 13px;
    }
}