/* static/css/inpainting.css */
body {
    font-family: 'Comic Sans MS', 'Chalkboard', sans-serif;
    background: linear-gradient(to bottom, #ffefd5, #ffe4e1);
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.title {
    text-align: center;
    font-size: 2rem;
    color: #ff69b4;
    margin-bottom: 20px;
}

/* 选择图片的样式 */
.image-selection {
    margin-top: 20px;
}

.image-list img {
    max-width: 100px;
    margin: 5px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.image-list img:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.image-list img.selected {
    border: 3px solid #ff69b4;
}

.process-button {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background: #ff69b4;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.process-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

.status-message {
    text-align: center;
    margin-top: 20px;
    font-size: 1rem;
}

.preview-container {
    margin-top: 20px;
    text-align: center;
}

/* 图片列表容器 */
.image-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* 使用minmax确保列宽不会超出 */
    gap: 10px; /* 图片之间的间距 */
    justify-items: center; /* 图片水平居中 */
    align-items: start; /* 确保图片顶部对齐，允许高度不同 */
    width: 100%; /* 确保列表使用全部可用宽度 */
}

/* 单个图片容器 */
.image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%; /* 确保容器宽度填满网格单元格 */
}

/* 图片样式 */
.image-container img {
    width: 100%; /* 使用百分比宽度，让图片填满容器 */
    max-width: 240px; /* 设置最大宽度 */
    height: auto; /* 高度按比例调整 */
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.image-container img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

/* 文件名样式 */
.file-name {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #555;
    text-align: center;
    max-width: 240px; /* 文件名宽度与图片宽度一致 */
    white-space: nowrap; /* 禁止换行 */
    overflow: hidden; /* 超出部分隐藏 */
    text-overflow: ellipsis; /* 超出部分显示省略号 */
}

/* 平板设备（屏幕宽度 ≤ 768px，改为3列） */
@media (max-width: 768px) {
    .image-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 手机设备（屏幕宽度 ≤ 480px，改为2列） */
@media (max-width: 480px) {
    .image-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 超小手机（屏幕宽度 ≤ 320px，改为1列） */
@media (max-width: 320px) {
    .image-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .file-name {
        white-space: normal; /* 允许换行 */
        word-break: break-word; /* 防止长单词溢出 */
        font-size: 0.8rem; /* 调整字体大小 */
        max-width: 100%; /* 文件名宽度与图片宽度一致 */
    }
}

/* 针对屏幕宽度小于 768px 的设备（如手机） */
@media (max-width: 768px) {
    .title {
        font-size: 1.5rem; /* 缩小字体大小以适应屏幕 */
    }
}

/* 描述性说明样式 */
.description {
    font-size: 1rem; /* 设置文字大小 */
    text-align: center; /* 居中对齐 */
    color: #666; /* 设置文字颜色 */
    margin-bottom: 20px; /* 与下方内容保持间距 */
    line-height: 1.5; /* 设置行高，提升可读性 */
}

/* 新增样式 */
.options-section {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.option-group {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 105, 180, 0.05);
    border-radius: 10px;
}

.option-group h3 {
    margin-top: 0;
    color: #ff69b4;
    font-size: 1.2rem;
}

/* 调整预览容器位置 */
.preview-container {
    margin: 20px 0;
    text-align: center;
    border: 1px dashed #ddd;
    padding: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
}

/* 调整处理按钮位置和样式 */
.process-button {
    display: block;
    margin: 0 auto 25px;
    padding: 12px 30px;
    background: #ff69b4;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 80%;
    max-width: 300px;
}

.process-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
    background: #ff1493;
}

/* 进度条相关改动*/
/* 结果容器 */
.result-container {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 1px dashed #ddd;
}

/* 进度条区域 */
.progress-section {
    text-align: center;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(to right, #ff69b4, #ff1493);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 1rem;
    color: #666;
    margin-bottom: 10px;
}

.progress-hint {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.5;
}

.progress-hint a {
    color: #ff69b4;
    text-decoration: none;
}

.progress-hint a:hover {
    text-decoration: underline;
}

/* 结果图片区域 */
.result-image-container {
    text-align: center;
}

.result-image-container h3 {
    color: #ff69b4;
    margin-top: 0;
}

.preview-container img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 多图片布局样式 : 生成并返回多张图片 */
.preview-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.result-image-wrapper {
    position: relative;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 10px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.result-image-wrapper img {
    width: 100%;
    border-radius: 5px;
    display: block;
}

.download-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px 0;
    background: linear-gradient(to right, #ff69b4, #ff1493);
    color: white;
    text-align: center;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.download-btn:hover {
    background: linear-gradient(to right, #ff1493, #ff69b4);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 105, 180, 0.3);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .preview-container {
        grid-template-columns: 1fr;
    }
}

/* 返回按钮样式 : 生成图片的展示，支持点击放大*/
.back-button {
    background: none;
    border: none;
    color: #ff69b4;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.back-button:hover {
    color: #ff1493;
    transform: translateX(-3px);
}

/* 图片模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover {
    color: #ff69b4;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
    }
    
    .close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
}

.process-button:disabled {
    background: #ccc !important;
    transform: none !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

.estimated-time {
    color: #ff6b00;  /* 橙色强调 */
    font-weight: bold;
    font-size: 1.1em;
}

/* 预估时间特殊样式 */
.estimated-time {
    color: #ff6b00;       /* 醒目的橙色 */
    font-weight: 700;     /* 加粗 */
    padding: 0 2px;       /* 左右留点空间 */
}

/* 如果是排队状态，可以更突出显示 */
.progress-hint .estimated-time {
    animation: pulse 1.5s infinite; /* 添加脉动动画 */
}

@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.8; }
}

/* 确保关闭按钮可点击 */
.close-btn {
    cursor: pointer;
    font-size: 24px;
}
