/* Explore Designs Component Styles */

/* Explore Designs 容器 */
.explore-designs-container {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 600px;
    overflow-x: hidden;
}

/* 合集网格 */
.collections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 60px;
}

/* 合集卡片 */
.collection-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.collection-card:hover {
}

/* Banner背景hover效果 - 快速过渡避免突兀 */
.collection-card[data-banner-url]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    padding-bottom: 33.33%;

    /* 渐变叠加在图片之上：透明 => 图片可见（右上），不透明 => 图片被遮住（左下） */
    background:
      linear-gradient(180deg, rgba(255,255,255,0) 20%, rgba(255,255,255,1) 99%),
      var(--banner-url);

    background-size: cover;
    background-position: center; /* 保持你原来的位置 */
    background-repeat: no-repeat;

    /* 向右平移50%，然后以右上角为旋转中心顺时针旋转45度 */
    /* 试上下微位移：把 -0.5px 改成 +0.5px/ -1px 等做试验 */
    transform: translateX(50%) translateY(-0.5px) rotate(45deg);
    transform-origin: 50% 0%;
    will-change: transform, opacity;
    transform-origin: 50% 0%;

    opacity: 0;               /* 默认隐藏 */
    transition: opacity 0.3s ease;
    pointer-events: none;     /* 不阻塞卡片内的交互 */
}
/* hover 时淡入（右上角带渐变显现） */
.collection-card[data-banner-url]:hover::before {
    opacity: 1;
}

/* Banner背景效果 - 使用伪元素，只在hover时显示 */
/* .collection-card[data-banner-url]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--banner-url);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    border-radius: 8px;
}

/* 确保卡片内容在banner背景之上 */
.collection-header,
.svg-previews {
    position: relative;
    z-index: 1;
}


/* 合集头部 */
.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    min-height: 60px;
    width: 100%;
    box-sizing: border-box;
}

.collection-title {
    font-size: 18px;
    font-weight: 500;
    color: #2c2c2c;
    margin: 0;
    letter-spacing: 0.5px;
}

.collection-title:hover {
    color: #666;
}

.collection-title .arrow {
    color: #666;
    font-weight: normal;
    margin-left: 4px;
}

/* SVG预览区域 */
.svg-previews {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 20px;
    min-height: 100px;
}

.svg-preview {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.svg-preview img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    will-change: transform;
    transform: translateZ(0);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.svg-preview:hover {
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6) 0%, transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(220, 220, 220, 0.4) 0%, transparent 60%),
        rgba(240, 240, 240, 0.7);
    /* box-shadow: 
        inset 0 1px 3px rgba(255, 255, 255, 0.8),
        inset 0 -1px 3px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.3); */
}

.svg-preview.empty {
    background: #ffffff;
    border: 1px dashed #ccc;
    color: #bbb;
    font-size: 18px;
    font-weight: 300;
}

.svg-preview.empty:hover {
    border-color: #999;
    color: #777;
}

/* 合集操作区域 */
.collection-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-width: 100px;
    flex-shrink: 0;
}

.action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    line-height: 1;
}

.add-btn {
    background: #333333;
    color: white;
}

.add-btn:hover {
    background: #000000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.add-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.add-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.remove-btn {
    background: #dc3545;
    color: white;
}

.remove-btn:hover {
    background: #c82333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.status-added {
    color: #28a745;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* 创建合集卡片 */
.create-collection-card {
    background: #f5f5f5;
    border: none;
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #2c2c2c;
    cursor: pointer;
    text-align: center;
    gap: 15px;
    width: 100%;
    height: 180px;
}

.create-collection-card:hover {
    /* transform: translateY(-2px); */
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); */
}

.create-icon {
    font-size: 36px;
    font-weight: 300;
    color: #666;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.create-modal-content {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 20px;
}

.create-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.create-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #f0f0f0;
}

.modal-body {
    padding: 0;
}

.input-group {
    margin-bottom: 20px;
}

#collection-name-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: #f9f9f9;
    box-sizing: border-box;
}

#collection-name-input:focus {
    outline: none;
    border-color: #000000;
    background: #ffffff;
}

.validation-rules {
    margin-bottom: 20px;
    min-height: 30px;
}

.rule-item {
    color: #dc3545;
    font-size: 14px;
    margin-bottom: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-continue {
    background: #333333;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-continue:hover {
    background: #000000;
}

.btn-continue:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.create-collection-card h3 {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    margin: 0;
    line-height: 1.4;
    color: #2c2c2c;
}

.collection-status {
    color: #28a745;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
    transition: color 0.2s ease;
}

.collection-status:hover {
    color: #dc3545;
}

.collection-status.loading {
    opacity: 0.7;
    cursor: not-allowed;
    color: #6b7280;
}

/* 分页控件样式 */
.pagination-controls {
    margin-top: 30px;
    text-align: center;
}

.pagination-controls ul.page-numbers {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-controls ul.page-numbers li {
    margin: 0 6px;
}

.pagination-controls ul.page-numbers li a,
.pagination-controls ul.page-numbers li span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s, color 0.3s;
    height: 34px;
    box-sizing: border-box;
    line-height: 18px;
    vertical-align: middle;
}

.pagination-controls ul.page-numbers li a:hover {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

.pagination-controls ul.page-numbers li .current {
    background-color: #333;
    color: #fff;
    border-color: #333;
    pointer-events: none;
    cursor: default;
}

.pagination-controls ul.page-numbers li .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f9f9f9;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .explore-designs-container {
        padding: 30px 15px;
    }
    
    .collections-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .collection-header {
        padding: 10px 15px;
    }
    
    .svg-previews {
        padding: 0 15px 15px;
    }
    
    .svg-preview {
        width: 70px;
        height: 70px;
    }
    
    .svg-preview img {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 768px) {
    .collection-status {
        color: #dc3545;
    }
    .explore-designs-container {
        padding: 20px 15px;
    }
    
    .collections-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .collection-card {
        padding: 0;
    }
    
    .collection-header {
        padding: 15px;
        min-height: 50px;
    }
    
    .collection-title {
        font-size: 16px;
    }
    
    .svg-previews {
        justify-content: space-between;
        gap: 8px;
        padding: 0 15px 15px;
    }
    
    .svg-preview {
        width: 60px;
        height: 60px;
    }

    .svg-preview img {
        width: 45px;
        height: 45px;
    }
    
    .action-btn {
        padding: 8px 16px;
        font-size: 13px;
        height: 36px;
    }
    
    .create-modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .create-modal-header h3 {
        font-size: 20px;
    }
    
    #collection-name-input {
        padding: 10px 14px;
        font-size: 16px;
    }
    
    .btn-continue {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .pagination-controls {
        margin-top: 20px;
    }
    
    .pagination-controls ul.page-numbers li {
        margin: 0 3px;
    }
    
    .pagination-controls ul.page-numbers li a,
    .pagination-controls ul.page-numbers li span {
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .explore-designs-container {
        padding: 15px 10px;
    }
    
    .collections-grid {
        gap: 15px;
    }
    
    .collection-card {
        padding: 0;
    }
    
    .collection-header {
        padding: 12px;
        min-height: 45px;
    }
    
    .collection-title {
        font-size: 15px;
    }
    
    .svg-previews {
        gap: 6px;
        padding: 0 12px 12px;
    }
    
    .svg-preview {
        width: 60px;
        height: 60px;
    }
    
    .action-btn {
        padding: 6px 12px;
        font-size: 12px;
        height: 32px;
    }
    
    .create-collection-card {
        padding: 20px;
        height: 160px;
    }
    
    .create-collection-card h3 {
        font-size: 14px;
    }
    
    .create-icon {
        font-size: 32px;
    }
}
