/* Results Page Styles */

/* Results Container */
.results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
}

.results-header h1 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 2.8em;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-actions {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-actions .action-btn {
    font-size: 16px;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

/* Main Result Card */
.result-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #e74c3c, #f39c12);
}

.main-result {
    display: flex;
    align-items: center;
    gap: 30px;
    min-height: 200px;
}

.result-icon {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5em;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.result-content {
    flex: 1;
}

.result-content h2 {
    color: #2c3e50;
    font-size: 2.2em;
    margin-bottom: 15px;
    font-weight: 600;
}

.result-value {
    font-size: 3.5em;
    font-weight: 800;
    color: #27ae60;
    margin: 20px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.1;
}

.result-description {
    font-size: 1.2em;
    color: #5a6c7d;
    line-height: 1.6;
    margin-top: 15px;
}

/* Calculation Details */
.calculation-details {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
}

.calculation-details h3 {
    color: #2c3e50;
    font-size: 1.6em;
    margin-bottom: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #3498db;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.detail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.detail-label {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.detail-value {
    font-size: 1.4em;
    color: #2c3e50;
    font-weight: 700;
}

.detail-description {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* Insights Section */
.insights-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
}

.insights-section h3 {
    color: #2c3e50;
    font-size: 1.6em;
    margin-bottom: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.insight-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #f39c12;
    position: relative;
    transition: transform 0.3s ease;
}

.insight-item:hover {
    transform: translateX(5px);
}

.insight-item::before {
    content: '💡';
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    background: #f39c12;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insight-text {
    margin-left: 35px;
    color: #2c3e50;
    font-size: 1em;
    line-height: 1.6;
}

/* Actions Section */
.actions-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
    text-align: center;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.action-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    justify-content: center;
}

.action-btn.primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.action-btn.secondary {
    background: #f8f9fa;
    color: #2c3e50;
    border: 2px solid #dee2e6;
}

.action-btn.secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
}

/* Comparison Section */
.comparison-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
}

.comparison-section h3 {
    color: #2c3e50;
    font-size: 1.6em;
    margin-bottom: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comparison-chart {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-style: italic;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1.2em;
    font-weight: 500;
}

/* Error Modal */
.error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 25px 30px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #e74c3c;
    font-size: 1.4em;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #e74c3c;
}

.modal-body {
    padding: 20px 30px;
}

.modal-body p {
    color: #2c3e50;
    font-size: 1em;
    line-height: 1.6;
    margin: 0;
}

.modal-footer {
    padding: 0 30px 25px;
    text-align: center;
}

/* Success States */
.result-card.success {
    border-left: 6px solid #27ae60;
}

.result-card.success .result-icon {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.result-card.success .result-value {
    color: #27ae60;
}

/* Warning States */
.result-card.warning {
    border-left: 6px solid #f39c12;
}

.result-card.warning .result-icon {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.result-card.warning .result-value {
    color: #f39c12;
}

/* Error States */
.result-card.error {
    border-left: 6px solid #e74c3c;
}

.result-card.error .result-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.result-card.error .result-value {
    color: #e74c3c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .results-header {
        padding: 30px 20px;
        margin-bottom: 30px;
    }
    
    .results-header h1 {
        font-size: 2.2em;
    }
    
    .header-actions .action-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .main-result {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 30px 20px;
    }
    
    .result-icon {
        width: 100px;
        height: 100px;
        font-size: 3em;
    }
    
    .result-content h2 {
        font-size: 1.8em;
    }
    
    .result-value {
        font-size: 2.5em;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .calculation-details,
    .insights-section,
    .actions-section {
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    .results-container {
        gap: 20px;
    }
    
    .results-header h1 {
        font-size: 1.9em;
    }
    
    .header-actions .action-btn {
        padding: 12px 18px;
        font-size: 16px;
        min-height: 44px;
    }
    
    .result-value {
        font-size: 2em;
    }
    
    .result-content h2 {
        font-size: 1.5em;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
}

/* Print Styles */
@media print {
    .loading-overlay,
    .error-modal,
    .actions-section {
        display: none !important;
    }
    
    .results-container {
        max-width: none;
        box-shadow: none;
    }
    
    .result-card,
    .calculation-details,
    .insights-section {
        box-shadow: none;
        border: 1px solid #dee2e6;
        break-inside: avoid;
    }
}

/* Animation for result appearance */
.result-card,
.calculation-details,
.insights-section,
.actions-section {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delays */
.calculation-details {
    animation-delay: 0.2s;
}

.insights-section {
    animation-delay: 0.4s;
}

.actions-section {
    animation-delay: 0.6s;
}