/* Smart Financial Assistant Styles */

/* Typing indicator animation */
.typing-dots span {
    display: inline-block;
    animation: typingDots 1.4s infinite;
    font-weight: bold;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDots {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Enhanced tab styling */
.nav-pills .nav-link {
    border-radius: 8px;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, #6f42c1 0%, #20c997 100%);
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.3);
}

.nav-pills .nav-link:not(.active):hover {
    background: rgba(111, 66, 193, 0.1);
    transform: translateY(-2px);
}

/* Summary cards enhancement */
.analysis-results .card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.analysis-results .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.analysis-results .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.analysis-results .card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

/* Form enhancements */
.analysis-input-section .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.analysis-input-section .form-control:focus {
    border-color: #6f42c1;
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.15);
}

.analysis-input-section .btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.analysis-input-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Quick analysis buttons */
.quick-analysis {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* Modal enhancements */
.modal-xl .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-radius: 16px 16px 0 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #6f42c1 0%, #20c997 100%);
}

.modal-body .nav-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0;
}

.modal-body .nav-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 1rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #6f42c1 !important;
}

.modal-body .nav-tabs .nav-link.active {
    background: none;
    color: #6f42c1 !important;
    border-bottom: 3px solid #6f42c1;
    font-weight: 600;
}

.modal-body .nav-tabs .nav-link:not(.active):hover {
    background: rgba(111, 66, 193, 0.1);
    color: #20c997 !important;
}

/* Chat message styling */
.chat-message {
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner enhancement */
.spinner-border {
    width: 2rem;
    height: 2rem;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Progress bar styling */
.progress {
    height: 8px;
    border-radius: 4px;
    background: rgba(111, 66, 193, 0.1);
}

.progress-bar {
    border-radius: 4px;
    background: linear-gradient(90deg, #6f42c1 0%, #20c997 100%);
    transition: width 0.6s ease;
}

/* Badge styling */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
}

.badge-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

/* Card hover effects */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Enhanced list styling */
.list-group-item {
    border: none;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background: rgba(111, 66, 193, 0.05);
    padding-left: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .analysis-results .card h3 {
        font-size: 1.5rem;
    }

    .modal-xl .modal-dialog {
        margin: 0.5rem;
    }

    .nav-pills .nav-link {
        margin: 2px;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .analysis-input-section .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .analysis-input-section .btn-group .btn {
        margin: 0;
    }
}

/* Scrollbar styling for chat */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6f42c1 0%, #20c997 100%);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a2a9a 0%, #1ba085 100%);
}

/* Enhanced button states */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Confidence score visualization */
.confidence-score {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.confidence-score h2 {
    background: linear-gradient(135deg, #6f42c1 0%, #20c997 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Chart container styling */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

/* Impact cards grid */
.impact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Category description styling */
.category-description {
    background: rgba(111, 66, 193, 0.05);
    border-left: 4px solid #6f42c1;
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
}

/* Enhanced metric display */
.metric-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(111, 66, 193, 0.03);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.metric-item:hover {
    background: rgba(111, 66, 193, 0.08);
    transform: translateY(-1px);
}

.metric-item label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

/* Timeline analysis styling */
.timeline-analysis {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.03) 0%, rgba(32, 201, 151, 0.05) 100%);
    border-radius: 12px;
    padding: 1.5rem;
}

.timeline-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.timeline-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.timeline-item h6 {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Detail item styling for analysis cards */
.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(111, 66, 193, 0.1);
}

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

.detail-item label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    margin: 0;
}

/* Enhanced breakdown cards */
.analysis-results .card .card-header {
    background: linear-gradient(135deg, #6f42c1 0%, #20c997 100%);
    color: white;
    border: none;
    font-weight: 600;
}

.analysis-results .card-body {
    padding: .75rem;
}

/* Equal height cards */
.h-100 {
    height: 100% !important;
}

/* Badge styling improvements */
.badge {
    font-size: 0.75rem;
    padding: 0.4em 0.8em;
    border-radius: 6px;
}

/* Card border effects */
.border-left-primary {
    border-left: 4px solid #6f42c1 !important;
}

/* Loading state improvements */
.analysis-loading {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.05) 0%, rgba(32, 201, 151, 0.08) 100%);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
}

/* Business Insights Styling */
.insight-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(111, 66, 193, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.insight-header {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.05) 0%, rgba(32, 201, 151, 0.08) 100%);
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(111, 66, 193, 0.1);
}

.insight-body {
    padding: 1.25rem;
}

.modern-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modern-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.modern-list li:last-child {
    border-bottom: none;
}

.modern-list li:hover {
    background: rgba(111, 66, 193, 0.02);
    padding-left: 0.5rem;
}

/* Detailed Explanation Styling */
.detailed-explanation-content {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.02) 0%, rgba(32, 201, 151, 0.03) 100%);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(111, 66, 193, 0.1);
}

.explanation-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #6f42c1;
}

.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: #6f42c1;
}

.section-number {
    background: linear-gradient(135deg, #6f42c1 0%, #20c997 100%);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 0.75rem;
    font-size: 0.9rem;
}

.section-content {
    line-height: 1.6;
    color: #444;
}

/* Market Positioning Card */
.market-positioning-card {
    background: linear-gradient(135deg, rgba(32, 201, 151, 0.05) 0%, rgba(111, 66, 193, 0.08) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(32, 201, 151, 0.2);
}

.market-positioning-content {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    margin-top: 1rem;
}

/* Strategic Implications */
.strategic-implications-card {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.03) 0%, rgba(32, 201, 151, 0.05) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(111, 66, 193, 0.15);
}

.strategic-content {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.strategic-metric {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(111, 66, 193, 0.02);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.strategic-metric:hover {
    background: rgba(111, 66, 193, 0.05);
    transform: translateY(-1px);
}

.metric-icon {
    margin-right: 1rem;
    font-size: 1.5rem;
}

.metric-details label {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-details .metric-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
}

/* Cascade Effects Styling */
.primary-impact-card {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.05) 0%, rgba(32, 201, 151, 0.08) 100%);
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid rgba(111, 66, 193, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.primary-metrics {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.metric-badge {
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.impact-badge {
    background: linear-gradient(135deg, #6f42c1 0%, #9c27b0 100%);
    color: white;
}

.amount-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.confidence-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6f42c1 0%, #20c997 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 25px rgba(111, 66, 193, 0.3);
}

.confidence-inner {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.confidence-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #6f42c1;
    line-height: 1;
}

.confidence-label {
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cascade Effect Cards */
.cascade-network {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

.cascade-effect-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.cascade-effect-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.high-confidence {
    border-left: 5px solid #28a745;
}

.medium-confidence {
    border-left: 5px solid #ffc107;
}

.low-confidence {
    border-left: 5px solid #6c757d;
}

.effect-header {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid #e9ecef;
}

.effect-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6f42c1 0%, #20c997 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
}

.effect-title {
    flex: 1;
}

.confidence-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-high {
    background: #d4edda;
    color: #155724;
}

.badge-medium {
    background: #fff3cd;
    color: #856404;
}

.badge-low {
    background: #f8d7da;
    color: #721c24;
}

.effect-impact {
    text-align: right;
}

.impact-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.impact-value.positive {
    color: #28a745;
}

.impact-value.negative {
    color: #dc3545;
}

.effect-body {
    padding: 1.25rem;
}

.reasoning-section {
    display: flex;
    align-items: flex-start;
    font-style: italic;
    color: #6c757d;
    line-height: 1.5;
}

.impact-bar-container {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.impact-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.positive-bar {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.negative-bar {
    background: linear-gradient(90deg, #dc3545 0%, #e83e8c 100%);
}

/* No Effects Card */
.no-effects-card {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.05) 0%, rgba(206, 212, 218, 0.08) 100%);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
}

/* Summary Statistics */
.effect-summary-section .summary-stat,
.recommendations-summary .summary-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(111, 66, 193, 0.02);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.effect-summary-section .summary-stat:hover,
.recommendations-summary .summary-stat:hover {
    background: rgba(111, 66, 193, 0.05);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Recommendations Styling */
.recommendations-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

.recommendation-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.high-priority {
    border-left: 5px solid #dc3545;
}

.medium-priority {
    border-left: 5px solid #ffc107;
}

.low-priority {
    border-left: 5px solid #17a2b8;
}

.recommendation-header {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid #e9ecef;
}

.recommendation-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6f42c1 0%, #20c997 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 1rem;
}

.recommendation-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.priority-badge,
.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.high-badge {
    background: #f8d7da;
    color: #721c24;
    width: fit-content;
}

.medium-badge {
    background: #fff3cd;
    color: #856404;
    width: fit-content;
}

.low-badge {
    background: #d1ecf1;
    color: #0c5460;
    width: fit-content;
}

.recommendation-body {
    padding: 1.25rem;
}

.recommendation-title {
    color: #333;
    margin-bottom: 0.75rem;
}

.recommendation-description {
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Action Items */
.action-items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-item {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.action-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.action-number {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
    font-size: 0.9rem;
}

.action-content {
    flex: 1;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

/* Timeline */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.timeline-phase {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.phase-header {
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

.phase-content {
    padding: 1rem 1.25rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.timeline-item:last-child {
    border-bottom: none;
}

/* Responsive improvements for enhanced display */
@media (max-width: 768px) {
    .metric-item {
        margin-bottom: 0.75rem;
    }

    .metric-value {
        font-size: 1rem;
    }

    .timeline-item {
        margin-bottom: 0.75rem;
    }

    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 0;
    }

    .detail-item label {
        margin-bottom: 0.25rem;
    }

    .primary-metrics {
        flex-direction: column;
        gap: 0.5rem;
    }

    .confidence-circle {
        width: 80px;
        height: 80px;
    }

    .confidence-inner {
        width: 65px;
        height: 65px;
    }

    .confidence-number {
        font-size: 1.1rem;
    }

    .effect-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .effect-impact {
        text-align: left;
    }

    .recommendation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .cascade-network {
        gap: 1rem;
    }
}