/* Main CSS file - основной файл стилей
-------------------------------------------------- */

/* Импорт переменных и базовых стилей */
@import url('variables.css');
@import url('themes.css');
@import url('normalize.css');
@import url('grid.css');
@import url('utilities.css');

/* Импорт компонентных стилей */
@import url('components/modal.css');
@import url('components/action-bar.css');
@import url('components/combat.css');
@import url('components/skill-system.css');
@import url('components/skill-system.css');
@import url('components/character.css');
@import url('components/inventory.css');
@import url('components/chat.css');

/* Импорт стилей минилокаций */
@import url('minilocations/home-location.css');
@import url('minilocations/home-storage.css');
@import url('minilocations/clan-base.css');

/* Основные контейнеры */
#app-container {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

#content-container {
    height: 110vh;
    width: 100%;
    overflow: auto;
    padding-bottom: var(--footer-height);
}

/* WebSocket Connection Status */
.connection-status {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: default;
    transition: var(--transition-normal);
}

.connection-status.connected {
    color: var(--success-color);
}

.connection-status.disconnected {
    color: var(--error-color);
    animation: pulse 1.5s infinite;
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    background-color: var(--surface-color);
    border-radius: var(--border-radius-medium);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    z-index: var(--z-index-notification);
    transform: translateX(400px);
    opacity: 0;
    transition: var(--transition-normal);
}

.notification-visible {
    transform: translateX(0);
    opacity: 1;
}

.notification-header {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    font-weight: bold;
}

.notification-body {
    padding: 15px;
}

.notification-info {
    border-left: 4px solid var(--info-color);
}

.notification-success {
    border-left: 4px solid var(--success-color);
}

.notification-warning {
    border-left: 4px solid var(--warning-color);
}

.notification-error {
    border-left: 4px solid var(--error-color);
}

.notification-close {
    background: none;
    border: none;
    color: var(--on-surface);
    cursor: pointer;
    font-size: 18px;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Утилиты для анимаций */
.fade-in {
    animation: fadeIn var(--transition-normal) forwards;
}

.fade-out {
    animation: fadeOut var(--transition-normal) forwards;
}

/* Общие элементы интерфейса */
.loader {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Игровой мир */
.game-world {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.game-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -1;
}

/* Переключатель темы */
.theme-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: var(--z-index-modal);
    box-shadow: var(--shadow-small);
    transition: var(--transition-fast);
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 18px;
    color: var(--on-surface);
}

body.theme-light .theme-toggle .fa-sun {
    display: none;
}

body.theme-light .theme-toggle .fa-moon {
    display: inline-block;
}

body:not(.theme-light) .theme-toggle .fa-sun {
    display: inline-block;
}

body:not(.theme-light) .theme-toggle .fa-moon {
    display: none;
}

/* Кнопка "Зайти домой" в блоке локации */
.location-action-button {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--on-primary);
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.location-action-button:hover {
    background-color: var(--primary-color-hover);
    transform: translateY(-1px);
}

.location-action-button .button-icon {
    font-size: 16px;
}

.location-action-button .button-text {
    font-weight: 500;
}

/* Обскуренные мини-локации (недостаточно сумеречного зрения) */
.location-action-button.mini-loc-obscured {
    filter: blur(1.5px);
    opacity: 0.6;
}
.location-action-button.mini-loc-obscured .button-text {
    display: none;
}

/* Скрытые игроки (недостаточно сумеречного зрения) */
.entity-item.entity-obscured {
    filter: blur(1.5px);
    opacity: 0.6;
    pointer-events: auto; /* оставляем для показа сообщения */
}
