/* 성능 최적화: 필요한 요소에만 전환 효과 적용 */
.option-card, .card, button { 
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease; 
}

/* 테마 변수 */
.theme-light { 
    --bg-primary: #ffffff; 
    --bg-secondary: #f8fafc; 
    --text-primary: #1e293b; 
    --text-secondary: #64748b; 
    --border: #e2e8f0;
    --card-bg: #ffffff;
    --hover-bg: #f1f5f9;
}
.theme-dark { 
    --bg-primary: #0f172a; 
    --bg-secondary: #1e293b; 
    --text-primary: #f1f5f9; 
    --text-secondary: #cbd5e1; 
    --border: #334155;
    --card-bg: #1e293b;
    --hover-bg: #334155;
}

body { 
    background: var(--bg-primary); 
    color: var(--text-primary); 
    font-family: 'Pretendard', 'Inter', sans-serif; 
    /* 성능 최적화 */
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.card { 
    background: var(--card-bg); 
    border: 1px solid var(--border); 
}

.option-card { 
    cursor: pointer; 
    transform: scale(1); 
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    will-change: transform, box-shadow;
}

.option-card:hover { 
    transform: scale(1.02); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.15); 
    background: var(--hover-bg);
}

.option-card.selected { 
    border-color: #3b82f6; 
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); 
    background: rgba(59, 130, 246, 0.05);
}

.preview-container { 
    min-height: 120px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
}

/* 레이아웃 미리보기 */
.layout-preview {
    width: 100%;
    height: 80px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.layout-sidebar {
    width: 20%;
    height: 100%;
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    opacity: 0.8;
}

.layout-header {
    height: 30%;
    background: linear-gradient(45deg, #64748b, #475569);
    opacity: 0.6;
}

.layout-content {
    height: 70%;
    background: linear-gradient(45deg, #e2e8f0, #cbd5e1);
    opacity: 0.4;
}

/* 컬러 미리보기 */
.color-preview {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* 애니메이션 미리보기 */
.animation-preview {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.animation-demo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    animation: bounce 2s infinite;
    background: transparent;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* 폰트 미리보기 */
.font-preview {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    padding: 10px;
}

/* 그리드 미리보기 */
.grid-preview {
    width: 100%;
    height: 80px;
    display: grid;
    gap: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
}

.grid-item {
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    border-radius: 2px;
    opacity: 0.7;
}

.grid-flex .grid-item {
    flex-grow: 1;
    width: 30%;
}

/* 컴포넌트 미리보기 */
.component-preview {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    gap: 8px;
}

.component-demo {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* 공간 미리보기 */
.spacing-preview {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    gap: 8px;
}

.spacing-demo {
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    border-radius: 4px;
}

/* 반응형 미리보기 */
.responsive-preview {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    gap: 8px;
}

.responsive-demo {
    height: 40px;
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    border-radius: 4px;
    opacity: 0.8;
}

/* 성능 미리보기 */
.performance-preview {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.performance-demo {
    width: 60px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.performance-demo .fas {
    color: var(--text-primary);
}

/* 컬러별 스타일 */
.color-ocean .color-preview { background: linear-gradient(45deg, #0ea5e9, #0284c7); }
.color-forest .color-preview { background: linear-gradient(45deg, #10b981, #059669); }
.color-sunset .color-preview { background: linear-gradient(45deg, #f59e0b, #d97706); }
.color-royal .color-preview { background: linear-gradient(45deg, #8b5cf6, #7c3aed); }
.color-minimal .color-preview { background: linear-gradient(45deg, #6b7280, #4b5563); }
.color-vibrant .color-preview { background: linear-gradient(45deg, #ec4899, #db2777); }
.color-tech .color-preview { background: linear-gradient(45deg, #1f2937, #111827); }
.color-warm .color-preview { background: linear-gradient(45deg, #a16207, #92400e); }
.color-arctic .color-preview { background: linear-gradient(45deg, #f8fafc, #e2e8f0); color: #1f2937; }

/* 애니메이션별 스타일 - 모든 옵션을 동일한 파란색으로 */
.animation-slide .animation-demo,
.animation-bounce .animation-demo,
.animation-fade .animation-demo,
.animation-scale .animation-demo,
.animation-rotate .animation-demo,
.animation-parallax .animation-demo { 
    background: linear-gradient(45deg, #3b82f6, #1d4ed8) !important;
}

.animation-slide .animation-demo { animation: slide 2s infinite; }
.animation-bounce .animation-demo { animation: bounce 2s infinite; }
.animation-fade .animation-demo { animation: fade 2s infinite; }
.animation-scale .animation-demo { animation: scale 2s infinite; }
.animation-rotate .animation-demo { animation: rotate 2s infinite; }
.animation-parallax .animation-demo { animation: parallax 2s infinite; }

@keyframes slide {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(20px); }
}

@keyframes fade {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes parallax {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.1); }
}

/* 폰트별 스타일 */
.font-modern .font-preview { font-family: 'Inter', sans-serif; font-weight: 600; }
.font-classic .font-preview { font-family: 'Georgia', serif; font-weight: 400; }
.font-tech .font-preview { font-family: 'Courier New', monospace; font-weight: 500; }
.font-elegant .font-preview { font-family: 'Pacifico', 'Jua', cursive; font-weight: 400; }
.font-corporate .font-preview { font-family: 'Roboto', sans-serif; font-weight: 500; }
.font-creative .font-preview { font-family: 'Poppins', sans-serif; font-weight: 600; }

/* 그리드별 스타일 */
.grid-12column .grid-preview { grid-template-columns: repeat(12, 1fr); }
.grid-cssgrid .grid-preview { grid-template-columns: repeat(6, 1fr); }
.grid-flexbox .grid-preview { display: flex; flex-wrap: wrap; }
.grid-bootstrap .grid-preview { grid-template-columns: repeat(4, 1fr); }
.grid-custom .grid-preview { grid-template-columns: repeat(8, 1fr); }

/* 컴포넌트별 스타일 */
.component-rounded .component-demo { border-radius: 12px; background: linear-gradient(45deg, #3b82f6, #1d4ed8); color: white; }
.component-sharp .component-demo { border-radius: 0; background: linear-gradient(45deg, #1f2937, #374151); color: white; }
.component-glass .component-demo { border-radius: 8px; background: rgba(59, 130, 246, 0.2); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.2); }
.component-neumorphism .component-demo { border-radius: 8px; background: #e5e7eb; box-shadow: 5px 5px 10px #d1d5db, -5px -5px 10px #ffffff; }
.component-minimal .component-demo { border-radius: 4px; background: #f3f4f6; border: 1px solid #d1d5db; color: #374151; }
.component-retro .component-demo { border-radius: 0; background: linear-gradient(45deg, #f59e0b, #d97706); color: white; border: 2px solid #92400e; }

.theme-light .component-glass .component-demo { background: rgba(0, 0, 0, 0.05); color: var(--text-primary); }

/* 공간별 스타일 */
.spacing-tight .spacing-demo { margin: 4px; }
.spacing-standard .spacing-demo { margin: 8px; }
.spacing-loose .spacing-demo { margin: 16px; }
.spacing-luxury .spacing-demo { margin: 24px; }

/* 반응형별 스타일 */
.responsive-mobilefirst .responsive-demo:nth-child(1) { width: 60%; }
.responsive-mobilefirst .responsive-demo:nth-child(2) { width: 30%; }
.responsive-desktopfirst .responsive-demo:nth-child(1) { width: 40%; }
.responsive-desktopfirst .responsive-demo:nth-child(2) { width: 50%; }
.responsive-progressive .responsive-demo:nth-child(1) { width: 50%; }
.responsive-progressive .responsive-demo:nth-child(2) { width: 40%; }
.responsive-adaptive .responsive-demo:nth-child(1) { width: 45%; }
.responsive-adaptive .responsive-demo:nth-child(2) { width: 45%; }



/* 도움말 모달 */
.help-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.help-content {
    background: var(--card-bg);
    margin: 5% auto;
    padding: 20px;
    border-radius: 12px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

/* Font Awesome 아이콘 색상 조정 - 라이트/다크모드 모두 */
.theme-light .fas {
    color: var(--text-primary) !important;
}

.theme-dark .fas {
    color: #e2e8f0 !important;
}

.theme-light .text-gray-600 {
    color: var(--text-primary) !important;
}

.theme-dark .text-gray-600 {
    color: #e2e8f0 !important;
}

.theme-dark .dark\\:text-gray-300 {
    color: #e2e8f0 !important;
}

/* 헤더 버튼 강제 표시 */
header button {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 헤더 아이콘 강제 표시 */
header .fas {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 헤더 버튼 스타일 */
.header-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.header-btn:hover {
    background: #e5e7eb;
}

.header-btn i {
    color: #374151;
}

/* 다크모드 헤더 버튼 스타일 */
.theme-dark .header-btn {
    background: #111827;
    border: 1px solid #374151;
}

.theme-dark .header-btn:hover {
    background: #1f2937;
}

.theme-dark .header-btn i {
    color: #e5e7eb;
}

/* 테마 토글 버튼 스타일 */
#themeToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
