.chest-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.chest-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.chest-card:hover {
    transform: translateY(-5px);
}

.chest-header {
    padding: 1rem;
    background: linear-gradient(135deg, #2c2c2c 0%, #595959 50%,rgb(114, 112, 112) 100%);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.monster-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.monster-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.monster-image:hover {
    transform: scale(1.1);
}

.monster-details {
    display: flex;
    flex-direction: column;
}

.monster-name {
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    margin-bottom: 0.2rem;
    transition: color 0.3s;
}

.monster-name:hover {
    color: #ecf0f1;
    text-decoration: none;
}

.monster-id {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.toggle-button {
    background: none;
    border: none;
    color: white;
    padding: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.toggle-button:hover {
    transform: scale(1.1);
}

.toggle-button i {
    transition: transform 0.3s;
}

.toggle-button.active i {
    transform: rotate(180deg);
}

.items-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.items-list.active {
    max-height: 2000px;
}

.item-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: transparent;
    transition: all 0.3s ease;
}

.item-row:hover {
    background: rgba(52, 152, 219, 0.05);
    transform: translateX(10px);
}

.item-image-container {
    margin-right: 1.5rem;
    position: relative;
}

.item-image {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.item-details {
    flex: 1;
}

.item-name {
    color: #2c3e50;
    font-weight: 500;
    font-size: 1.1rem;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    margin-bottom: 0.5rem;
}

.item-name:hover {
    color: #3498db;
    text-decoration: none;
}

.chance-container {
    background: rgba(0, 0, 0, 0.02);
    padding: 0.8rem;
    border-radius: 10px;
}

.chance-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.5rem;
}

.chance-fill {
    position: absolute;
    height: 100%;
    left: 0;
    top: 0;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden; /* Важно! Ограничиваем блик заполненной частью */
}        

.rarity-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

.rarity-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.8rem;
    color: black;
    transition: all 0.3s ease;
}

.dark-theme .rarity-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.8rem;
    color: white;
    transition: all 0.3s ease;
}

/* Progress Bar Colors */
.rarity-guaranteed .chance-fill {
    background: linear-gradient(90deg, #16a085, #1abc9c); /* Гарантированный */
}

.rarity-common .chance-fill {
    background: linear-gradient(90deg, #bdc3c7, #ecf0f1); /* Обычный */
}

.rarity-uncommon .chance-fill {
    background: linear-gradient(90deg, #27ae60, #2ecc71); /* Необычный */
}

.rarity-rare .chance-fill {
    background: linear-gradient(90deg, #2980b9, #6dd5fa); /* Редкий */
}

.rarity-epic .chance-fill {
    background: linear-gradient(90deg, #8e44ad, #c77df3); /* Эпический */
}

.rarity-mythical .chance-fill {
    background: linear-gradient(90deg, #e74c3c, #f77777); /* Мифический */
}

.rarity-legendary .chance-fill {
    background: linear-gradient(90deg, #f39c12, #f1c40f); /* Легендарный */
}

.rarity-ultra-legendary .chance-fill {
    background: linear-gradient(90deg, #f4d03f, #f5b041); /* Ультра-легендарный */
}

.rarity-low .chance-fill {
    background: linear-gradient(90deg, #7f8c8d, #95a5a6); /* Низкий */
}

.rarity-very-low .chance-fill {
    background: linear-gradient(90deg, #34495e, #5d6d7e); /* Очень низкий */
}

.rarity-almost-impossible .chance-fill {
    background: linear-gradient(90deg, #2c3e50, #4a6fa5); /* Почти невозможный */
}

/* Стили для разных типов предметов */
.item-edit-row[data-status="0"] {
    background: rgba(231, 76, 60, 0.1) !important;
    border-left: 3px solid #e74c3c;
}

.item-edit-row[data-status="1"] {
    background: rgba(255, 255, 255, 0.1) !important;
    border-left: 3px solid #bdc3c7;
}

.item-edit-row[data-status="2"] {
    background: rgba(241, 196, 15, 0.1) !important;
    border-left: 3px solid #f1c40f;
}

/* Для темной темы */
.dark-theme .item-edit-row[data-status="0"] {
    background: rgba(231, 76, 60, 0.2) !important;
}

.dark-theme .item-edit-row[data-status="1"] {
    background: rgba(255, 255, 255, 0.05) !important;
}

.dark-theme .item-edit-row[data-status="2"] {
    background: rgba(241, 196, 15, 0.15) !important;
}

.chance-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%; /* Фиксированная ширина блика */
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shineInFill 2.5s ease-in-out infinite;
}

@keyframes shineInFill {
    to {
        transform: translateX(300%);
    }
}

/* Dark theme */
.dark-theme .chest-card {
    background: rgba(40, 40, 40, 0.95);
}

.dark-theme .chest-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%);
}

.dark-theme .item-row {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .item-row:hover {
    background: rgba(52, 152, 219, 0.1);
}

.dark-theme .item-name {
    color: #ecf0f1;
}

.dark-theme .chance-container {
    background: rgba(255, 255, 255, 0.05);
}

.dark-theme .rarity-info {
    color: #999;
}

/* Hover text */
.hover-text-wrapper {
    position: relative;
    display: inline-block;
}

.hover-text {
    display: none !important;
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.hover-text-wrapper:hover .hover-text {
    opacity: 1;
    visibility: visible;
    top: -40px;
}

.monster-image:hover {
    transform: scale(1.3) !important;
    z-index: 500;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}



/* Добавьте эти стили в секцию стилей */
/* Tooltip */
.chance-tooltip {
    position: absolute; /* Меняем с fixed на absolute */
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 8px;
    color: white;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 9999;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: translate3d(0, 0, 0);
    /* Добавляем позиционирование */
    top: -50px; /* Поднимаем тултип выше */
    left: 60%;
    transform: translateX(-50%);
}

.chance-container {
    position: relative;
    background: rgba(0, 0, 0, 0.02);
    padding: 0.8rem;
    border-radius: 10px;
}

.chance-container:hover .chance-tooltip {
    opacity: 1;
    visibility: visible;
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}

.tooltip-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}

.tooltip-value {
    font-weight: 500;
    color: white;
    font-size: 11px;
}

.tooltip-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

.chance-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.5rem;
}

.chance-fill {
    position: absolute;
    height: 100%;
    left: 0;
    top: 0;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.chance-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shineInFill 2.5s ease-in-out infinite;
}

.rarity-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

/* Dark theme */
.dark-theme .chance-tooltip {
    background: rgba(40, 40, 40, 0.95);
}

.dark-theme .chance-container {
    background: rgba(255, 255, 255, 0.05);
}

.dark-theme .chance-bar {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .rarity-info {
    color: #999;
}

@keyframes shineInFill {
    to {
        transform: translateX(300%);
    }
}







/* Стили для модального окна */
/* Edit Button Style */
.edit-button {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    border: 1px solid rgba(255,255,255,0.18);
    padding: 0.7rem;
    margin-right: 0.5rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    color:rgb(230, 231, 231);
    box-shadow: 0 4px 15px rgba(31, 38, 135, 0.07);
}

.edit-button:hover {
    transform: translateY(-3px) scale(1);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    color: #f1c40f;
}

/* Modal Base Structure */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px);
    transition: background-color 0.3s ease-in-out;
}

.modal.show {
    display: block;
    background-color: rgba(0,0,0,0.5);
}

.modal.show .modal-content {
    opacity: 1;
    transform: translateY(0);
}

.dark-theme .modal {
    background: rgba(0, 0, 0, 0.4);
}

/* Modal Window */
.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 1000px;
    position: relative;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-in-out;
    margin-top: 200px;
}


.dark-theme .modal-content {
    background: #1a1a1a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal .close-button {
    transition: transform 0.2s ease-in-out;
}

.modal .close-button:hover {
    transform: scale(1.1);
}

/* Modal Header */
.modal-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 2rem;
}

.dark-theme .modal-title {
    color: #FFFFFF;
}

/* Стиль для изображения предмета */
.item-edit-row .item-pic {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

/* Обновляем field-labels чтобы соответствовать новой сетке */
.field-labels {
    display: grid;
    grid-template-columns: 48px 1fr 1.5fr 0.8fr 0.8fr 1.2fr 0.5fr;
    gap: 1rem;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.field-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
}

.dark-theme .field-label {
    color: #ccc;
}

/* Item Edit Row */
.item-edit-row {
    display: grid;
    grid-template-columns: 48px 1fr 1.5fr 0.8fr 0.8fr 1.2fr 0.5fr; /* Добавлена колонка для изображения */
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}


.item-edit-row:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.dark-theme .item-edit-row {
    background: #2c3e50;
}

.dark-theme .item-edit-row:hover {
    background: #34495e;
}

/* Form Inputs */
.item-edit-row input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #FFFFFF;
    color: #333;
    transition: all 0.3s ease;
}

.item-edit-row select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #FFFFFF;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.item-edit-row input:focus,
.item-edit-row select:focus {
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    outline: none;
}

.dark-theme .item-edit-row input,
.dark-theme .item-edit-row select {
    background: #34495e;
    border-color: #455d7a;
    color: #FFFFFF;
}

.dark-theme .item-edit-row input:focus,
.dark-theme .item-edit-row select:focus {
    border-color: #64B5F6;
    box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.2);
}

/* Remove Button */
.remove-item {
    color: #e74c3c;
    cursor: pointer;
    background: rgba(231, 76, 60, 0.1);
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
}

.dark-theme .remove-item {
    background: rgba(231, 76, 60, 0.2);
}

/* Action Buttons Container */
.button-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

/* Action Buttons */
.btn {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    min-width: 120px;
    transition: all 0.3s ease;
}

/* Save Button */
.btn-save {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

/* Cancel Button */
.btn-cancel {
    background: #e0e0e0;
    color: #333;
}

.btn-cancel:hover {
    background: #d5d5d5;
    transform: translateY(-2px);
}

.dark-theme .btn-cancel {
    background: #455d7a;
    color: #FFFFFF;
}

.dark-theme .btn-cancel:hover {
    background: #34495e;
}

/* Add Button */
.btn-add {
    background: #4CAF50;
    color: white;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.btn-add:hover {
    background: #43A047;
    transform: translateY(-2px);
}

/* Scrollbar Styles */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.dark-theme .modal-content::-webkit-scrollbar-track {
    background: #2c3e50;
}

.dark-theme .modal-content::-webkit-scrollbar-thumb {
    background: #455d7a;
}

.dark-theme .modal-content::-webkit-scrollbar-thumb:hover {
    background: #576c89;
}

/* Animation */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .item-edit-row,
    .field-labels {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .field-labels {
        display: none;
    }

    .button-container {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

.totalChance {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    color: rgba(107, 114, 128, 0.95);
    line-height: 1.5;
    margin-top: 8px;
    opacity: 0.5;
    letter-spacing: 0.01em;
    transition: opacity 0.2s ease;
}

.totalChance:hover {
    opacity: 1;
}
