/* Additional responsive styles and enhancements */

/* Typing indicator animation */
.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Priority badges */
.priority-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.priority-badge.urgent {
    background: var(--error-color);
    color: white;
}

.priority-badge.high {
    background: var(--warning-color);
    color: white;
}

.priority-badge.medium {
    background: #666;
    color: white;
}

/* Deal card drag states */
.deal-ghost {
    opacity: 0.5;
    transform: rotate(5deg);
}

.deal-chosen {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.deal-drag {
    transform: rotate(5deg);
    opacity: 0.8;
}

/* Workflow timeline styles */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #e0e0e0;
}

.timeline-item.completed .timeline-marker {
    background: var(--success-color);
    box-shadow: 0 0 0 2px var(--success-color);
}

.timeline-item.current .timeline-marker {
    background: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
    animation: pulse-marker 2s infinite;
}

@keyframes pulse-marker {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.timeline-content {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 3px solid #e0e0e0;
}

.timeline-item.completed .timeline-content {
    border-left-color: var(--success-color);
}

.timeline-item.current .timeline-content {
    border-left-color: var(--primary-color);
}

.timeline-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.timeline-date {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.timeline-description {
    font-size: 0.9rem;
    color: #666;
}

/* Stakeholder styles */
.stakeholders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.stakeholder-group h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.stakeholder-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stakeholder-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.stakeholder-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.stakeholder-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.stakeholder-role {
    font-size: 0.9rem;
    color: #666;
}

/* Document styles */
.document-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.document-item:hover {
    background: #e9ecef;
}

.document-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.document-info {
    flex: 1;
}

.document-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.document-meta {
    font-size: 0.8rem;
    color: #666;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Folder tree styles */
.folder-tree {
    font-size: 0.9rem;
}

.folder-item {
    padding: 0.5rem;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.folder-item:hover {
    background: #e0e0e0;
}

.folder-item i {
    color: var(--primary-color);
}

.folder-children {
    margin-left: 1rem;
    margin-top: 0.5rem;
}

/* Calculation results styles */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.result-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #e0e0e0;
}

.result-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.metric-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.metric-label {
    font-weight: 500;
    color: #666;
}

.metric-value {
    font-weight: 600;
    color: #333;
}

.metric-value.above-hurdle {
    color: var(--success-color);
}

.metric-value.below-hurdle {
    color: var(--error-color);
}

.metric-value.positive {
    color: var(--success-color);
}

.metric-value.negative {
    color: var(--error-color);
}

/* Hurdle analysis styles */
.hurdle-analysis {
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 2px solid;
}

.hurdle-analysis.meets-hurdle {
    border-color: var(--success-color);
    background: #f0f8f0;
}

.hurdle-analysis.below-hurdle {
    border-color: var(--error-color);
    background: #fff5f5;
}

.hurdle-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.hurdle-status i {
    font-size: 1.2rem;
}

.hurdle-details {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Investment recommendation styles */
.investment-recommendation {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    background: #f8f9fa;
    border-left: 4px solid #ddd;
}

.recommendation-approve {
    color: var(--success-color);
    font-weight: 600;
}

.recommendation-conditional {
    color: var(--warning-color);
    font-weight: 600;
}

.recommendation-review {
    color: #666;
    font-weight: 600;
}

.recommendation-reject {
    color: var(--error-color);
    font-weight: 600;
}

/* Calculation error styles */
.calculation-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #fff5f5;
    border: 1px solid var(--error-color);
    border-radius: var(--border-radius);
    color: var(--error-color);
}

/* Compliance indicator styles */
.high-compliance {
    color: var(--success-color) !important;
}

.medium-compliance {
    color: var(--warning-color) !important;
}

.low-compliance {
    color: var(--error-color) !important;
}

/* Workflow placeholder */
.workflow-placeholder {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.workflow-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

/* Workflow viewer styles */
.workflow-header {
    margin-bottom: 2rem;
}

.workflow-header h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.workflow-status {
    font-size: 0.9rem;
    color: #666;
}

.workflow-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.workflow-stage {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #e0e0e0;
    transition: var(--transition);
}

.workflow-stage.completed {
    background: #f0f8f0;
    border-color: var(--success-color);
}

.workflow-stage.current {
    background: #f0f4ff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.workflow-stage.pending {
    background: #f8f9fa;
    opacity: 0.7;
}

.stage-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.workflow-stage.completed .stage-indicator {
    background: var(--success-color);
    color: white;
}

.workflow-stage.current .stage-indicator {
    background: var(--primary-color);
    color: white;
}

.workflow-stage.pending .stage-indicator {
    background: #e0e0e0;
    color: #666;
}

.stage-content {
    flex: 1;
}

.stage-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.stage-status {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.stage-approval {
    font-size: 0.8rem;
    color: var(--warning-color);
    font-style: italic;
}

.stage-actions {
    margin-top: 0.5rem;
}

/* Overview content styles */
.deal-overview {
    padding: 1rem 0;
}

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

.overview-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.overview-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.summary-item .label {
    font-weight: 500;
    color: #666;
}

.summary-item .value {
    font-weight: 600;
    color: #333;
}

/* Financial analysis grid */
.financial-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Enhanced mobile responsiveness */
@media (max-width: 1024px) {
    .workflow-stages {
        grid-template-columns: repeat(4, minmax(250px, 1fr));
        overflow-x: auto;
        padding-bottom: 1rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .financial-metrics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .workflow-stages {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .stakeholders-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .committee-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .workflow-stages {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .approval-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .approval-actions {
        justify-content: space-between;
    }
    
    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .modal-tabs {
        flex-wrap: wrap;
    }
    
    .modal-tab {
        flex: 1;
        min-width: 80px;
    }
}