/* 뽀개기 화면 스타일 */
.breakdown-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 헤더 */
.breakdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.breakdown-title {
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.breakdown-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breakdown-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* 메인 영역 */
.breakdown-main {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* 아이템 미리보기 */
.items-preview {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.preview-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.preview-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.preview-item.grade-1 {
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.preview-item.grade-2 {
    box-shadow: 0 0 20px rgba(255, 217, 61, 0.3);
}

.preview-item.grade-3 {
    box-shadow: 0 0 20px rgba(107, 207, 127, 0.3);
}

.preview-item .item-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.preview-item .item-name {
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-item .item-grade {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.more-items {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.more-count {
    color: var(--white);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.more-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.no-items {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 40px;
    font-size: 16px;
}

/* 변환 과정 */
.conversion-process {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.process-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.process-arrow.animate {
    opacity: 1;
    animation: bounce 1s ease-in-out infinite;
}

.arrow-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.process-text {
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* 결과 표시 */
.breakdown-result {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.breakdown-result.result-appear {
    animation: resultAppear 0.6s ease-out;
}

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

.result-mileage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.mileage-icon {
    font-size: 40px;
}

.mileage-amount {
    font-size: 36px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mileage-unit {
    font-size: 20px;
    font-weight: 600;
    color: var(--white);
}

.result-message {
    color: var(--white);
    font-size: 16px;
    line-height: 1.5;
}

.result-message strong {
    color: #ffd700;
    font-weight: 700;
}

/* 상세 정보 */
.breakdown-details {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.details-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row.total-row {
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    margin-top: 8px;
    padding-top: 16px;
    font-weight: 700;
}

.detail-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.detail-value {
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
}

.total-mileage {
    color: #ffd700;
    font-size: 16px;
    font-weight: 700;
}

/* 주의사항 카드 */
.warning-card {
    background: rgba(255, 193, 7, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.warning-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.warning-icon {
    font-size: 20px;
}

.warning-title {
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
}

.warning-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.warning-item {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    line-height: 1.4;
}

/* 액션 버튼 */
.breakdown-actions {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.breakdown-btn {
    background: linear-gradient(135deg, #e55039, #c44569);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px rgba(229, 80, 57, 0.4);
    transition: all 0.3s ease;
}

.breakdown-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 80, 57, 0.5);
    background: linear-gradient(135deg, #eb4d4b, #d63031);
}

.breakdown-btn:active:not(:disabled) {
    transform: translateY(0);
}

.breakdown-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 애니메이션 오버레이 */
.breakdown-animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.breakdown-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffd700;
    border-radius: 50%;
    animation: particleFloat 3s linear infinite;
    opacity: 0;
}

.particle-0 { left: 10%; animation-delay: var(--delay); }
.particle-1 { left: 30%; animation-delay: var(--delay); background: #ff6b6b; }
.particle-2 { left: 50%; animation-delay: var(--delay); background: #4ecdc4; }
.particle-3 { left: 70%; animation-delay: var(--delay); background: #45b7d1; }
.particle-4 { left: 90%; animation-delay: var(--delay); background: #96ceb4; }

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(10vh) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
}

.breakdown-progress {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    width: 90%;
}

.progress-text {
    color: var(--white);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #ffd700, #ff6b6b);
    height: 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.progress-count {
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    opacity: 0.8;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .breakdown-header {
        padding: 16px;
    }
    
    .breakdown-title {
        font-size: 18px;
    }
    
    .breakdown-main {
        padding: 16px;
        gap: 20px;
    }
    
    .items-preview {
        padding: 16px;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .preview-item {
        padding: 12px;
    }
    
    .preview-item .item-icon {
        font-size: 28px;
        margin-bottom: 6px;
    }
    
    .preview-item .item-name {
        font-size: 11px;
    }
    
    .preview-item .item-grade {
        font-size: 9px;
    }
    
    .breakdown-result {
        padding: 20px;
    }
    
    .result-mileage {
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .mileage-icon {
        font-size: 32px;
    }
    
    .mileage-amount {
        font-size: 28px;
    }
    
    .mileage-unit {
        font-size: 16px;
    }
    
    .result-message {
        font-size: 14px;
    }
    
    .breakdown-details {
        padding: 0 16px 16px;
        gap: 12px;
    }
    
    .details-card,
    .warning-card {
        padding: 16px;
    }
    
    .breakdown-actions {
        padding: 16px;
    }
    
    .breakdown-progress {
        padding: 20px;
    }
    
    .progress-text {
        font-size: 16px;
        margin-bottom: 16px;
    }
}

@media (max-width: 375px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .preview-item {
        padding: 8px;
    }
    
    .preview-item .item-icon {
        font-size: 24px;
        margin-bottom: 4px;
    }
    
    .preview-item .item-name {
        font-size: 10px;
    }
    
    .more-count {
        font-size: 20px;
    }
    
    .more-text {
        font-size: 11px;
    }
}

/* 접근성 */
@media (prefers-reduced-motion: reduce) {
    .breakdown-btn,
    .preview-item,
    .process-arrow {
        transition: none !important;
        animation: none !important;
    }
    
    .particle {
        animation: none !important;
        display: none;
    }
    
    .breakdown-result.result-appear {
        animation: none !important;
    }
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
    .breakdown-screen {
        background: linear-gradient(135deg, #c0392b 0%, #8e44ad 100%);
    }
    
    .warning-card {
        background: rgba(241, 196, 15, 0.2);
        border-color: rgba(241, 196, 15, 0.4);
    }
}