/* Guided Analysis Styles */

/* Global Styles */
.guided-analysis-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Business Function Cards */
.business-function-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.business-function-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out;
}

.business-function-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.business-function-card:hover::before {
    opacity: 1;
}

.business-function-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

/* Template Cards */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.template-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.template-card:nth-child(1) { animation-delay: 0.1s; }
.template-card:nth-child(2) { animation-delay: 0.2s; }
.template-card:nth-child(3) { animation-delay: 0.3s; }
.template-card:nth-child(4) { animation-delay: 0.4s; }
.template-card:nth-child(5) { animation-delay: 0.5s; }
.template-card:nth-child(6) { animation-delay: 0.6s; }

.template-card:hover {
    animation: pulse 0.6s ease-in-out;
}

/* Progress Steps */
.progress-steps {
    position: relative;
    margin: 3rem 0;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, #28a745 0%, #e9ecef 100%);
    z-index: 0;
}

.step {
    position: relative;
    z-index: 1;
    animation: slideInRight 0.6s ease-out;
    animation-fill-mode: both;
}

.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.2s; }
.step:nth-child(3) { animation-delay: 0.3s; }
.step:nth-child(4) { animation-delay: 0.4s; }

.step-number {
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.step.active .step-number {
    animation: pulse 2s infinite;
    box-shadow: 0 0 20px rgba(0,123,255,0.4);
}

.step.completed .step-number {
    box-shadow: 0 0 20px rgba(40,167,69,0.4);
}

/* Upload Zone */
.upload-zone {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(0,123,255,0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.upload-zone:hover::before {
    width: 200%;
    height: 200%;
}

.upload-zone.dragover {
    transform: scale(1.02);
    box-shadow: 0 10px 40px rgba(0,123,255,0.2);
}

/* Metric Cards */
.metric-cards {
    animation: fadeInUp 0.8s ease-out;
}

.metric-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.metric-card:nth-child(1) { animation-delay: 0.1s; }
.metric-card:nth-child(2) { animation-delay: 0.2s; }
.metric-card:nth-child(3) { animation-delay: 0.3s; }
.metric-card:nth-child(4) { animation-delay: 0.4s; }

.metric-icon {
    transition: all 0.3s ease;
}

.metric-card:hover .metric-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Feature Importance Bars */
.importance-fill {
    position: relative;
    overflow: hidden;
}

.importance-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Results Sections */
.results-section {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.results-section:nth-child(1) { animation-delay: 0.1s; }
.results-section:nth-child(2) { animation-delay: 0.2s; }
.results-section:nth-child(3) { animation-delay: 0.3s; }

/* Insights Section */
.insights-section {
    position: relative;
    overflow: hidden;
}

.insights-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

.insight-item {
    animation: slideInRight 0.6s ease-out;
    animation-fill-mode: both;
}

.insight-item:nth-child(1) { animation-delay: 0.1s; }
.insight-item:nth-child(2) { animation-delay: 0.2s; }
.insight-item:nth-child(3) { animation-delay: 0.3s; }

/* Action Buttons */
.action-buttons {
    animation: fadeInUp 0.8s ease-out;
    animation-delay: 0.5s;
    animation-fill-mode: both;
}

.action-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.action-btn:hover::before {
    width: 300%;
    height: 300%;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .business-function-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .metric-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .progress-steps {
        flex-direction: column;
        align-items: center;
    }
    
    .progress-steps::before {
        display: none;
    }
    
    .step {
        margin: 0.5rem 0;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 300px;
        margin-bottom: 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .business-function-card {
        box-shadow: 0 10px 30px rgba(255,255,255,0.1);
    }
    
    .template-card {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .metric-card {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .results-section {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success States */
.success-state {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Error States */
.error-state {
    animation: errorShake 0.6s ease-out;
    border-color: #dc3545 !important;
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States */
.business-function-card:focus,
.template-card:focus,
.action-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .action-buttons,
    .progress-steps {
        display: none;
    }
    
    .business-function-card,
    .template-card,
    .metric-card,
    .results-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
