/* 정규식 테스터 스타일 - base64/json-csv 디자인 언어 차용 */
.regex-tool {
    --tool-primary: #2563eb;
    --tool-bg: #eff6ff;
    --tool-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}

/* 히어로 */
.regex-hero {
    background: var(--tool-gradient);
    border-radius: 16px;
    padding: 36px 32px;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
}
.regex-hero::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}
.regex-hero::after {
    content: '';
    position: absolute;
    bottom: -120px;
    left: -60px;
    width: 260px;
    height: 260px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}
.regex-hero h1 {
    font-size: 28px;
    font-weight: 800;
    position: relative;
    z-index: 1;
    margin: 10px 0 6px;
}
.regex-hero p {
    opacity: 0.85;
    position: relative;
    z-index: 1;
    margin-bottom: 0;
}

/* 에디터 카드 */
.editor-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    overflow: hidden;
}
.editor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f5;
}
.editor-head-collapse {
    border-bottom: none;
    padding: 0;
}
.editor-head-collapse .collapse-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
}
.editor-title {
    font-weight: 700;
    font-size: 14px;
    color: #343a40;
}
.editor-title i {
    color: var(--tool-primary);
}
.size-badge {
    font-size: 12px;
    font-weight: 600;
    color: #868e96;
    background: var(--tool-bg);
    padding: 3px 10px;
    border-radius: 20px;
}
.editor-body {
    padding: 16px;
}
.editor-textarea {
    width: 100%;
    min-height: 90px;
    resize: vertical;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background: #f8f9fb;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
    color: #212529;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}
.editor-textarea:focus {
    border-color: var(--tool-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.editor-textarea[readonly] {
    background: #f1f5f9;
    color: #334155;
}

/* 정규식 입력 행 */
.regex-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.regex-slash {
    color: #adb5bd;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}
.regex-pattern-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background: #f8f9fb;
    padding: 10px 14px;
    font-size: 13px;
    color: #212529;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}
.regex-pattern-input:focus {
    border-color: var(--tool-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 액션 버튼 */
.btn-action {
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-action:hover {
    border-color: var(--tool-primary);
    color: var(--tool-primary);
    background: var(--tool-bg);
}
.btn-action-sm {
    padding: 4px 12px;
    font-size: 12.5px;
    border-radius: 8px;
}
.btn-action-primary {
    background: var(--tool-gradient);
    border: none;
    color: #fff;
}
.btn-action-primary:hover {
    background: var(--tool-gradient);
    border: none;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
}

/* 플래그 토글 버튼 (JS가 btn-primary / btn-outline-secondary 클래스를 토글함) */
.flag-toggle {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-weight: 700;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #868e96;
    transition: all 0.15s;
}
.flag-toggle.btn-outline-secondary {
    border-color: #dee2e6;
    color: #868e96;
    background: #fff;
}
.flag-toggle.btn-outline-secondary:hover {
    border-color: var(--tool-primary);
    color: var(--tool-primary);
    background: var(--tool-bg);
}
.flag-toggle.btn-primary {
    background: var(--tool-gradient);
    border-color: transparent;
    color: #fff;
}
.flag-toggle.btn-primary:hover {
    background: var(--tool-gradient);
    border-color: transparent;
    color: #fff;
}

/* 하이라이트 컨테이너 (기능 유지, 테마 적용) */
.highlight-container {
    position: relative;
}
.highlight-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8f9fb;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 14px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 13px;
    color: transparent;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
    line-height: 1.6;
    pointer-events: none;
    z-index: 1;
}
.highlight-textarea {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 300px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 14px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 13px;
    line-height: 1.6;
    background: transparent !important;
    color: #212529;
    resize: none;
    caret-color: #212529;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.highlight-textarea:focus {
    border-color: var(--tool-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.highlight-backdrop mark {
    color: transparent;
}

/* 매칭 결과 패널 */
.match-results-panel {
    background-color: #f8f9fb;
    border: 1px solid #e9ecef;
}
.match-item code {
    color: #1e1e2e;
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 접기/펼치기 화살표 회전 */
.collapse-chevron {
    transition: transform 0.2s ease;
    color: #868e96;
}
a[aria-expanded="true"] .collapse-chevron {
    transform: rotate(180deg);
}

/* 치트시트 */
.cheat-ico {
    color: var(--tool-primary);
}
.regex-tool .cheat-table td {
    padding: 0.35rem 0.5rem;
    border-color: rgba(0, 0, 0, 0.05);
}
.cheat-token {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    color: var(--tool-primary);
    font-weight: 600;
}
.pattern-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--tool-bg);
    border-radius: 10px;
}
.pattern-chip code {
    color: var(--tool-primary);
}

/* 서포트 카드 */
.support-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    overflow: hidden;
}
.support-card .card-hd {
    padding: 14px 18px;
    font-weight: 700;
    font-size: 15px;
    border-bottom: 1px solid #f1f3f5;
}
.support-card .card-bd {
    padding: 18px;
}
.support-subtitle {
    font-size: 15px;
    font-weight: 700;
    color: #343a40;
    margin: 18px 0 10px;
}

/* 아코디언 */
.regex-tool .accordion-button:not(.collapsed) {
    background-color: var(--tool-bg);
    color: var(--tool-primary);
    box-shadow: none;
}
.regex-tool .accordion-button:focus {
    box-shadow: none;
}

/* 반응형 */
@media (max-width: 768px) {
    .regex-hero { padding: 28px 20px; border-radius: 12px; }
    .regex-hero h1 { font-size: 22px; }
}
