/* 项目仪表盘样式 - Mira Villa */

/* ===== 仪表盘容器 ===== */
#project-dashboard-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== 仪表盘头部 ===== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h2 {
    font-size: 1.875rem;
    font-weight: 600;
    color: #1e3a8a;
    margin: 0;
}

.dashboard-header .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ===== 项目网格 ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* ===== 项目卡片 ===== */
.project-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.project-card:hover {
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.15);
    border-color: #0891b2;
    transform: translateY(-4px);
}

.project-card-main {
    cursor: pointer;
}

.project-card-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.project-card-actions .btn-icon-only {
    background: white;
    border: 1.5px solid #e5e7eb;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.project-card-actions .btn-icon-only:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.project-card-actions .btn-edit:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

.project-card-actions .btn-delete:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.project-card-header {
    padding-right: 6rem; /* Make room for action buttons */
}

/* 卡片头部 */
.project-card-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.project-card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e3a8a;
    margin: 0;
    flex: 1;
    line-height: 1.4;
}

.project-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.project-status.status-active {
    background: #d1fae5;
    color: #065f46;
}

.project-status.status-planning {
    background: #dbeafe;
    color: #1e40af;
}

.project-status.status-completed {
    background: #e0e7ff;
    color: #4338ca;
}

.project-status.status-on-hold {
    background: #fef3c7;
    color: #92400e;
}

/* 卡片主体 */
.project-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.info-label {
    color: #6b7280;
    font-weight: 500;
}

.info-value {
    color: #1f2937;
    font-weight: 600;
    text-align: right;
}

/* 卡片底部 */
.project-card-footer {
    padding: 1.25rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.progress-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
}

.progress-value {
    font-weight: 700;
    font-size: 1rem;
    color: #1e3a8a;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0891b2, #06b6d4);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* ===== 空状态 ===== */
.empty-state-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    min-height: 400px;
}

.empty-state-large .empty-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state-large h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.empty-state-large p {
    font-size: 1rem;
    color: #6b7280;
    margin: 0 0 2rem 0;
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
}

/* ===== 按钮样式 ===== */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* ===== 表单样式 ===== */
.form-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    #project-dashboard-container {
        padding: 1rem;
    }

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

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .project-card-header h3 {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .dashboard-header h2 {
        font-size: 1.5rem;
    }

    .project-card {
        border-radius: 8px;
    }

    .project-card-header,
    .project-card-body,
    .project-card-footer {
        padding: 1rem;
    }
}

/* ===== 加载动画 ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card {
    animation: fadeIn 0.3s ease;
}

.projects-grid .project-card:nth-child(1) { animation-delay: 0s; }
.projects-grid .project-card:nth-child(2) { animation-delay: 0.05s; }
.projects-grid .project-card:nth-child(3) { animation-delay: 0.1s; }
.projects-grid .project-card:nth-child(4) { animation-delay: 0.15s; }
.projects-grid .project-card:nth-child(5) { animation-delay: 0.2s; }
.projects-grid .project-card:nth-child(6) { animation-delay: 0.25s; }

/* 项目创建步骤指示器 */
.create-project-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.step.active,
.step.completed {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.step.active .step-number {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.step.completed .step-number {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}

.step.active .step-label {
    color: #1e3a8a;
}

.step.completed .step-label {
    color: #10b981;
}

.step-connector {
    width: 60px;
    height: 2px;
    background: #cbd5e1;
    margin: 0 1rem;
    position: relative;
    top: -10px;
}

/* 工序选择容器 */
.process-selection-container {
    margin: 1.5rem 0;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #f8fafc;
}

.process-selection-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.help-text {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.selection-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* 工序分类 */
.process-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.process-category {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.process-category:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-header {
    padding: 1rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.category-header:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
}

.category-info h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.category-count {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-left: 0.5rem;
}

.category-header .btn-icon-only {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.category-processes {
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.category-processes.collapsed {
    max-height: 0;
    overflow: hidden;
}

.category-processes.collapsed + .category-header .btn-icon-only {
    transform: rotate(-90deg);
}

/* 工序项 */
.process-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

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

.process-item:hover {
    background: #f8fafc;
}

.process-item input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.process-info {
    flex: 1;
}

.process-name {
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.process-code {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.process-quality {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* 选中计数 */
#selected-count {
    font-weight: 700;
    color: #1e3a8a;
}

/* 响应式 */
@media (max-width: 768px) {
    .create-project-steps {
        padding: 0.75rem;
    }
    
    .step-label {
        font-size: 0.8rem;
    }
    
    .step-connector {
        width: 40px;
        margin: 0 0.5rem;
    }
    
    .process-selection-container {
        max-height: 400px;
    }
    
    .category-header {
        padding: 0.75rem;
    }
    
    .process-item {
        padding: 0.6rem 0.75rem;
    }
}


/* ===== 删除确认模态框 ===== */
.confirm-delete {
    text-align: center;
    padding: 1rem 0;
}

.confirm-delete .warning-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.confirm-delete h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #dc2626;
    margin: 0 0 1rem 0;
}

.delete-warning-text {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.delete-items-list {
    text-align: left;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
}

.delete-items-list li {
    color: #991b1b;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    font-weight: 500;
}

.delete-final-warning {
    font-size: 0.95rem;
    color: #dc2626;
    font-weight: 600;
    margin-top: 1.5rem;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
