/**
 * Calculator Success Modal Styles
 * Animationer och styling för success feedback
 */

/* Success Modal Overlay */
.success-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.success-modal-overlay.show {
    opacity: 1;
}

/* Success Modal */
.success-modal {
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 100%;
    padding: 40px;
    text-align: center;
    position: relative;
    transform: scale(0.8) translateY(40px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-modal-overlay.show .success-modal {
    transform: scale(1) translateY(0);
}

/* Success Icon */
.success-icon-wrapper {
    margin-bottom: 24px;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 40px;
    color: white;
    animation: successIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

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

/* Title */
.success-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
}

.success-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 32px;
}

/* Summary */
.success-summary {
    background: #f9fafb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.sum-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.sum-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.sum-icon.material {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.sum-icon.labor {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.sum-icon.total {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.sum-details {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sum-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.sum-count {
    font-size: 16px;
    color: #1f2937;
    font-weight: 600;
}

.sum-price {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.sum-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #e5e7eb 50%, transparent 100%);
    margin: 12px 0;
}

.sum-row.total {
    padding-top: 16px;
}

.sum-row.total .sum-price {
    color: #10b981;
    font-size: 24px;
}

/* Actions */
.success-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-success-secondary,
.btn-success-primary {
    flex: 1;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-success-secondary {
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.btn-success-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #4b5563;
    transform: translateY(-2px);
}

.btn-success-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-success-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}

.btn-success-primary:active,
.btn-success-secondary:active {
    transform: translateY(0);
}

/* Hint */
.success-hint {
    font-size: 14px;
    color: #6b7280;
    padding: 12px;
    background: #fffbeb;
    border-radius: 8px;
    border: 1px solid #fcd34d;
}

/* Confetti */
.success-modal.with-confetti {
    overflow: hidden;
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    border-radius: 24px;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    opacity: 1;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* Success Toast (för mindre notiser) */
.success-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    color: #1f2937;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9998;
    min-width: 300px;
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 15px;
    font-weight: 500;
}

.success-toast.show {
    transform: translateX(0);
}

.success-toast i {
    font-size: 20px;
}

.success-toast.success {
    border-left: 4px solid #10b981;
}

.success-toast.success i {
    color: #10b981;
}

.success-toast.info {
    border-left: 4px solid #3b82f6;
}

.success-toast.info i {
    color: #3b82f6;
}

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

.success-toast.warning i {
    color: #f59e0b;
}

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

.success-toast.error i {
    color: #ef4444;
}

/* Pulse animation för FAB badge */
@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

.fab-badge-pulse {
    animation: badgePulse 1s ease-in-out 3;
}

/* Slide-in animation från höger */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .success-modal {
        padding: 32px 24px;
        max-width: 95%;
    }
    
    .success-icon {
        width: 64px;
        height: 64px;
        font-size: 32px;
    }
    
    .success-title {
        font-size: 24px;
    }
    
    .success-actions {
        flex-direction: column;
    }
    
    .btn-success-secondary,
    .btn-success-primary {
        width: 100%;
    }
    
    .success-toast {
        right: 12px;
        left: 12px;
        bottom: 12px;
        min-width: auto;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .success-modal {
        background: #1f2937;
    }
    
    .success-title {
        color: #f9fafb;
    }
    
    .success-subtitle {
        color: #d1d5db;
    }
    
    .success-summary {
        background: #374151;
    }
    
    .sum-label {
        color: #d1d5db;
    }
    
    .sum-count,
    .sum-price {
        color: #f9fafb;
    }
    
    .sum-divider {
        background: linear-gradient(90deg, transparent 0%, #4b5563 50%, transparent 100%);
    }
    
    .success-hint {
        background: #374151;
        border-color: #f59e0b;
        color: #d1d5db;
    }
    
    .btn-success-secondary {
        background: #374151;
        color: #d1d5db;
        border-color: #4b5563;
    }
    
    .btn-success-secondary:hover {
        background: #4b5563;
        border-color: #6b7280;
    }
    
    .success-toast {
        background: #374151;
        color: #f9fafb;
    }
}
