/* src/main/resources/static/css/codeblock-generator.css */

.codeblock-generator-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* 섹션 공통 */
.codeblock-section {
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E0E0E0;
}

/* 코드 입력 영역 */
.code-input-area {
    position: relative;
}

.code-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    resize: vertical;
    background: #FAFAFA;
}

.code-textarea:focus {
    outline: none;
    border-color: #319C80;
    background: #fff;
}

/* 설정 영역 */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.setting-select {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.setting-select:focus {
    outline: none;
    border-color: #319C80;
}

.setting-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    padding: 10px 0;
}

.setting-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: #319C80;
}

.setting-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.setting-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
}

.setting-input:focus {
    outline: none;
    border-color: #319C80;
}

.setting-color {
    width: 50px;
    height: 40px;
    padding: 2px;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    cursor: pointer;
}

/* 미리보기 영역 */
.preview-container {
    background: #1E1E1E;
    border-radius: 12px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #2D2D2D;
    border-bottom: 1px solid #404040;
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #999;
}

.preview-lang {
    padding: 4px 10px;
    background: #404040;
    border-radius: 4px;
    font-size: 12px;
    color: #ccc;
}

.preview-copy-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.preview-body {
    display: flex;
    overflow-x: auto;
}

.line-numbers {
    padding: 16px 12px;
    background: #252526;
    color: #858585;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    text-align: right;
    user-select: none;
    border-right: 1px solid #404040;
}

.code-content {
    flex: 1;
    padding: 16px;
    color: #D4D4D4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
}

/* 코드 출력 */
.code-output {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.output-block {
    position: relative;
}

.output-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.output-label span {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.copy-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #319C80;
    background: #F0FAF7;
    border: 1px solid #319C80;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    color: #fff;
    background: #319C80;
}

.output-code {
    background: #1E1E1E;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}

.output-code pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #D4D4D4;
    white-space: pre-wrap;
    word-break: break-all;
}

.copy-all-btn {
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #319C80;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    align-self: flex-start;
}

.copy-all-btn:hover {
    background: #28816c;
}

/* 테마 프리셋 */
.theme-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.theme-preset {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-preset:hover {
    transform: scale(1.1);
}

.theme-preset.active {
    border-color: #319C80;
    box-shadow: 0 0 0 2px rgba(49, 156, 128, 0.3);
}

/* 토스트 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 반응형 */
@media (max-width: 768px) {
    .codeblock-generator-wrapper {
        padding: 0 16px 30px;
    }

    .codeblock-section {
        padding: 20px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .preview-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .code-textarea {
        min-height: 150px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 16px;
    }

    .code-content,
    .line-numbers {
        font-size: 12px;
    }

    .theme-preset {
        width: 32px;
        height: 32px;
    }
}
