/**
 * 编辑和删除模态框样式
 */

/* 删除确认模态框 */
.exercise-delete-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

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

.exercise-delete-modal-content {
    background: white;
    border-radius: 15px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.exercise-delete-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #ff4757 0%, #ee5a6f 100%);
    color: white;
}

.exercise-delete-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.exercise-delete-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.exercise-delete-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.exercise-delete-modal-body {
    padding: 25px;
}

.exercise-delete-modal-body p {
    margin: 0 0 15px;
    color: #333;
    line-height: 1.6;
}

.exercise-delete-warning {
    color: #ff4757;
    font-weight: 600;
    margin-top: 20px !important;
}

.exercise-delete-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.exercise-delete-input:focus {
    outline: none;
    border-color: #ff4757;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.1);
}

.exercise-delete-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.exercise-delete-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.exercise-tracker-btn-danger {
    background: #ff4757;
    color: white;
}

.exercise-tracker-btn-danger:hover:not(:disabled) {
    background: #ee5a6f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

.exercise-tracker-btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 编辑模态框 */
.exercise-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.exercise-edit-modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    margin: auto;
}

.exercise-edit-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--theme-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

.exercise-edit-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.exercise-edit-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.exercise-edit-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.exercise-edit-modal form {
    padding: 25px;
}

.exercise-edit-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    background: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .exercise-delete-modal-content,
    .exercise-edit-modal-content {
        max-width: 100%;
        margin: 0;
        border-radius: 15px 15px 0 0;
        max-height: 90vh;
    }
    
    .exercise-delete-modal,
    .exercise-edit-modal {
        align-items: flex-end;
        padding: 0;
    }
    
    .exercise-edit-modal-header {
        position: sticky;
        top: 0;
    }
}

/* 滚动条样式 */
.exercise-edit-modal-content::-webkit-scrollbar {
    width: 8px;
}

.exercise-edit-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.exercise-edit-modal-content::-webkit-scrollbar-thumb {
    background: var(--theme-primary, #667eea);
    border-radius: 10px;
}

.exercise-edit-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--theme-secondary, #764ba2);
}

/* ========== 预览弹窗（记录详情） ========== */
.exercise-preview-modal .exercise-preview-content {
    max-width: 420px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
}

.exercise-preview-modal .exercise-preview-header {
    padding: 18px 22px;
    border-bottom: none;
}

.exercise-preview-modal .exercise-preview-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.exercise-preview-modal-body {
    padding: 1rem;
    background: #fafbfc;
}

.exercise-preview-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8eaed;
}

.exercise-preview-type {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--theme-primary, #667eea);
    letter-spacing: 0.02em;
}

.exercise-preview-date {
    font-size: 0.875rem;
    color: #6b7280;
    flex-shrink: 0;
}

.exercise-preview-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 16px;
    margin-bottom: 0;
}

.exercise-preview-modal-body .exercise-preview-details .exercise-tracker-detail-item {
    background: #fff;
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
}

.exercise-preview-modal-body .exercise-preview-details .exercise-tracker-detail-label {
    font-size: 0.8rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.exercise-preview-modal-body .exercise-preview-details .exercise-tracker-detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
}

.exercise-preview-notes {
    margin-top: 20px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 12px;
    border-left: 4px solid var(--theme-primary, #667eea);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.exercise-preview-notes-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.exercise-preview-notes-text {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.exercise-preview-footer {
    padding: 18px 22px;
    border-top: 1px solid #e8eaed;
    background: #fff;
    display: flex;
    justify-content: center;
}

.exercise-preview-footer .exercise-preview-close {
    min-width: 120px;
}

@media (max-width: 768px) {
    .exercise-preview-modal .exercise-preview-content {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }
}
