/* ===== ЛАБОРАТОРИЯ ===== */

/* Кнопка лаборатории */
#lab-btn {
    position: fixed;
    top: 56%;
    right: 10px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00C853, #64DD17);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    z-index: 99;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 1px 5px 5px #000;
    overflow: hidden;
    animation: gentleSwing 3s ease-in-out infinite;
}

#lab-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 200, 83, 0.6);
}

#lab-btn:active {
    transform: scale(0.95);
}

/* Блик для кнопки лаборатории */
#lab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: verticalShine 2s ease-in-out infinite 0.5s;
    border-radius: 5%;
}
@keyframes verticalShine {
    0% {
        transform: translateY(200%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(0);
        opacity: 0;
    }
}

@keyframes labPulse {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
    }
    50% {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 6px 20px rgba(0, 200, 83, 0.8);
    }
}

/* Вкладки лаборатории */
.lab-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    justify-content: center;
}

.lab-tab {
    padding: 12px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: bold;
    color: var(--text-light);
    text-align: center;
    flex: 1;
    max-width: 150px;
}

.lab-tab:hover {
    color: var(--primary);
    background-color: rgba(52, 152, 219, 0.1);
}

.lab-tab.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    background-color: rgba(52, 152, 219, 0.05);
}

.lab-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.lab-tab-content.active {
    display: block;
}

/* Карточка рецепта */
.recipe-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #4CAF50;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recipe-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.recipe-icon {
    font-size: 40px;
    margin-right: 15px;
    background: linear-gradient(135deg, #FFD700, #FF9800);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gentleSwing 3s ease-in-out infinite;
}

.recipe-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text);
    flex: 1;
}

.recipe-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 9px;
}

.recipe-status.available {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
}

.recipe-description {
    color: var(--text-light);
    margin-bottom: 20px;
    text-align: center;
    font-style: italic;
    padding: 10px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
}

/* Ингредиенты */
.ingredients-section {
    margin-bottom: 20px;
}

.ingredients-section h4 {
    color: var(--text);
    margin-bottom: 10px;
    text-align: center;
}

.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 10px;
}

.ingredient-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.ingredient-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.ingredient-icon {
    font-size: 24px;
    margin-right: 10px;
}

.ingredient-info {
    flex: 1;
}

.ingredient-name {
    font-weight: bold;
    font-size: 14px;
    color: var(--text);
}

.ingredient-amount {
    font-size: 12px;
    color: var(--text-light);
}

.ingredient-amount .current {
    color: #4CAF50;
    font-weight: bold;
}

.ingredient-amount .required {
    color: #757575;
}

.ingredient-check {
    font-size: 16px;
    color: #4CAF50;
}

/* Стоимость создания */
.crafting-cost {
    margin-bottom: 20px;
    display: flex;
}

.crafting-cost h4 {
    color: var(--text);
    margin-bottom: 10px;
    text-align: center;
    font-size: 14px;
}

.cost-grid {
    display: flex;
    align-items: center;
    gap: 2px;
}

.cost-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 16px;
}
.cost-icon {
    margin-right: 8px;
    font-size: 18px;
}

/* Шанс успеха */
.success-chance {
    margin-bottom: 25px;
}

.success-chance h4 {
    color: var(--text);
    margin-bottom: 10px;
    text-align: center;
}

.chance-value {
    color: #FF9800;
    font-weight: bold;
}

.chance-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.chance-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF9800, #FFC107);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.chance-hint {
    font-size: 12px;
    color: var(--warning);
    text-align: center;
    font-style: italic;
}

/* Кнопка создания */
.craft-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.craft-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.4);
}

.craft-btn:active {
    transform: translateY(0);
}

.craft-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Сетка рецептов */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.recipe-card-small {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.recipe-card-small:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.recipe-card-small.learned {
    border-color: #4CAF50;
}

.recipe-card-small.locked {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.recipe-card-small.available {
    border-color: #FF9800;
    animation: pulseAvailable 2s infinite;
}

@keyframes pulseAvailable {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 152, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 152, 0, 0.6);
    }
}

.recipe-icon-small {
    font-size: 30px;
    margin-bottom: 8px;
}

.recipe-name-small {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--text);
}

.recipe-source {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.recipe-status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
}

.recipe-status-badge.learned {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
}

.recipe-status-badge.locked {
    background: linear-gradient(135deg, #9e9e9e, #757575);
    color: white;
}

.recipe-status-badge.available {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

/* Активные эффекты */
.no-effects {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.no-effects-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-effects-text {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.no-effects-hint {
    font-size: 14px;
    color: var(--text-light);
}

.active-effect-card {
    background: linear-gradient(135deg, #E8F5E8, #C8E6C9);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #4CAF50;
    margin-top: 20px;
    animation: subtleGlow 2s ease-in-out infinite;
}

@keyframes subtleGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(76, 175, 80, 0.6);
    }
}

.effect-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.effect-icon {
    font-size: 36px;
    margin-right: 15px;
    animation: gentleSwing 3s ease-in-out infinite;
}

.effect-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text);
    flex: 1;
}

.effect-description {
    color: var(--text);
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.effect-timer {
    text-align: center;
    margin-bottom: 20px;
}

.timer-label {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.timer-value {
    font-size: 28px;
    font-weight: bold;
    color: #FF9800;
    margin-bottom: 10px;
    font-family: monospace;
}

.progress-bar-container {
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 1s linear;
}

.progress-text {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

.effect-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.stat-item {
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    display: block;
    margin-bottom: 3px;
}

.stat-value {
    font-weight: bold;
    color: var(--text);
    font-size: 14px;
}

/* Индикатор активного эликсира на главном экране */
.elixir-indicator {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    font-size: 14px;
    font-weight: bold;
    margin-left: 5px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: indicatorPulse 2s infinite;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    top: auto;
    left: auto;
}

.elixir-indicator.speed {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.elixir-indicator.luck {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.elixir-indicator.selection {
    background: linear-gradient(135deg, #fe4f4f 0%, #fe0000 100%);
}

.elixir-indicator.growth {
    background: linear-gradient(135deg, #e9e943 0%, #e6f938 100%);
}

.elixir-indicator:hover {
    transform: scale(1.1);
}

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

/* Свечение шкалы опыта при активном эликсире */
.elixir-active .progress-bar .progress {
    animation: elixirGlow 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
}

@keyframes elixirGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(76, 175, 80, 1);
    }
}

/* Линия заголовка лаборатории */
#lab-modal .modal-title::after {
    background: linear-gradient(90deg, 
        transparent 0%,
        #00C853 30%,      /* Ярко-зеленый */
        #64DD17 50%,      /* Светло-зеленый */
        #00C853 70%,      /* Ярко-зеленый */
        transparent 100%);
    box-shadow: 0 2px 10px rgba(0, 200, 83, 0.3);
}

/* Анимация создания эликсира */
.elixir-crafting-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 200px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.9s ease;
}

.elixir-bubbles {
    position: relative;
    width: 150px;
    height: 150px;
}

.bubble {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: bubbleRise 2s ease-in-out infinite;
    bottom: 0;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(50px) scale(0.5);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) scale(1);
        opacity: 0;
    }
}
#expedition-elexir {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    position: absolute;
    z-index: 5;
    top: 90px;
    width: 85%;
    justify-content: space-between;
}
/* Контейнер для иконок в level-info */
.level-info {
    display: flex;
    align-items: center;
    gap: 1px;
    flex-wrap: wrap;
    position: relative;
    min-width: 30px;
}

/* Чтобы иконки не накладывались друг на друга */
.elixir-indicator + .elixir-indicator {
    margin-left: 5px;
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .elixir-indicator {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}