/* Forge tab styles - centered visual design */

/* Слоты выбора предмета */
.forge-slots {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    margin-bottom: 5px;
}

.forge-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.08);
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 90px;
}

.forge-slot:hover {
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.05);
}

.forge-slot.active {
    border-color: rgba(251, 191, 36, 0.6);
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.15);
}

.forge-slot-icon {
    font-size: 28px;
    filter: grayscale(0.5);
    transition: filter 0.25s;
}

.forge-slot.active .forge-slot-icon {
    filter: none;
}

.forge-slot-label {
    font-size: 12px;
    font-weight: 700;
}

.forge-slot-meta {
    display: none;
}

/* Центральная зона */
.forge-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Карточка предмета */
.forge-item-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.9));
    border: 2px solid rgba(192, 132, 252, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 280px;
}

.forge-item-glow {
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.2), rgba(251, 191, 36, 0.1));
    filter: blur(8px);
    z-index: -1;
    opacity: 0.6;
    animation: forgeGlow 3s ease-in-out infinite alternate;
}

@keyframes forgeGlow {
    0% {
        opacity: 0.4;
    }

    100% {
        opacity: 0.7;
    }
}

.forge-item-icon {
    font-size: 36px;
}

.forge-item-info {
    flex: 1;
}

.forge-item-name {
    font-weight: 800;
    font-size: 16px;
    color: #f3f4f6;
    margin-bottom: 4px;
}

.forge-item-rarity {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forge-item-rarity.epic {
    background: rgba(192, 132, 252, 0.2);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.4);
}

.forge-item-rarity.rare {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.4);
}

.forge-item-rarity.legendary {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.forge-item-level {
    font-size: 28px;
    font-weight: 900;
    color: #fbbf24;
    text-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

.forge-item-level.awakened {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: unset;
    text-shadow: none;
}

/* Круговой индикатор шанса */
.forge-chance-ring {
    position: relative;
    width: 140px;
    height: 140px;
}

.forge-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.forge-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 10;
}

.forge-ring-fill {
    fill: none;
    stroke: #fbbf24;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.forge-ring-fill.good {
    stroke: #22c55e;
}

.forge-ring-fill.medium {
    stroke: #fbbf24;
}

.forge-ring-fill.bad {
    stroke: #ef4444;
}

.forge-ring-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.forge-ring-percent {
    font-size: 32px;
    font-weight: 900;
    color: #f3f4f6;
}

.forge-ring-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.forge-chance-text {
    text-align: center;
    color: #cbd5e1;
    line-height: 1.3;
}

.forge-chance-total {
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.forge-chance-formula {
    font-size: 12px;
    color: #9ca3af;
}

/* Модификаторы */
.forge-mods {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.forge-mod {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: #e5e7eb;
}

.forge-mod.negative {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
}

.forge-mod.positive {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.08);
    color: #86efac;
}

.forge-mod-icon {
    font-size: 14px;
}

.forge-mod-text {
    font-weight: 600;
}

/* Бонусы заточки */
.forge-bonus-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.forge-bonus-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.forge-bonus-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forge-bonus-val {
    font-size: 15px;
    font-weight: 800;
    color: #fbbf24;
}

.forge-bonus-val.awakened {
    background: linear-gradient(135deg, #fbbf24, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.forge-bonus-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
}

/* Прочность */
.forge-durability {
    padding: 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.forge-dur-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #e5e7eb;
}

.forge-dur-val {
    font-weight: 700;
    color: #fbbf24;
}

.forge-dur-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.forge-dur-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #84cc16);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.forge-dur-hint {
    margin-top: 8px;
    font-size: 11px;
    color: #6b7280;
    text-align: center;
}

.forge-dur-hint.warn {
    color: #fbbf24;
}

/* Кнопка заточки */
.forge-action {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.forge-enhance-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: none;
    color: #1f2937;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.3);
}

.forge-enhance-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(251, 191, 36, 0.4);
}

.forge-enhance-btn:active:not(:disabled) {
    transform: translateY(0);
}

.forge-enhance-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

.forge-enhance-icon {
    font-size: 22px;
}

.forge-enhance-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.forge-enhance-text small {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.8;
}

.forge-item-status.positive {
    color: #bef264;
}

.forge-overheat-line {
    color: #fbbf24;
}

.forge-overheat-line.muted {
    color: #94a3b8;
}

.forge-action-hint {
    color: #9ca3af;
}

.forge-action-hint.alert {
    color: #f87171;
}

.forge-action-hint.positive {
    color: #bef264;
}

.forge-ring-content.flash-success,
.forge-item-card.flash-success {
    animation: forgeFlashSuccess 0.8s ease;
}

.forge-ring-content.flash-fail,
.forge-item-card.flash-fail {
    animation: forgeFlashFail 0.8s ease;
}

.forge-ring-content.shake,
.forge-item-card.shake {
    animation: forgeShake 0.35s ease;
}

.forge-toast {
    position: fixed;
    transform: translateX(-50%);
    padding: 10px 16px;
    color: #fff;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    z-index: 9999;
    opacity: 0;
    animation: forgeToastAnim 2.2s ease forwards;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.forge-toast.success {
    background: rgba(34, 197, 94, 0.92);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 16px rgba(34, 197, 94, 0.5);
}

.forge-toast.fail {
    background: rgba(239, 68, 68, 0.92);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 16px rgba(239, 68, 68, 0.5);
}

@keyframes forgeFlashSuccess {
    0% {
        box-shadow: 0 0 0 rgba(34, 197, 94, 0.0);
        transform: scale(1);
    }

    40% {
        box-shadow: 0 0 24px rgba(34, 197, 94, 0.35);
        transform: scale(1.04);
    }

    100% {
        box-shadow: 0 0 0 rgba(34, 197, 94, 0.0);
        transform: scale(1);
    }
}

@keyframes forgeFlashFail {
    0% {
        box-shadow: 0 0 0 rgba(239, 68, 68, 0.0);
        transform: scale(1);
    }

    40% {
        box-shadow: 0 0 24px rgba(239, 68, 68, 0.35);
        transform: scale(1.04);
    }

    100% {
        box-shadow: 0 0 0 rgba(239, 68, 68, 0.0);
        transform: scale(1);
    }
}

@keyframes forgeShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-4px);
    }

    40% {
        transform: translateX(4px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(3px);
    }
}

@keyframes forgeToastAnim {
    0% {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    85% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -14px);
    }
}

@media (max-width: 540px) {
    .forge-action {
        padding-bottom: 8px;
    }

    .forge-center {
        gap: 14px;
    }

    .forge-slots {
        gap: 4px;
    }

    .forge-slot {
        padding: 10px 12px;
    }
}

/* Сворачиваемая таблица */
.forge-details {
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.forge-summary {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 14px;
    color: #e5e7eb;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.forge-summary::after {
    content: '▼';
    font-size: 10px;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.forge-details[open] .forge-summary::after {
    transform: rotate(180deg);
}

.forge-summary::-webkit-details-marker {
    display: none;
}

.forge-table {
    padding: 0 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.forge-table-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
    color: #e5e7eb;
}

.forge-table-row span:last-child {
    font-weight: 700;
    color: #fbbf24;
}

/* Generic in-dev card kept for other tabs */
.in-dev-card {
    width: 100%;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: radial-gradient(circle at 20% 20%, rgba(251, 191, 36, 0.08), transparent 40%),
        radial-gradient(circle at 80% 0%, rgba(249, 115, 22, 0.08), transparent 35%),
        rgba(17, 24, 39, 0.75);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* Forge item selection modal */
.forge-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.forge-modal-content {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(31, 41, 55, 0.95) 100%);
    border-radius: 16px;
    padding: 24px;
    max-width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.2), 0 20px 50px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.forge-modal-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 16px;
    color: #fbbf24;
}

.forge-item-select {
    padding: 14px;
    margin: 10px 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s ease;
}

.forge-item-select:hover {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.05);
}

.forge-item-select.selected {
    border-color: rgba(74, 222, 128, 0.6);
    background: rgba(74, 222, 128, 0.1);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.15);
}

.forge-item-select-info {
    flex: 1;
}

.forge-item-select-name {
    font-weight: bold;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.forge-item-select-meta {
    font-size: 12px;
    color: #9ca3af;
}

.forge-item-card--empty {
    opacity: 0.7;
    cursor: pointer;
}

.forge-item-card--empty:hover {
    opacity: 0.9;
    transition: opacity 0.25s ease;
}