.history-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(147, 51, 234, 0.2) 0%,
        rgba(168, 85, 247, 0.15) 15%,
        rgba(14, 34, 69, 0.9) 40%
    );
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: none;
    z-index: 999999;
    display: none;
}

.history-details-modal.active {
    opacity: 1;
    visibility: visible;
    display: flex;
    animation: modalFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.history-details-modal.closing {
    animation: modalFadeOut 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.history-details-content {
    width: 400px;
    max-width: 90%;
    background: linear-gradient(139deg, rgba(38, 35, 78, 0.95), rgba(23, 19, 61, 0.98));
    border: 1px solid rgba(147, 51, 234, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(-100%) scale(0.8);
    opacity: 0;
    transition: none;
    z-index: 999999;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3), 
                0 0 8px rgba(126, 34, 206, 0.5) inset;
    padding: 36px 32px 38px 32px;
    min-height: auto;
}

.history-details-modal.active .history-details-content {
    animation: contentSlideIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.history-details-modal.closing .history-details-content {
    animation: contentSlideOut 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.history-details-content::before,
.history-details-content::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, 
        transparent, 
        rgba(147, 51, 234, 0.7),
        rgba(168, 85, 247, 0.8),
        rgba(147, 51, 234, 0.7),
        transparent
    );
    z-index: 1;
}
.history-details-content::before { top: 0; }
.history-details-content::after { bottom: 0; }

@keyframes modalFadeIn {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    100% {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

@keyframes modalFadeOut {
    0% {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
    100% {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
}

@keyframes contentSlideIn {
    0% {
        transform: translateY(-100%) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes contentSlideOut {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%) scale(0.8);
        opacity: 0;
    }
}

@keyframes popupAppear {
    from { 
        transform: translateY(-100%) scale(0.98); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}


.history-details-content h3 {
    color: white;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 18px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.history-details-content .history-img {
    display: block;
    width: 130px;
    height: 130px;
    object-fit: contain;
    margin: 0 auto 22px auto;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(126,34,206,0.18);
    background: none !important;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.18));
    opacity: 0.9;
}

.history-details-content div {
    color: rgb(226, 232, 240);
    font-size: 16px;
    margin-bottom: 7px;
    text-align: center;
    width: 100%;
    line-height: 1.5;
}

.history-details-content b {
    color: #a78bfa;
    font-weight: 600;
}

.history-details-content .history-price-value {
    display: inline;
    color: rgb(226, 232, 240);
    font-weight: 500;
}

/* Мобильные стили для полноэкранного отображения */
@media screen and (max-width: 1024px) {
    .history-details-modal {
        padding: 0;
        width: 100vw;
        height: 100vh;
    }
    
    .history-details-content {
        width: 90%;
        max-width: 400px;
        height: auto;
        max-height: 90vh;
        margin: 0;
        border-radius: 16px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3), 
                    0 0 8px rgba(126, 34, 206, 0.5) inset;
        padding: 20px;
    }
    
    .history-details-content .history-img {
        width: 100px;
        height: 100px;
        margin-bottom: 16px;
    }
    
    .history-details-content h3 {
        font-size: 20px;
        margin-bottom: 14px;
    }
    
    .history-details-content div {
        font-size: 14px;
        margin-bottom: 6px;
    }
}

@media screen and (max-width: 768px) {
    .history-details-content {
        padding: 16px;
    }
    
    .history-details-content .history-img {
        width: 90px;
        height: 90px;
        margin-bottom: 14px;
    }
    
    .history-details-content h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .history-details-content div {
        font-size: 13px;
        margin-bottom: 5px;
    }
}

@media screen and (max-width: 480px) {
    .history-details-content {
        padding: 12px;
    }
    
    .history-details-content .history-img {
        width: 80px;
        height: 80px;
        margin-bottom: 12px;
    }
    
    .history-details-content h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .history-details-content div {
        font-size: 12px;
        margin-bottom: 4px;
    }
}

@media screen and (max-width: 360px) {
    .history-details-content {
        padding: 10px;
    }
    
    .history-details-content .history-img {
        width: 70px;
        height: 70px;
        margin-bottom: 10px;
    }
    
    .history-details-content h3 {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .history-details-content div {
        font-size: 11px;
        margin-bottom: 3px;
    }
}

@media screen and (max-width: 320px) {
    .history-details-content {
        padding: 8px;
    }
    
    .history-details-content .history-img {
        width: 60px;
        height: 60px;
        margin-bottom: 8px;
    }
    
    .history-details-content h3 {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .history-details-content div {
        font-size: 10px;
        margin-bottom: 2px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .history-details-content {
        max-height: 85vh;
        overflow-y: auto;
        padding: 16px 20px;
    }
    
    .history-details-content .history-img {
        width: 70px;
        height: 70px;
        margin-bottom: 10px;
    }
    
    .history-details-content h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .history-details-content div {
        font-size: 13px;
        margin-bottom: 3px;
    }
} 

/* Отключаем анимации ТОЛЬКО для iPhone/iOS */
@media only screen and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) {
    .history-details-modal {
        transition: none !important;
    }
    
    .history-details-modal.active {
        animation: none !important;
    }
    
    .history-details-content {
        transition: none !important;
        transform: translateY(0) scale(1) !important;
        opacity: 1 !important;
    }
    
    .history-details-modal.active .history-details-content {
        animation: none !important;
        transform: translateY(0) scale(1) !important;
        opacity: 1 !important;
    }
}

/* Дополнительная проверка для iOS Safari */
@media only screen and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (-webkit-touch-callout: none) {
    .history-details-modal {
        transition: none !important;
    }
    
    .history-details-modal.active {
        animation: none !important;
    }
    
    .history-details-content {
        transition: none !important;
        transform: translateY(0) scale(1) !important;
        opacity: 1 !important;
    }
    
    .history-details-modal.active .history-details-content {
        animation: none !important;
        transform: translateY(0) scale(1) !important;
        opacity: 1 !important;
    }
} 