/* 디자인 선택 페이지 스타일 */

/* 디자인 히어로 섹션 */
.design-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.design-hero h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.design-hero .subtitle {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 24px;
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.trust-badges .badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* 필터 섹션 */
.filter-section {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.filter-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-tab {
    background: white;
    border: 2px solid #dee2e6;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-tab:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.filter-tab.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* 안경 그리드 섹션 */
.frame-grid-section {
    padding: 60px 20px;
    background: white;
}

.frames-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.frames-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.frame-count {
    color: #667eea;
    font-weight: 700;
}

.sort-options select {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* 로딩 스피너 */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 16px;
}

.loading-spinner p {
    font-size: 16px;
    color: #6c757d;
}

/* 안경 카드 그리드 */
.frame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.frame-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.frame-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.frame-card .ai-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.frame-card .frame-image {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.frame-card .frame-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.frame-card .frame-placeholder {
    font-size: 64px;
    color: #dee2e6;
}

.frame-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #212529;
}

.frame-card .frame-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.frame-card .detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #6c757d;
}

.frame-card .frame-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.frame-card .tag {
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #495057;
}

.frame-card .frame-price {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
}

.frame-card .try-button {
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.frame-card .try-button:hover {
    background: #5568d3;
    transform: scale(1.02);
}

/* 가상 착용 모달 */
.tryon-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tryon-modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 24px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10000;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f8f9fa;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e9ecef;
    transform: scale(1.1);
}

.tryon-header {
    text-align: center;
    margin-bottom: 24px;
}

.tryon-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tryon-header .hint {
    font-size: 14px;
    color: #6c757d;
}

/* 카메라 컨테이너 */
.camera-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
}

#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#overlayCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.face-guide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.face-guide.hidden {
    display: none;
}

.guide-box {
    text-align: center;
    color: white;
}

.guide-box i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.guide-box p {
    font-size: 16px;
}

/* 착용 정보 */
.tryon-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: 12px;
}

.fit-score {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fit-score .label {
    font-size: 14px;
    color: #6c757d;
}

.fit-score .score {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.fit-score .stars {
    color: #ffc107;
    font-size: 18px;
}

/* 액션 버튼 */
.tryon-actions {
    display: flex;
    gap: 12px;
}

.tryon-actions button {
    flex: 1;
    padding: 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    color: #495057;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: scale(1.02);
}

.btn-primary {
    background: #667eea;
    border: 2px solid #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: scale(1.02);
}

/* 모바일 최적화 */
@media (max-width: 767px) {
    .design-hero h1 {
        font-size: 24px;
    }
    
    .design-hero .subtitle {
        font-size: 16px;
    }
    
    .filter-tabs {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 8px;
    }
    
    .filter-tab {
        flex-shrink: 0;
    }
    
    .frame-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .frames-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .modal-content {
        padding: 20px;
        max-height: 95vh;
    }
    
    .tryon-actions {
        flex-direction: column;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .frame-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .frame-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
