/* 
 * Asamiya PRO Editor CSS
 * Clean Modern Light Theme / 깔끔한 모던 라이트 테마
 */

.asamiya-editor-wrapper {
    width: 100%;
    border-radius: 12px;
    background: #ffffff; /* 흰색 배경 */
    border: 1px solid #ced4da;
    overflow: hidden;
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    color: #212529; /* 진한 회색 (본문 글자색) */
}

/* Toolbar Area / 툴바 영역 */
.asamiya-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
    background: #f8f9fa; /* 밝은 회색 배경 */
    border-bottom: 1px solid #e9ecef;
}

.asamiya-toolbar-group {
    display: flex;
    gap: 2px;
    padding-right: 10px;
    margin-right: 5px;
    border-right: 1px solid #dee2e6;
}

.asamiya-toolbar-group:last-child {
    border-right: none;
}

.asamiya-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #495057; /* 툴바 아이콘 색상 */
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.asamiya-btn:hover {
    background: #e2e6ea;
    color: #212529;
    border: 1px solid #dae0e5;
}

.asamiya-btn.active {
    background: #e7f5ff; /* 연한 파란색 배경 */
    color: #1c7ed6; /* 파란색 활성화 텍스트 */
    border: 1px solid #a5d8ff;
}

/* Select Box (Font size, etc.) / 셀렉트 박스 */
.asamiya-select {
    background: transparent;
    border: 1px solid transparent;
    color: #495057;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    padding: 0 5px;
    outline: none;
    transition: all 0.2s ease;
}

.asamiya-select:hover, .asamiya-select:focus {
    background: #e2e6ea;
    color: #212529;
    border: 1px solid #dae0e5;
}

.asamiya-select option {
    background: #ffffff;
    color: #212529;
}

/* Color Picker / 컬러 피커 */
.asamiya-color-picker {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    padding: 2px;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.asamiya-color-picker:hover {
    background: #e2e6ea;
}

/* Content Editable Area / 본문 편집 영역 */
.asamiya-content {
    padding: 20px;
    min-height: 250px;
    outline: none; 
    line-height: 1.6;
    font-size: 16px;
    overflow-y: auto;
    color: #333333;
}

.asamiya-content[data-placeholder]:empty:before {
    content: attr(data-placeholder);
    color: #adb5bd; /* 연한 회색 (플레이스홀더) */
    pointer-events: none;
    display: block;
}

/* Internal Element Styles / 본문 내부 요소 스타일 */
.asamiya-content p {
    margin: 0 0 1em 0;
}

.asamiya-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.asamiya-content iframe {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
    background: #000;
}

/* HTML Editing Area (Textarea) / HTML 편집 영역 */
.asamiya-html-area {
    display: none;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    background: #282c34; /* 개발자 모드는 다크테마 유지 */
    color: #abb2bf;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    border: none;
    outline: none;
    resize: none;
    overflow-y: auto;
}

.asamiya-content a {
    color: #1c7ed6;
    text-decoration: none;
}

.asamiya-content a:hover {
    text-decoration: underline;
}

.asamiya-content blockquote {
    border-left: 4px solid #1c7ed6;
    padding-left: 15px;
    margin-left: 0;
    color: #495057;
    font-style: italic;
    background: #f8f9fa;
    padding-top: 10px;
    padding-bottom: 10px;
    border-radius: 0 8px 8px 0;
}

.asamiya-content hr {
    border: 0;
    height: 1px;
    background: #dee2e6;
    margin: 20px 0;
}

.asamiya-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.asamiya-content table, .asamiya-content th, .asamiya-content td {
    border: 1px solid #dee2e6;
}

.asamiya-content th, .asamiya-content td {
    padding: 10px;
    text-align: left;
}

.asamiya-content th {
    background: #f1f3f5;
    font-weight: bold;
    color: #343a40;
}

/* =========================================================================
   [Asamiya PRO] AI Modal Styles (라이트 모드로 변경)
   ========================================================================= */
.asamiya-ai-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* 연한 딤 처리 */
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.asamiya-ai-modal-content {
    background: #ffffff; /* 모달창 흰색 */
    border: 1px solid #dee2e6;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    overflow: hidden;
    color: #212529; /* 진한 회색 */
    animation: asamiyaFadeIn 0.3s ease;
}

@keyframes asamiyaFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.asamiya-ai-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.asamiya-ai-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: #111;
}

.asamiya-ai-close {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.asamiya-ai-close:hover {
    color: #fa5252;
}

.asamiya-ai-modal-body {
    padding: 20px;
}

.asamiya-ai-field {
    margin-bottom: 15px;
}

.asamiya-ai-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: bold;
    color: #495057;
}

.asamiya-ai-field input,
.asamiya-ai-field select {
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    color: #212529;
    font-size: 14px;
    box-sizing: border-box;
}

.asamiya-ai-field input:focus,
.asamiya-ai-field select:focus {
    outline: none;
    border-color: #339af0;
    box-shadow: 0 0 0 3px rgba(51, 154, 240, 0.2);
}

.asamiya-ai-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    text-align: right;
}

.asamiya-ai-btn-generate {
    background: linear-gradient(135deg, #1c7ed6 0%, #339af0 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.asamiya-ai-btn-generate:hover {
    box-shadow: 0 4px 15px rgba(28, 126, 214, 0.3);
    transform: translateY(-1px);
}

.asamiya-ai-btn-generate:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.asamiya-btn-ai {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0 16px !important;
    border-radius: 20px !important;
    font-weight: 800 !important;
    width: auto !important;
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.3);
    animation: asamiyaPulse 2s infinite;
    letter-spacing: 0.5px;
    font-size: 13px !important;
}

.asamiya-btn-ai i {
    margin-right: 6px;
    font-size: 14px;
}

.asamiya-btn-ai:hover {
    background: linear-gradient(135deg, #ff4b2b 0%, #ff416c 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 65, 108, 0.4);
}

@keyframes asamiyaPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 65, 108, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 65, 108, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 65, 108, 0); }
}
