/* UI Manager 스타일 */

/* 마일리지 애니메이션 */
.mileage-amount {
    transition: all 0.3s ease;
}

.mileage-amount.mileage-update {
    animation: mileagePulse 0.6s ease;
    color: #ffd700 !important;
}

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

/* 토스트 메시지 */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--dark-color);
    font-size: 14px;
    line-height: 1.4;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--dark-color);
}

/* 토스트 타입별 스타일 */
.toast-success {
    border-left: 4px solid #2ecc71;
}

.toast-success .toast-icon {
    background: #2ecc71;
    color: var(--white);
}

.toast-error {
    border-left: 4px solid #e74c3c;
}

.toast-error .toast-icon {
    background: #e74c3c;
    color: var(--white);
}

.toast-warning {
    border-left: 4px solid #f39c12;
}

.toast-warning .toast-icon {
    background: #f39c12;
    color: var(--white);
}

.toast-info {
    border-left: 4px solid #3498db;
}

.toast-info .toast-icon {
    background: #3498db;
    color: var(--white);
}

/* 확인 모달 */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    transition: all 0.3s ease;
}

.confirm-modal.show .confirm-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.confirm-content {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
    position: relative;
}

.confirm-modal.show .confirm-content {
    transform: scale(1);
    opacity: 1;
}

.confirm-header {
    padding: 20px 20px 0;
}

.confirm-title {
    color: var(--dark-color);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.confirm-body {
    padding: 20px;
}

.confirm-message {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.confirm-footer {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
}

.confirm-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-btn.btn-cancel {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.confirm-btn.btn-cancel:hover {
    background: #e9ecef;
}

.confirm-btn.btn-confirm {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: var(--white);
}

.confirm-btn.btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 인벤토리 배지 */
.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #e74c3c;
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* 로딩 화면 개선 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-screen.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-content {
    text-align: center;
    animation: loadingFadeIn 0.6s ease;
}

@keyframes loadingFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-box {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
}

.loading-box-inner {
    width: 100%;
    height: 100%;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    animation: loadingRotate 1.5s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-box-inner::before {
    content: '🎁';
    font-size: 40px;
}

@keyframes loadingRotate {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(180deg);
    }
}

.loading-text {
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .toast-container {
        top: 60px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        max-width: none;
        width: 100%;
    }
    
    .confirm-content {
        margin: 10px;
    }
    
    .confirm-footer {
        flex-direction: column-reverse;
    }
    
    .confirm-btn {
        width: 100%;
    }
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #2c3e50;
    }
    
    .toast-message {
        color: var(--white);
    }
    
    .toast-close {
        color: rgba(255, 255, 255, 0.6);
    }
    
    .toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--white);
    }
    
    .confirm-content {
        background: #2c3e50;
    }
    
    .confirm-title {
        color: var(--white);
    }
    
    .confirm-message {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .confirm-btn.btn-cancel {
        background: #34495e;
        color: var(--white);
        border-color: #4a5f7a;
    }
    
    .confirm-btn.btn-cancel:hover {
        background: #4a5f7a;
    }
}

/* 접근성 */
@media (prefers-reduced-motion: reduce) {
    .toast,
    .confirm-modal,
    .confirm-content,
    .mileage-amount,
    .loading-box-inner {
        animation: none !important;
        transition: none !important;
    }
}