/* src/main/resources/static/css/button-generator.css */

.button-generator-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* 섹션 공통 */
.btn-gen-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;
}

/* 템플릿 그리드 */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.template-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: #F9F9F9;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.template-item:hover {
    background: #F0FAF7;
    border-color: #319C80;
}

.template-item.active {
    background: #F0FAF7;
    border-color: #319C80;
}

.template-name {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* 미리보기 영역 */
.preview-area {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-conic-gradient(#F5F5F5 0% 25%, #fff 0% 50%) 50% / 20px 20px;
    border-radius: 8px;
    padding: 40px;
}

/* 설정 탭 */
.settings-tabs {
    display: flex;
    gap: 4px;
    background: #F5F5F5;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.settings-tab {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.settings-tab:hover {
    color: #319C80;
}

.settings-tab.active {
    background: #319C80;
    color: #fff;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

/* 설정 그룹 */
.setting-group {
    margin-bottom: 20px;
}

.setting-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.setting-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.setting-input {
    flex: 1;
    min-width: 150px;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
}

.setting-input:focus {
    outline: none;
    border-color: #319C80;
}

.setting-input-small {
    width: 80px;
    flex: none;
}

.setting-color {
    width: 50px;
    height: 40px;
    padding: 2px;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    cursor: pointer;
}

.setting-select {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    background: #fff;
    min-width: 150px;
}

.setting-range {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #E0E0E0;
    border-radius: 3px;
    outline: none;
}

.setting-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #319C80;
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    min-width: 50px;
    text-align: center;
    font-size: 14px;
    color: #333;
}

.setting-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.setting-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: #319C80;
}

/* 코드 출력 */
.code-output {
    position: relative;
}

.code-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.code-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    background: #F5F5F5;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.code-tab:hover {
    color: #319C80;
    border-color: #319C80;
}

.code-tab.active {
    background: #319C80;
    color: #fff;
    border-color: #319C80;
}

.code-block {
    display: none;
    position: relative;
    background: #1E1E1E;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}

.code-block.active {
    display: block;
}

.code-block pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #D4D4D4;
    white-space: pre-wrap;
    word-break: break-all;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 8px 16px;
    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;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 토스트 */
.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) {
    .button-generator-wrapper {
        padding: 0 16px 30px;
    }

    .btn-gen-section {
        padding: 20px;
    }

    .template-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .template-item {
        padding: 12px 8px;
    }

    .settings-tabs {
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .setting-row {
        flex-direction: column;
        align-items: stretch;
    }

    .setting-input,
    .setting-select {
        width: 100%;
    }

    .setting-input-small {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 16px;
    }

    .settings-tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    .preview-area {
        padding: 30px 20px;
        min-height: 120px;
    }
}
