/* ===================================================
   Restart AI Recommend - 프론트엔드 스타일
   =================================================== */

/* ── 전체 래퍼 ── */
.restart-ai-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
}

/* ── 업로드 폼 ── */
.ai-upload-form {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    margin-bottom: 32px;
}

/* ── 업로드 영역 ── */
.ai-upload-area {
    position: relative;
}

.ai-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fafafa;
}

.ai-upload-label:hover {
    border-color: #1a1a2e;
    background: #f5f5f5;
}

.ai-upload-label svg {
    width: 48px;
    height: 48px;
    color: #999;
    margin-bottom: 16px;
}

.ai-upload-label span {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.ai-upload-label small {
    font-size: 13px;
    color: #999;
}

.ai-upload-area input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

/* ── 미리보기 ── */
.ai-preview {
    position: relative;
    text-align: center;
    margin-top: 20px;
}

.ai-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.ai-remove-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-remove-btn:hover {
    background: rgba(0,0,0,0.8);
}

/* ── 제출 버튼 ── */
.ai-submit-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 24px auto 0;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #1a1a2e;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ai-submit-btn:hover:not(:disabled) {
    background: #2e2e50;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26,26,46,0.3);
}

.ai-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ── 로딩 ── */
.ai-loading {
    text-align: center;
    padding: 40px 20px;
}

.ai-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #1a1a2e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ai-loading p {
    font-size: 15px;
    color: #666;
    margin: 0;
}

/* ── 결과 그리드 ── */
.ai-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.ai-artwork {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.25s, box-shadow 0.25s;
}

.ai-artwork:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}

.ai-artwork a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.ai-artwork img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.35s;
}

.ai-artwork:hover img {
    transform: scale(1.05);
}

.ai-artwork-info {
    padding: 16px;
}

.ai-artwork h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-artwork p {
    font-size: 13px;
    color: #888;
    margin: 0 0 8px;
}

.ai-artwork-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-top: 10px;
}

.ai-artwork-price {
    font-weight: 600;
    color: #1a1a2e;
}

.ai-artwork-category {
    background: #f0f0f5;
    padding: 3px 10px;
    border-radius: 12px;
    color: #666;
}

/* ── 반응형 ── */
@media (max-width: 600px) {
    .restart-ai-wrapper {
        padding: 24px 16px;
    }

    .ai-upload-form {
        padding: 24px 16px;
    }

    .ai-result-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
}
