/* 블로그 글쓰기 페이지 전용 스타일 */

body {
    margin: 0;
    padding: 0;
    background: #f5f5f5;
}

.content-wrapper {
    min-height: calc(100vh - 70px);
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.content-header {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content-header h1 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.content-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.react-app-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.react-app-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 아코디언 스타일 */
.content-options-accordion {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

/* 심플 아코디언 스타일 (preset-empty와 유사한 스타일) */
.accordion-item {
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: #f9fafb;
}

.accordion-item.active .accordion-header {
    background: #f9fafb;
    color: #111827;
}

.accordion-header span:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.accordion-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
    color: #9ca3af;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    display: none !important;
    padding: 16px;
    background: white;
}

.accordion-item.active .accordion-content {
    display: block !important;
    padding: 16px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.option-select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #111827;
    cursor: pointer;
    transition: border-color 0.2s;
}

.option-select:hover {
    border-color: #9ca3af;
}

.option-select:focus {
    outline: none;
    border-color: #42a5f5;
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.options-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.btn-apply-options,
.btn-reset-options {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-apply-options {
    background: linear-gradient(135deg, #42a5f5 0%, #81d4fa 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(66, 165, 245, 0.3);
}

.btn-apply-options:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 165, 245, 0.4);
}

.btn-reset-options {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-reset-options:hover {
    background: #e5e7eb;
}

.btn-save-preset {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-save-preset:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* 옵션 섹션 스타일 */
.option-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
}

.option-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
}

/* 옵션 리스트 스타일 (한 줄 배치) */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.option-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    min-width: 140px;
    flex-shrink: 0;
}

.option-select-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: #111827;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 0;
}

.option-select-btn:hover {
    border-color: #42a5f5;
    background: #f0f9ff;
}

.option-select-btn:active {
    transform: scale(0.98);
}

.option-btn-text {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.option-btn-arrow {
    margin-left: 8px;
    color: #6b7280;
    font-size: 10px;
    flex-shrink: 0;
}

.option-select-hidden {
    display: none;
}

/* 옵션 선택 모달 */
.option-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.option-modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.option-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.option-modal-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.option-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.option-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.option-modal-body {
    padding: 8px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

.option-modal-item {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s;
    margin: 2px 0;
}

.option-modal-item:hover {
    background: #f3f4f6;
}

.option-modal-item.selected {
    background: #eff6ff;
    color: #1e40af;
    font-weight: 600;
}

/* 디자인 선택 모달 스타일 */
.design-modal-item {
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background: white;
    transition: all 0.2s;
    text-align: center;
}

.design-modal-item:hover {
    border-color: #42a5f5;
    box-shadow: 0 2px 8px rgba(66, 165, 245, 0.2);
    transform: translateY(-2px);
}

.design-modal-item.selected {
    border-color: #42a5f5;
    background: #eff6ff;
}

.design-modal-preview {
    margin-bottom: 8px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.design-modal-name {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-top: 8px;
}

.design-modal-custom {
    border-style: dashed;
}

/* 디자인 선택 섹션 */
.design-selection-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
}

.design-category {
    margin-bottom: 24px;
}

.design-category-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.design-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.design-preview-card {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.design-preview-card:hover {
    border-color: #42a5f5;
    box-shadow: 0 4px 12px rgba(66, 165, 245, 0.2);
    transform: translateY(-2px);
}

.design-preview-card.selected {
    border-color: #42a5f5;
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(66, 165, 245, 0.3);
}

.design-preview-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.design-preview-sample {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
    margin-top: 8px;
    padding: 8px;
    background: #f9fafb;
    border-radius: 4px;
    overflow: hidden;
}

.design-preview-sample h1,
.design-preview-sample h2,
.design-preview-sample p,
.design-preview-sample span,
.design-preview-sample table,
.design-preview-sample div {
    margin: 0;
    padding: 0;
}

/* 디자인 선택 섹션 스크롤 가능하도록 */
.design-selection-section {
    max-height: none;
    overflow: visible;
    width: 100%;
}

.design-category {
    margin-bottom: 32px;
    width: 100%;
}

.design-category:last-child {
    margin-bottom: 0;
}

/* 아코디언 내부 스크롤 최적화 */
.accordion-content {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f9fafb;
}

.accordion-content::-webkit-scrollbar {
    width: 8px;
}

.accordion-content::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 4px;
}

.accordion-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.accordion-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 사용자 정의 디자인 스타일 */
.design-custom-card {
    border: 2px dashed #9ca3af;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.design-custom-card:hover {
    border-color: #42a5f5;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.design-custom-card.selected {
    border-color: #42a5f5;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-style: solid;
}

.custom-design-input {
    margin-top: 24px;
    padding: 20px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    width: 100%;
}

.custom-design-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.custom-design-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.btn-close-custom {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-custom:hover {
    background: #f3f4f6;
    color: #111827;
}

.custom-design-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.custom-design-info {
    background: #eff6ff;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #42a5f5;
}

.custom-design-info p {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #1e40af;
}

.custom-design-info ul {
    margin: 0;
    padding-left: 20px;
    color: #374151;
    font-size: 14px;
    line-height: 1.8;
}

.custom-design-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-design-editor label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.custom-css-input {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    background: white;
    color: #111827;
}

.custom-css-input:focus {
    outline: none;
    border-color: #42a5f5;
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.1);
}

.custom-design-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-design-preview label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.preview-container {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    min-height: 100px;
}

.custom-preview-sample {
    width: 100%;
}

.custom-preview-sample h1,
.custom-preview-sample h2,
.custom-preview-sample p,
.custom-preview-sample span,
.custom-preview-sample div,
.custom-preview-sample table {
    margin: 0;
    padding: 0;
}

/* 프리셋 관리 섹션 스타일 */
.preset-management-section {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.preset-section-title {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    letter-spacing: -0.2px;
}

.preset-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-preset-save,
.btn-preset-load {
    flex: 1;
    padding: 10px 16px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-preset-save:hover,
.btn-preset-load:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-preset-save:active,
.btn-preset-load:active {
    transform: translateY(0);
    box-shadow: none;
}

.preset-btn-icon {
    font-size: 14px;
    line-height: 1;
}

.preset-btn-text {
    font-size: 13px;
    font-weight: 500;
}

.preset-list {
    max-height: 150px;
    overflow-y: auto;
    margin-top: 8px;
}

.preset-item {
    padding: 10px 12px;
    margin-bottom: 6px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-item:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateX(2px);
}

.preset-item-name {
    font-weight: 500;
    color: #111827;
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1.4;
}

.preset-item-desc {
    color: #6b7280;
    font-size: 11px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preset-empty {
    text-align: center;
    padding: 12px;
    color: #9ca3af;
    font-size: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.preset-error {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

#presetList::-webkit-scrollbar {
    width: 6px;
}

#presetList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#presetList::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

#presetList::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 색상 선택기 스타일 */
.color-preset-btn:hover {
    transform: scale(1.15);
    border-color: #111827 !important;
}

.color-preset-btn.selected {
    border: 3px solid #111827 !important;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 사용자 정의 색상 버튼 스타일 */
.color-custom-preset {
    position: relative;
}

.color-custom-preset:hover {
    z-index: 10;
}

#customColorPresets {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #d1d5db;
}

#customColorPresets:empty {
    display: none;
}

.custom-design-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.btn-apply-custom,
.btn-reset-custom {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-apply-custom {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-apply-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-reset-custom {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-reset-custom:hover {
    background: #e5e7eb;
}

@media (max-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .design-preview-grid {
        grid-template-columns: 1fr;
    }
}

