/* Company Metrics Modal Styles */
.company-metrics-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.company-metrics-modal.show {
    opacity: 1;
}

.company-metrics-modal-content {
    background: white;
    border-radius: 18px;
    max-width: 480px;
    max-height: 90vh;
    width: 95%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1.2px solid #e2e8f0;
}

@media (min-width: 1330px) {
    .company-metrics-modal {
        max-width: 32%;
        background: none;
        align-items: flex-start;
    }

    .company-metrics-modal-content {
        margin-left: 14px;
        margin-top: 16px;
        max-height: 99vh;
        height: 96%;
    }
}

.company-metrics-modal.show .company-metrics-modal-content {
    transform: scale(1);
}

.company-metrics-header {
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
    color: white;
    border-radius: 18px 18px 0 0;
}

.company-metrics-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.company-metrics-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    /* max-height: 80vh; */
}

.company-metrics-footer {
    padding: 8px 18px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: 0 0 18px 18px;
}

.company-info {
    font-size: 13px;
    color: #8391a4;
    font-weight: 500;
}

.metrics-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.metric-category {
    background: #f8fafc;
    border-radius: 16px;
    padding: 14px;
    border: 1px solid #e2e8f0;
}

.category-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.metric-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    transition: left 0.6s ease;
}

.metric-card:hover::before {
    left: 100%;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

.company-metric-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 8px;
    line-height: 1;
}

.metric-change {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
}

.metric-change.positive {
    background: #dcfce7;
    color: #166534;
}

.metric-change.warning {
    background: #fef3c7;
    color: #92400e;
}

.metric-change.negative {
    background: #fee2e2;
    color: #dc2626;
}

.metric-change.neutral {
    background: #f1f5f9;
    color: #475569;
}

/* Special styling for financial metrics */
.metric-category:nth-child(1) .metric-value {
    color: #059669;
}

/* Special styling for customer metrics */
.metric-category:nth-child(2) .metric-value {
    color: #2563eb;
}

/* Special styling for business development metrics */
.metric-category:nth-child(3) .metric-value {
    color: #7c3aed;
}

/* Special styling for operations metrics */
.metric-category:nth-child(4) .metric-value {
    color: #d97706;
}

/* Enhanced company name styling when clickable */
.company-name:hover {
    background: rgba(30, 58, 138, 1) !important;
    transform: scale(1.05) !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .company-metrics-modal-content {
        width: 98%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .company-metrics-header {
        padding: 16px;
    }
    
    .company-metrics-header h2 {
        font-size: 20px;
    }
    
    .company-metrics-body {
        padding: 8px;
    }
    
    .metric-category {
        padding: 16px;
    }
    
    .metric-items {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .metric-card {
        padding: 16px;
    }
    
    .metric-value {
        font-size: 24px;
    }
    
    .company-metrics-footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        gap: 16px;
    }
    
    .category-title {
        font-size: 16px;
    }
    
    .metric-value {
        font-size: 22px;
    }
}