/* patch.css - Overriding styles for the summary panel */

#summary-by-role {
    gap: 0.5rem;
}

.summary-sub-item {
    display: grid;
    /* 1. Role Name (flexible), 2. Hours, 3. Budget, 4. Percentage */
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 1.5rem; /* Space between columns */
    align-items: center;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

/* Make sure the first column (role name) doesn't push others away */
.summary-sub-item span:nth-child(1) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

/* Align hours, budget, and percentage to the right */
.summary-sub-item span:nth-child(2),
.summary-sub-item span:nth-child(3),
.summary-sub-item span:nth-child(4) {
    text-align: right;
}

.summary-sub-item span:nth-child(2) {
    min-width: 70px; /* Hours */
    color: #555;
}
.summary-sub-item span:nth-child(3) {
    min-width: 90px; /* Budget */
    font-weight: bold;
}
.summary-sub-item span:nth-child(4) {
    min-width: 60px; /* Percentage */
    color: #555;
}

/* ========================================
   导出功能样式
   ======================================== */

.export-actions {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.export-actions h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.export-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.button-export {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.button-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    background: #f8f9ff;
}

.button-export:active {
    transform: translateY(0);
}

.button-export:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 加载遮罩层 */
.export-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.loading-content {
    background: white;
    padding: 2rem 3rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.loading-content p {
    margin: 1rem 0 0 0;
    font-size: 1.1rem;
    color: #333;
}

/* 加载动画 */
.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .export-buttons {
        flex-direction: column;
    }
    
    .button-export {
        width: 100%;
    }
}
