/**
 * Life Styles — Единый тёмный стиль для раздела "Жизнь"
 * Согласован с UI_DESIGN_GUIDE.md и inventory-ui.js
 *
 * Цветовая палитра:
 *   Фон основной:      #1e1e1e
 *   Фон панелей:       #252525 / #2a2a2a
 *   Границы:           #2a2a2a / #333333 / #3a3a3a
 *   Текст основной:    #f0f0f0
 *   Текст второстеп:   #888888 / #aaaaaa
 *   Текст тусклый:     #555555 / #666666
 *   Акцент золото:     #ff9800
 *   Акцент зелёный:    #4caf50
 *   Акцент красный:    #e74c3c / #f44336
 *   Акцент синий:      #4a90d9
 */

/* ===== Fullscreen Overlay (как в Инвентарь) ===== */
.life-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.92);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    color: #e0e0e0;
}

/* Верхняя панель overlay */
.life-overlay-header {
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    height: 56px;
}

/* Кнопки табов в верхней панели */
.life-overlay-tab {
    padding: 10px 22px;
    border: none;
    border-radius: 6px 6px 0 0;
    background: transparent;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}
.life-overlay-tab:hover {
    opacity: 0.85;
    color: #ccc;
}
.life-overlay-tab.active {
    background: #2a2a2a;
    color: #fff;
    font-weight: 600;
}

/* Кнопка закрытия overlay */
.life-overlay-close {
    background: none;
    border: none;
    color: #666;
    font-size: 22px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1;
}
.life-overlay-close:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.05) !important;
}

/* Контент overlay */
.life-overlay-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: #1e1e1e;
}

/* Скроллбар для overlay */
.life-overlay-content::-webkit-scrollbar {
    width: 6px;
}
.life-overlay-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}
.life-overlay-content::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 3px;
}
.life-overlay-content::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Нижняя панель overlay */
.life-overlay-footer {
    background: #1a1a1a;
    border-top: 1px solid #2a2a2a;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    font-size: 12px;
    color: #666;
}

/* Flex-контейнер для кнопок табов */
.life-overlay-tabs-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== Базовые стили life-контейнера (внутри overlay) ===== */
.life-container {
    padding: 0;
    max-width: 1100px;
    margin: 0 auto;
    color: #f0f0f0;
}

/* ===== Заголовок ===== */
.life-header {
    text-align: center;
    margin-bottom: 24px;
}
.life-header h2 {
    margin: 0 0 4px 0;
    font-size: 22px;
    font-weight: 600;
    color: #f0f0f0;
}
.life-header p {
    margin: 0;
    font-size: 13px;
    color: #888;
}

/* ===== Карточки (общие) ===== */
.life-card {
    background: #252525;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    transition: border-color 0.15s, background 0.15s;
}
.life-card:hover {
    border-color: #4a4a4a;
    background: #2a2a2a;
}

.life-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.life-card-header h3,
.life-card-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #f0f0f0;
}

/* ===== Hero-карточка (текущая работа/жильё) ===== */
.life-hero-card {
    background: #252525;
    border: 1px solid #ff9800;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.life-hero-icon {
    font-size: 40px;
    width: 56px;
    height: 56px;
    background: #2a2a2a;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.life-hero-info {
    flex: 1;
    min-width: 0;
}
.life-hero-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.life-hero-title {
    font-size: 18px;
    font-weight: 600;
    color: #f0f0f0;
}
.life-hero-sub {
    font-size: 13px;
    color: #aaa;
    margin-top: 2px;
}
.life-hero-value {
    font-size: 15px;
    font-weight: 600;
    color: #ff9800;
    margin-top: 4px;
}

/* ===== Сетки ===== */
.life-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.life-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}
.life-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

/* ===== Статус-блоки (энергия, здоровье) ===== */
.life-stat-block {
    background: #252525;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 14px;
    transition: border-color 0.15s;
}
.life-stat-block:hover {
    border-color: #4a4a4a;
}

.life-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.life-stat-label {
    font-size: 13px;
    color: #888;
}
.life-stat-value {
    font-size: 16px;
    font-weight: 600;
}

/* Прогресс-бар */
.life-progress-bar {
    height: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
}
.life-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.life-stat-details {
    font-size: 11px;
    color: #666;
    margin-top: 6px;
    line-height: 1.5;
}

/* ===== Кнопки ===== */
.life-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.life-btn:active {
    transform: scale(0.97);
}

.life-btn-primary {
    background: rgba(76, 175, 80, 0.12);
    border: 1px solid #4caf50;
    color: #4caf50;
}
.life-btn-primary:hover {
    background: rgba(76, 175, 80, 0.25);
}

.life-btn-gold {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid #ff9800;
    color: #ff9800;
}
.life-btn-gold:hover {
    background: rgba(255, 152, 0, 0.25);
}

.life-btn-danger {
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid #e74c3c;
    color: #e74c3c;
}
.life-btn-danger:hover {
    background: rgba(231, 76, 60, 0.25);
}

.life-btn-purple {
    background: rgba(124, 77, 255, 0.12);
    border: 1px solid #7c4dff;
    color: #7c4dff;
}
.life-btn-purple:hover {
    background: rgba(124, 77, 255, 0.25);
}

.life-btn-cyan {
    background: rgba(0, 188, 212, 0.12);
    border: 1px solid #00bcd4;
    color: #00bcd4;
}
.life-btn-cyan:hover {
    background: rgba(0, 188, 212, 0.25);
}

.life-btn-orange {
    background: rgba(255, 111, 0, 0.12);
    border: 1px solid #ff6f00;
    color: #ff6f00;
}
.life-btn-orange:hover {
    background: rgba(255, 111, 0, 0.25);
}

.life-btn-full {
    width: 100%;
    justify-content: center;
    padding: 10px 18px;
}

.life-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.life-btn:disabled,
.life-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== Ряд кнопок ===== */
.life-btn-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ===== Бейджи ===== */
.life-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.life-badge-green {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}
.life-badge-grey {
    background: #2a2a2a;
    color: #888;
}
.life-badge-gold {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
}

/* ===== Инфо-блок (требования, подсказки) ===== */
.life-info-block {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 8px;
}
.life-info-green {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}
.life-info-gold {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}
.life-info-red {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}
.life-info-blue {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}
.life-info-purple {
    background: rgba(124, 77, 255, 0.1);
    color: #7c4dff;
}

/* ===== Строка лота/опции ===== */
.life-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 14px;
    gap: 12px;
    transition: all 0.15s;
    cursor: default;
}
.life-option-row:hover {
    border-color: #4a4a4a;
    background: #2a2a2a;
}
.life-option-row.active {
    border-color: #ff9800;
    background: rgba(255, 152, 0, 0.05);
}

.life-option-icon {
    width: 40px;
    height: 40px;
    background: #2a2a2a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.life-option-info {
    flex: 1;
    min-width: 0;
}
.life-option-name {
    font-size: 14px;
    font-weight: 600;
    color: #f0f0f0;
}
.life-option-desc {
    font-size: 11px;
    color: #888;
    margin-top: 1px;
}
.life-option-cost {
    font-size: 13px;
    font-weight: 600;
    color: #ff9800;
    white-space: nowrap;
}
.life-option-cost.green {
    color: #4caf50;
}

/* ===== Секция с подзаголовком ===== */
.life-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #f0f0f0;
    margin: 0 0 14px 0;
}

/* ===== Таблица статистики ===== */
.life-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}
.life-stat-item {
    padding: 10px;
    background: #2a2a2a;
    border-radius: 8px;
}
.life-stat-item-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 2px;
}
.life-stat-item-value {
    font-size: 15px;
    font-weight: 600;
    color: #f0f0f0;
}

/* ===== Gig card ===== */
.life-gig-card {
    border: 1px solid #333;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    background: #252525;
    transition: all 0.15s;
}
.life-gig-card:hover {
    border-color: #4a4a4a;
    background: #2a2a2a;
}
.life-gig-card.locked {
    opacity: 0.6;
    border-color: #e74c3c;
}
.life-gig-icon {
    font-size: 28px;
    margin-bottom: 6px;
}
.life-gig-name {
    font-weight: 600;
    font-size: 13px;
    color: #f0f0f0;
    margin-bottom: 4px;
}
.life-gig-rate {
    font-size: 13px;
    color: #4caf50;
    font-weight: 600;
    margin-bottom: 4px;
}
.life-gig-desc {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}
.life-gig-stats {
    font-size: 10px;
    color: #666;
    margin-bottom: 8px;
}

/* ===== Активная подработка ===== */
.life-gig-active {
    background: rgba(76, 175, 80, 0.08);
    border: 1px solid #4caf50;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}

/* ===== LVL секция ===== */
.life-lvl-section {
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
    color: #e0e0f0;
}

/* ===== История работы ===== */
.life-history-item {
    padding: 10px;
    background: #2a2a2a;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

/* ===== Empty state ===== */
.life-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 14px;
}
.life-empty-icon {
    font-size: 48px;
    opacity: 0.4;
}
.life-empty-title {
    font-size: 18px;
    color: #888;
    font-weight: 500;
}
.life-empty-desc {
    font-size: 13px;
    color: #555;
    max-width: 320px;
    text-align: center;
    line-height: 1.5;
}

/* ===== Скроллбар ===== */
.life-scroll::-webkit-scrollbar {
    width: 6px;
}
.life-scroll::-webkit-scrollbar-track {
    background: #1a1a1a;
}
.life-scroll::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 3px;
}
.life-scroll::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* ===== Анимации ===== */
@keyframes lifeFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.life-anim-in {
    animation: lifeFadeIn 0.25s ease;
}

/* ===== Адаптивность ===== */
@media (max-width: 768px) {
    .life-container {
        padding: 14px 16px;
    }
    .life-grid-2 {
        grid-template-columns: 1fr;
    }
    .life-hero-card {
        flex-direction: column;
        text-align: center;
    }
    .life-btn-row {
        flex-direction: column;
    }
    .life-btn-row .life-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Статистика (Stats tab) ===== */
.life-stats-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.life-stats-hero-item {
    background: #252525;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color 0.15s;
}
.life-stats-hero-item:hover {
    border-color: #4a4a4a;
}
.life-stats-hero-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.life-stats-hero-value {
    font-size: 20px;
    font-weight: 700;
    color: #f0f0f0;
}

.life-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}
.life-stats-row-label {
    color: #888;
}
.life-stats-row-value {
    color: #f0f0f0;
    font-weight: 600;
    text-align: right;
}

.life-stats-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.life-stats-table-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    color: #aaa;
}