/* ===== 래퍼 ===== */
.alert-box-generator-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* ===== 섹션 공통 ===== */
.alertbox-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;
}

/* ===== 미리보기 영역 ===== */
.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;
}

/* ===== 템플릿 그리드 ===== */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.template-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 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-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    border-radius: 6px;
    padding: 8px 12px;
}

.template-preview svg {
    width: 14px;
    height: 14px;
}

.template-name {
    font-size: 11px;
    color: #666;
    text-align: center;
}

/* ===== 설정 탭 ===== */
.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-group:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.setting-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.setting-input {
    flex: 1;
    min-width: 150px;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    box-sizing: border-box;
}

.setting-input:focus {
    outline: none;
    border-color: #319C80;
}

.setting-input.color-text {
    flex: 0 0 100px;
    min-width: 100px;
    text-transform: uppercase;
}

.setting-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    box-sizing: border-box;
}

.setting-textarea:focus {
    outline: none;
    border-color: #319C80;
}

.setting-select {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    background: #fff;
    min-width: 150px;
    cursor: pointer;
}

.setting-select:focus {
    outline: none;
    border-color: #319C80;
}

.setting-color {
    width: 50px;
    height: 40px;
    padding: 2px;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
}

.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;
}

.setting-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #319C80;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.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;
    cursor: pointer;
}

/* ===== 정렬 버튼 ===== */
.align-buttons {
    display: flex;
    gap: 4px;
    background: #F5F5F5;
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
}

.align-btn {
    width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.align-btn:hover {
    color: #319C80;
}

.align-btn.active {
    background: #319C80;
    color: #fff;
}

.align-btn svg {
    width: 18px;
    height: 18px;
}

/* ===== 애니메이션 재생 버튼 ===== */
.play-animation-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #319C80;
    background: #F0FAF7;
    border: 1px solid #319C80;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.play-animation-btn:hover {
    background: #319C80;
    color: #fff;
}

.play-animation-btn svg {
    width: 16px;
    height: 16px;
}

/* ===== 코드 출력 ===== */
.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', 'Courier New', 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);
}

.copy-all-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    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;
}

.copy-all-btn:hover {
    background: #28816c;
}

/* ===== 토스트 ===== */
.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;
}

/* ===== 미리보기용 알림박스 스타일 ===== */
.preview-area .alert-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    max-width: 500px;
}

.preview-area .alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.preview-area .alert-icon svg {
    width: 100%;
    height: 100%;
}

.preview-area .alert-content {
    flex: 1;
    min-width: 0;
}

.preview-area .alert-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.preview-area .alert-text {
    line-height: 1.5;
    word-break: keep-all;
}

.preview-area .alert-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.preview-area .alert-close:hover {
    opacity: 1;
}

.preview-area .alert-close svg {
    width: 100%;
    height: 100%;
}

/* ===== 툴팁 스타일 ===== */
.preview-area .alert-tooltip {
    position: relative;
}

.preview-area .tooltip-arrow {
    position: absolute;
    bottom: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
}

/* ===== 애니메이션 ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInTop {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.animation-fadeIn { animation: fadeIn 0.3s ease-out; }
.animation-slideInLeft { animation: slideInLeft 0.3s ease-out; }
.animation-slideInRight { animation: slideInRight 0.3s ease-out; }
.animation-slideInTop { animation: slideInTop 0.3s ease-out; }
.animation-bounce { animation: bounce 0.6s ease; }
.animation-shake { animation: shake 0.5s ease; }

/* ===== 반응형 ===== */
@media (max-width: 768px) {
    .alert-box-generator-wrapper {
        padding: 0 16px 30px;
    }

    .alertbox-section {
        padding: 20px;
    }

    .template-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .settings-tabs {
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .setting-row {
        flex-wrap: wrap;
    }

    .setting-input {
        width: 100%;
    }

    .setting-input.color-text {
        flex: 1;
    }

    .preview-area {
        padding: 20px;
    }

    .preview-area .alert-box {
        max-width: 100%;
    }

    .code-block pre {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 16px;
    }

    .settings-tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    .template-item {
        padding: 10px 8px;
    }

    .template-name {
        font-size: 10px;
    }

    .setting-label {
        font-size: 13px;
    }

    .setting-input,
    .setting-select,
    .setting-textarea {
        font-size: 13px;
        padding: 8px 12px;
    }
}
