/* Norsewood Pallet Logic Styles - Enhanced with Smooth Animations */

.norsewood-progress-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
}

.norsewood-progress-wrapper {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffff 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0); /* Enable hardware acceleration */
}

.norsewood-progress-wrapper:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.norsewood-progress-bar {
    position: relative;
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.norsewood-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 50%, #17a2b8 100%);
    border-radius: 15px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    transform: translateZ(0); /* Hardware acceleration */
    will-change: width; /* Optimize for width changes */
}

.norsewood-progress-fill.animated {
    animation: progressShine 2s ease-in-out;
}

@keyframes progressShine {
    0% { 
        box-shadow: inset 0 0 0 rgba(255,255,255,0.3);
        transform: scaleY(1);
    }
    50% { 
        box-shadow: inset 0 0 20px rgba(255,255,255,0.5);
        transform: scaleY(1.05);
    }
    100% { 
        box-shadow: inset 0 0 0 rgba(255,255,255,0.3);
        transform: scaleY(1);
    }
}

.norsewood-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 14px;
    color: #333;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
    z-index: 2;
    transition: all 0.3s ease;
}

.norsewood-status-complete {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
    font-size: 16px;
    transition: all 0.4s ease;
    transform: translateY(0);
    opacity: 1;
}

.norsewood-status-incomplete {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
    font-size: 16px;
    transition: all 0.4s ease;
    transform: translateY(0);
    opacity: 1;
}

.norsewood-warning {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
    font-size: 14px;
    transition: all 0.4s ease;
    animation: warningPulse 2s ease-in-out infinite;
}

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

.norsewood-suggestions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
    transition: all 0.5s ease;
    opacity: 1;
    transform: translateY(0);
}

.norsewood-single-suggestions {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #c3e6cb;
    transition: all 0.4s ease;
}

.norsewood-fitting-suggestions {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #b3d9ff;
    transition: all 0.4s ease;
}

.norsewood-suggestions-header {
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.norsewood-suggestions-header strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.norsewood-encourage {
    color: #27ae60;
    font-style: italic;
    font-size: 14px;
    transition: all 0.3s ease;
}

.norsewood-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.norsewood-suggestion-item {
    background: rgba(255,255,255,0.7);
    border-radius: 6px;
    padding: 8px 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    transform: translateX(0) translateZ(0);
    opacity: 1;
}

.norsewood-suggestion-item:hover {
    background: rgba(255,255,255,0.9);
    border-color: #007cba;
    transform: translateX(4px) scale(1.02);
    box-shadow: 0 2px 8px rgba(0,124,186,0.2);
}

.norsewood-suggestion-item.clicked {
    transform: translateX(4px) scale(0.98);
    background: rgba(0,124,186,0.1);
}

.norsewood-suggestion-link {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: block;
    transition: all 0.3s ease;
}

.norsewood-suggestion-link:hover {
    color: #005a87;
    text-decoration: underline;
    transform: translateX(2px);
}

.norsewood-loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
    transition: all 0.3s ease;
    position: relative;
}

.norsewood-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #6c757d;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.norsewood-error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Fade in animation for new content */
.norsewood-progress-wrapper.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Stagger animation for suggestion items */
.norsewood-suggestion-item:nth-child(1) { animation-delay: 0.1s; }
.norsewood-suggestion-item:nth-child(2) { animation-delay: 0.2s; }
.norsewood-suggestion-item:nth-child(3) { animation-delay: 0.3s; }

@media (max-width: 768px) {
    .norsewood-progress-wrapper {
        padding: 15px;
        margin: 15px 0;
    }

    .norsewood-progress-bar {
        height: 25px;
    }

    .norsewood-progress-text {
        font-size: 12px;
    }

    .norsewood-status-complete,
    .norsewood-status-incomplete {
        font-size: 14px;
        padding: 10px 12px;
    }

    .norsewood-suggestion-item:hover {
        transform: translateX(2px) scale(1.01);
    }
}

.norsewood-progress-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c9a96e 0%, #f4e4bc 50%, #c9a96e 100%);
    border-radius: 12px 12px 0 0;
    transition: all 0.3s ease;
}

/* Smooth transitions for all state changes */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .norsewood-progress-fill,
    .norsewood-suggestion-item,
    .norsewood-progress-wrapper {
        transition: none !important;
        animation: none !important;
    }
}