/* ============================================
   СОВРЕМЕННОЕ МЕНЮ ХАРАКТЕРИСТИК
   Био-дизайн в стиле меню навыков
   ============================================ */

/* Основной контейнер */
.stat-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Главное окно */
.stat-modern-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #00ff88;
    border-radius: 0;
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.3),
                inset 0 0 60px rgba(0, 255, 136, 0.05);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes slideIn {
    from {
        transform: scale(0.8) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Заголовок - как в skeleton v2 */
.stat-modern-header {
    padding: 12px 30px;
    border-bottom: 2px solid rgba(0, 255, 136, 0.3);
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.stat-modern-title {
    font-size: 26px;
    font-weight: 700;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    letter-spacing: 2px;
}

.stat-modern-title-icon {
    font-size: 28px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Навигация между меню - используется общий файл menu-navigation.css */

/* Скрываем автоматическую кнопку закрытия от UI */
.stat-modern .close-menu-btn {
    display: none !important;
}

/* Кнопка закрытия - как в skeleton v2 */
.stat-close-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 107, 107, 0.2);
    border: 2px solid #ff6b6b;
    color: #ff6b6b;
    font-size: 24px;
    font-weight: 700;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.stat-close-btn:hover {
    background: rgba(255, 107, 107, 0.4);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    transform: scale(1.1);
}

.stat-close-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

/* Подзаголовок со статистикой */
.stat-modern-subheader {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    background: rgba(0, 255, 136, 0.05);
}

.stat-modern-stats {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.stat-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.stat-stat-icon {
    font-size: 18px;
}

.stat-stat-value {
    color: #00ff88;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.stat-points-highlight {
    background: rgba(0, 255, 136, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Контент с прокруткой */
.stat-modern-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Основные характеристики (HP, EP, IQ) */
.stat-modern-primary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-primary-card {
    background: rgba(0, 255, 136, 0.05);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-primary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-primary-card:hover::before {
    left: 100%;
}

.stat-primary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 255, 136, 0.3);
    border-color: #00ff88;
}

.stat-primary-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-primary-icon img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.5));
}

.stat-primary-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-primary-label {
    color: rgba(0, 255, 136, 0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-primary-value {
    color: #00ff88;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* Очки характеристик */
.stat-modern-points {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 255, 136, 0.05));
    border: 2px solid rgba(0, 255, 136, 0.4);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-points-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    font-weight: 300;
}

.stat-points-value {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    color: #000;
    font-size: 28px;
    font-weight: bold;
    padding: 10px 25px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    min-width: 70px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-points-value.pulse {
    animation: points-pulse 0.5s ease;
}

@keyframes points-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
    }
}

/* Списки характеристик */
.stat-modern-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.stat-modern-list {
    background: rgba(0, 255, 136, 0.03);
    border: 2px solid rgba(0, 255, 136, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

/* Заголовки категорий */
.stat-category-header {
    padding: 15px 20px;
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 255, 136, 0.05) 100%);
    border-bottom: 2px solid rgba(0, 255, 136, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-category-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.5));
}

.stat-category-title {
    font-size: 16px;
    font-weight: 700;
    color: #00ff88;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex: 1;
}

.stat-category-count {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 136, 0.4);
}

/* Цветовая дифференциация категорий */
.stat-modern-list.resistance {
    border-color: rgba(100, 150, 255, 0.3);
}

.stat-modern-list.resistance .stat-category-header {
    background: linear-gradient(90deg, rgba(100, 150, 255, 0.15) 0%, rgba(100, 150, 255, 0.05) 100%);
    border-bottom-color: rgba(100, 150, 255, 0.3);
}

.stat-modern-list.resistance .stat-category-icon {
    filter: drop-shadow(0 0 8px rgba(100, 150, 255, 0.5));
}

.stat-modern-list.resistance .stat-category-title {
    color: #6496ff;
}

.stat-modern-list.resistance .stat-category-count {
    background: rgba(100, 150, 255, 0.2);
    color: #6496ff;
    border-color: rgba(100, 150, 255, 0.4);
}

/* Элементы характеристик */
.stat-modern-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.stat-modern-item:last-child {
    border-bottom: none;
}

.stat-modern-item:hover {
    background: rgba(0, 255, 136, 0.08);
    transform: translateX(3px);
}

.stat-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    flex-shrink: 0;
}

.stat-item-icon img {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 0 4px rgba(0, 255, 136, 0.5));
}

.stat-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.stat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.stat-item-name {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-weight: 600;
}

.stat-item-value {
    color: #00ff88;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
    white-space: nowrap;
}

/* Прогресс характеристики */
.stat-item-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 136, 0.3);
    position: relative;
}

.stat-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00cc70 0%, #00ff88 100%);
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    position: relative;
}

.stat-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* Цвета прогресс-бара в зависимости от уровня */
.stat-progress-bar.medium {
    border-color: rgba(255, 193, 7, 0.4);
}

.stat-progress-bar.medium .stat-progress-fill {
    background: linear-gradient(90deg, #cc9700 0%, #ffc107 100%);
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.stat-progress-bar.high {
    border-color: rgba(255, 87, 34, 0.5);
}

.stat-progress-bar.high .stat-progress-fill {
    background: linear-gradient(90deg, #cc4500 0%, #ff5722 100%);
    box-shadow: 0 0 10px rgba(255, 87, 34, 0.6);
    animation: progress-pulse 2s infinite;
}

@keyframes progress-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 87, 34, 0.6);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 87, 34, 0.9);
    }
}

.stat-progress-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

.stat-item-value.updating {
    animation: value-update 0.5s ease;
}

.stat-item-value.updated {
    animation: value-flash 0.5s ease;
}

@keyframes value-update {
    0%, 100% {
        transform: scale(1);
        color: #00ff88;
    }
    50% {
        transform: scale(1.2);
        color: #00ffff;
    }
}

@keyframes value-flash {
    0%, 100% {
        color: #00ff88;
    }
    50% {
        color: #00ffff;
    }
}

/* Анимация при прокачке характеристики */
.stat-modern-item.stat-upgraded {
    animation: stat-upgrade-flash 0.6s ease;
}

@keyframes stat-upgrade-flash {
    0% {
        background: rgba(0, 255, 136, 0.08);
        transform: translateX(0);
    }
    25% {
        background: rgba(0, 255, 136, 0.2);
        transform: translateX(5px);
    }
    50% {
        background: rgba(0, 255, 136, 0.25);
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
    }
    75% {
        background: rgba(0, 255, 136, 0.15);
        transform: translateX(3px);
    }
    100% {
        background: transparent;
        transform: translateX(0);
    }
}

.stat-progress-text.updated {
    animation: text-glow 0.5s ease;
}

@keyframes text-glow {
    0%, 100% {
        color: rgba(255, 255, 255, 0.6);
    }
    50% {
        color: #00ff88;
        text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
    }
}

/* Контролы */
.stat-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.stat-item-controls.hidden {
    display: none;
}

.stat-item-input {
    width: 65px;
    height: 38px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    color: #00ff88;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    padding: 0 8px;
    transition: all 0.3s ease;
    outline: none;
}

.stat-item-input:focus {
    border-color: #00ff88;
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.stat-item-input:hover {
    border-color: rgba(0, 255, 136, 0.5);
}

.stat-item-input::-webkit-inner-spin-button,
.stat-item-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stat-item-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

.stat-item-button {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
    flex-shrink: 0;
}

.stat-item-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.6);
}

.stat-item-button:active {
    transform: scale(0.95);
}

.stat-item-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.stat-item-button.loading {
    animation: button-loading 1s ease infinite;
}

@keyframes button-loading {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
    }
}

/* Предупреждения */
.stat-modern-item.warning-medium {
    border-left: 3px solid rgba(255, 193, 7, 0.6);
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.08), transparent);
}

.stat-modern-item.warning-high {
    border-left: 3px solid rgba(255, 87, 34, 0.8);
    background: linear-gradient(90deg, rgba(255, 87, 34, 0.12), transparent);
    animation: warning-pulse 2s ease-in-out infinite;
}

@keyframes warning-pulse {
    0%, 100% {
        box-shadow: inset 0 0 5px rgba(255, 87, 34, 0.3);
    }
    50% {
        box-shadow: inset 0 0 15px rgba(255, 87, 34, 0.6);
    }
}

/* Туториал */
.stat-modern-item.tutorial-highlight {
    animation: tutorial-glow 1.5s ease-in-out infinite;
}

@keyframes tutorial-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.8), 0 0 30px rgba(0, 255, 136, 0.4);
    }
}

.tutorial-arrow {
    position: absolute;
    right: -50px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    z-index: 100;
}

/* Скроллбар */
.stat-modern-content::-webkit-scrollbar {
    width: 8px;
}

.stat-modern-content::-webkit-scrollbar-track {
    background: rgba(0, 255, 136, 0.05);
}

.stat-modern-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 4px;
}

.stat-modern-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media screen and (max-width: 1024px) {
    .stat-modern-lists {
        grid-template-columns: 1fr;
    }

    .stat-modern-primary {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media screen and (max-width: 768px) {
    .stat-modern-header {
        flex-wrap: wrap;
        padding: 12px 15px;
        gap: 10px;
    }

    .stat-modern-title {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .stat-close-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .stat-menu-navigation {
        order: 3;
    }

    .stat-modern-subheader {
        padding: 10px 15px;
    }

    .stat-modern-stats {
        gap: 15px;
        font-size: 13px;
    }

    .stat-modern-primary {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-primary-card {
        padding: 15px;
    }

    .stat-primary-icon {
        width: 32px;
        height: 32px;
    }

    .stat-primary-value {
        font-size: 20px;
    }

    .stat-modern-points {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }

    .stat-points-value {
        font-size: 24px;
        padding: 8px 20px;
    }

    .stat-modern-lists {
        gap: 15px;
    }

    .stat-category-header {
        padding: 12px 15px;
    }

    .stat-category-icon {
        font-size: 20px;
    }

    .stat-category-title {
        font-size: 14px;
    }

    .stat-modern-item {
        padding: 12px 15px;
        gap: 12px;
    }

    .stat-item-icon {
        width: 32px;
        height: 32px;
    }

    .stat-item-icon img {
        width: 22px;
        height: 22px;
    }

    .stat-item-name {
        font-size: 14px;
    }

    .stat-item-value {
        font-size: 15px;
    }

    .stat-progress-bar {
        height: 6px;
    }

    .stat-progress-text {
        font-size: 11px;
        min-width: 60px;
    }

    .stat-item-input {
        width: 55px;
        height: 36px;
        font-size: 14px;
    }

    .stat-item-button {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .tutorial-arrow {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .stat-modern-title {
        font-size: 18px;
    }

    .stat-close-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .stat-modern-item {
        flex-wrap: wrap;
    }

    .stat-item-controls {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .stat-item-button {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }

    .stat-item-input {
        height: 44px;
    }
}
