/**
 * Web Agent 페이지 스타일
 * 다크 테마 (ChatGPT 스타일)
 */

/* ========== App Sidebar Override (for navigation sidebar) ========== */
body.webagent-page > nav.sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: var(--sidebar-width, 220px) !important;
    min-width: auto !important;
    max-width: none !important;
    height: 100vh !important;
    min-height: 100vh !important;
    background: var(--sidebar-bg, #1e293b) !important;
    border-right: 1px solid var(--sidebar-border, #334155) !important;
    z-index: 1000;
    padding: 0.5rem;
    display: flex !important;
    flex-direction: column !important;
}

body.webagent-page.sidebar-collapsed > nav.sidebar {
    width: var(--sidebar-collapsed-width, 60px) !important;
}

/* Sidebar header */
body.webagent-page > nav.sidebar .sidebar-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.5rem !important;
    border-bottom: 1px solid var(--sidebar-border, #334155) !important;
    margin-bottom: 0.5rem !important;
    min-height: auto !important;
    background: transparent !important;
}

body.webagent-page > nav.sidebar .brand {
    color: #e2e8f0 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
}

body.webagent-page > nav.sidebar .brand i {
    font-size: 1.25rem !important;
    min-width: 24px !important;
}

body.webagent-page > nav.sidebar .brand-text {
    margin-left: 0.5rem !important;
}

/* Navigation links */
body.webagent-page > nav.sidebar .nav-link {
    color: #94a3b8 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.375rem !important;
    margin-bottom: 0.125rem !important;
    display: flex !important;
    align-items: center !important;
    font-size: 0.875rem !important;
    background: transparent !important;
    border: none !important;
}

body.webagent-page > nav.sidebar .nav-link:hover,
body.webagent-page > nav.sidebar .nav-link.active {
    color: #e2e8f0 !important;
    background-color: rgba(59, 130, 246, 0.2) !important;
}

body.webagent-page > nav.sidebar .nav-link i {
    min-width: 20px !important;
    font-size: 1rem !important;
}

body.webagent-page > nav.sidebar .nav-link .nav-text {
    margin-left: 0.625rem !important;
}

/* Sidebar divider */
body.webagent-page > nav.sidebar .sidebar-divider {
    border-color: #334155 !important;
    margin: 0.5rem 0 !important;
}

/* Sidebar footer */
body.webagent-page > nav.sidebar .sidebar-footer {
    margin-top: auto !important;
    padding: 0.5rem !important;
}

body.webagent-page > nav.sidebar .sidebar-footer .btn {
    color: #94a3b8 !important;
    background: transparent !important;
    border: 1px solid #334155 !important;
}

body.webagent-page > nav.sidebar .sidebar-footer .btn:hover {
    color: #e2e8f0 !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* ========== Wrapper (for sidebar integration) ========== */
.webagent-wrapper {
    margin-left: var(--sidebar-width, 220px);
    padding-left: 12px;
    height: 100vh;
    transition: margin-left 0.3s ease;
}

body.sidebar-collapsed .webagent-wrapper {
    margin-left: var(--sidebar-collapsed-width, 60px);
}

@media (max-width: 767.98px) {
    body.webagent-page > nav.sidebar {
        transform: translateX(-100%);
    }

    body.webagent-page.sidebar-open > nav.sidebar {
        transform: translateX(0);
    }

    .webagent-wrapper {
        margin-left: 0;
        padding-left: 0;
    }
}

/* ========== 페이지 레이아웃 ========== */
.webagent-page .app-container {
    display: flex;
    height: 100vh;
    background: #0f172a;
}

.webagent-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* ========== 페이지 헤더 ========== */
.webagent-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #16161f;
    border-bottom: 1px solid #2a2a3a;
}

.webagent-header .back-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid #2a2a3a;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.webagent-header .back-btn:hover {
    background: #1f1f2e;
    color: #fff;
    border-color: #3a3a4a;
}

.webagent-header .page-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #666;
    font-size: 16px;
}

.webagent-header .page-title i {
    font-size: 18px;
}

.webagent-header .header-tabs {
    display: flex;
    gap: 4px;
    margin-left: 20px;
}

.webagent-header .header-tab {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.webagent-header .header-tab.active {
    background: #1a2a2a;
    border-color: #666;
    color: #666;
}

.webagent-header .header-tab:hover:not(.active) {
    background: #1f1f2e;
    color: #ccc;
}

.webagent-header .header-spacer {
    flex: 1;
}

.webagent-header .settings-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #1f1f2e;
    border: 1px solid #2a2a3a;
    color: #888;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.webagent-header .settings-btn:hover {
    color: #fff;
    border-color: #3a3a4a;
}

/* ========== 콘텐츠 영역 ========== */
.webagent-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

/* ========== 좌측 템플릿 사이드바 ========== */
.template-sidebar {
    width: 240px;
    background: #0f0f15;
    border-right: 1px solid #2a2a3a;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.template-sidebar .sidebar-section {
    padding: 16px 12px;
    border-bottom: 1px solid #1a1a24;
}

.template-sidebar .sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-template-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    border: 1px dashed rgba(34, 197, 94, 0.4);
    border-radius: 8px;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.add-template-btn:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(34, 197, 94, 0.15));
    border-color: #666;
}

.template-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.template-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: #aaa;
    font-size: 13px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.template-item:hover {
    background: #1a1a24;
    color: #fff;
}

.template-item.active {
    background: #1a2a2a;
    color: #666;
}

.template-item .icon {
    width: 20px;
    text-align: center;
    color: inherit;
}

.template-item .name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-item .badge {
    font-size: 10px;
    padding: 2px 6px;
    background: #2a2a3a;
    border-radius: 4px;
    color: #888;
}

.template-item .badge.custom {
    background: rgba(34, 197, 94, 0.15);
    color: #666;
}

.template-item.loading,
.template-item.empty {
    cursor: default;
    opacity: 0.7;
}

.template-item.loading:hover,
.template-item.empty:hover {
    background: transparent;
    color: #aaa;
}

.template-delete-btn {
    padding: 4px 6px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
}

.template-item:hover .template-delete-btn {
    opacity: 1;
}

.template-delete-btn:hover {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

/* 로딩 애니메이션 */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== 중앙 콘텐츠 ========== */
.center-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0d0d12;
    overflow-x: hidden;
    overflow-y: auto;
    min-width: 0;
}

.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ========== 실행 모드 ========== */
.execution-mode {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.browser-preview {
    flex: 1;
    background: #1a1a24;
    margin: 12px;
    border-radius: 12px;
    border: 1px solid #2a2a3a;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.browser-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #12121a;
    border-bottom: 1px solid #2a2a3a;
}

.browser-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #1f1f2e;
    border: 1px solid #2a2a3a;
    color: #888;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.browser-btn:hover {
    color: #fff;
    border-color: #3a3a4a;
}

.browser-url {
    flex: 1;
    padding: 6px 12px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 12px;
    outline: none;
}

.browser-url:focus {
    border-color: #555;
}

.browser-frame {
    flex: 1;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    position: relative;
}

.browser-frame img,
.browser-frame .result-screenshot {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* 실행 결과 스크린샷 */
.result-screenshot {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 결과 테이블 컨테이너 */
.result-table-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 16px;
    box-sizing: border-box;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #aaa;
}

.result-table th,
.result-table td {
    padding: 10px 12px;
    border: 1px solid #333;
    text-align: left;
}

.result-table th {
    background: #252525;
    font-weight: 600;
}

.result-table tbody tr:hover {
    background: #2a2a2a;
}

/* 로딩 표시 */
.browser-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #666;
}

.browser-loading p {
    margin: 0;
    font-size: 14px;
}

/* 에러 표시 */
.browser-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #ef4444;
    text-align: center;
    padding: 20px;
}

.browser-error i {
    font-size: 48px;
}

.browser-error p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.browser-placeholder {
    text-align: center;
    color: #555;
}

.browser-placeholder i {
    font-size: 36px;
    margin-bottom: 12px;
    color: #444;
}

.browser-placeholder p {
    font-size: 13px;
}

.command-area {
    padding: 12px;
    background: #12121a;
    border-top: 1px solid #2a2a3a;
}

.template-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.template-selector label {
    font-size: 13px;
    color: #888;
}

.template-selector select {
    flex: 1;
    padding: 8px 12px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.template-selector select:focus {
    border-color: #666;
}

.param-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.param-input {
    flex: 1;
    padding: 10px 14px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
}

.param-input:focus {
    border-color: #666;
}

.param-input::placeholder {
    color: #666;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    transition: all 0.2s;
}

.action-btn.primary {
    background: #666;
    color: #000;
}

.action-btn.primary:hover {
    background: #555;
}

.action-btn.secondary {
    background: #1f1f2e;
    color: #e0e0e0;
    border: 1px solid #2a2a3a;
}

.action-btn.secondary:hover {
    background: #2a2a3a;
}

/* ========== 템플릿 생성 ========== */
.template-creator {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.creator-header {
    margin-bottom: 24px;
}

.creator-header h2 {
    font-size: 20px;
    color: #fff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.creator-header h2 i {
    color: #666;
}

.creator-header p {
    color: #888;
    font-size: 14px;
}

/* 스텝 인디케이터 */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2a2a3a;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.step.active .step-number {
    background: #666;
    color: #000;
}

.step.completed .step-number {
    background: #666;
    color: #000;
}

.step-label {
    font-size: 13px;
    color: #666;
}

.step.active .step-label {
    color: #fff;
}

.step.completed .step-label {
    color: #666;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #2a2a3a;
    max-width: 60px;
}

.step-line.completed {
    background: #666;
}

/* 폼 스타일 */
.creator-form {
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #ccc;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
}

.form-input:focus {
    border-color: #666;
}

.form-input::placeholder {
    color: #666;
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.form-select:focus {
    border-color: #666;
}

.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-textarea:focus {
    border-color: #666;
}

.form-hint {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

.analyze-buttons {
    display: flex;
    gap: 10px;
}

.analyze-btn {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, #666, #555);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.analyze-btn:hover {
    background: linear-gradient(135deg, #555, #15803d);
}

.analyze-btn.background {
    background: linear-gradient(135deg, #555, #2563eb);
    color: #fff;
}

.analyze-btn.background:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.analyze-btn:disabled {
    background: #2a2a3a;
    color: #666;
    cursor: not-allowed;
}

/* 분석 중 섹션 */
.analyzing-section {
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.analyzing-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #2a2a3a;
    border-top-color: #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.analyzing-text {
    color: #fff;
    font-size: 16px;
    margin-bottom: 8px;
}

.analyzing-sub {
    color: #888;
    font-size: 13px;
}

.analyzing-log {
    margin-top: 20px;
    text-align: left;
    background: #0a0a0f;
    border-radius: 8px;
    padding: 12px;
    max-height: 150px;
    overflow-y: auto;
}

.analyzing-log-item {
    font-size: 12px;
    color: #888;
    padding: 4px 0;
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analyzing-log-item.success {
    color: #666;
}

.analyzing-log-item.current {
    color: #555;
}

/* 분석 결과 */
.result-section {
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.result-header .icon {
    width: 40px;
    height: 40px;
    background: rgba(34, 197, 94, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #666;
}

.result-header h3 {
    font-size: 16px;
    color: #fff;
    margin: 0;
}

.result-header p {
    font-size: 13px;
    color: #888;
    margin: 4px 0 0;
}

.selector-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.selector-item {
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    padding: 14px;
}

.selector-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.selector-item-label {
    font-size: 13px;
    font-weight: 500;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 6px;
}

.selector-item-status {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.15);
    color: #666;
}

.selector-item-status.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.selector-item-value {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0a0a0f;
    padding: 8px 10px;
    border-radius: 6px;
}

/* 셀렉터 인라인 편집 입력 */
.selector-input {
    flex: 1;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: #555;
    background: transparent;
    border: 1px solid transparent;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.selector-input:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: #2a2a3a;
}

.selector-input:focus {
    outline: none;
    background: rgba(59, 130, 246, 0.1);
    border-color: #555;
}

.selector-input.valid {
    border-color: #666;
    background: rgba(34, 197, 94, 0.05);
}

.selector-input.invalid {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* 셀렉터 액션 버튼들 */
.selector-actions {
    display: flex;
    gap: 4px;
}

.selector-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.selector-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.selector-btn.test:hover {
    color: #666;
    background: rgba(34, 197, 94, 0.1);
}

.selector-btn.highlight:hover {
    color: #555;
    background: rgba(59, 130, 246, 0.1);
}

.selector-btn.copy:hover {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.selector-btn.delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* 셀렉터 테스트 결과 */
.selector-test-result {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selector-test-result.loading {
    background: rgba(59, 130, 246, 0.1);
    color: #555;
}

.selector-test-result.success {
    background: rgba(34, 197, 94, 0.1);
    color: #666;
}

.selector-test-result.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.selector-test-result .sample-text {
    color: #888;
    font-style: italic;
    margin-left: auto;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 셀렉터 추가 버튼 */
.selector-add-row {
    margin-top: 8px;
}

.add-selector-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px dashed #2a2a3a;
    border-radius: 8px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    transition: all 0.2s;
}

.add-selector-btn:hover {
    border-color: #555;
    color: #555;
    background: rgba(59, 130, 246, 0.05);
}

/* 강조 미리보기 */
.highlight-preview {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.highlight-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.highlight-key {
    background: #555;
    padding: 2px 8px;
    border-radius: 4px;
}

/* 스핀 애니메이션 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

/* ========================================
   테스트 파라미터 섹션
   ======================================== */
.test-params-section {
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 16px;
}

.test-params-section h5 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.test-params-section h5 i {
    color: #555;
}

.test-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.test-param-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.test-param-item label {
    font-size: 12px;
    color: #888;
}

.test-param-item label .required {
    color: #ef4444;
    margin-left: 2px;
}

.test-param-input {
    padding: 8px 12px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    transition: border-color 0.2s;
}

.test-param-input:focus {
    outline: none;
    border-color: #555;
}

/* ========================================
   테스트 결과 패널
   ======================================== */
.test-result-panel {
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    margin-top: 20px;
    overflow: hidden;
}

.test-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a3a;
}

.test-result-header.loading {
    background: #1a1a24;
}

.test-result-header.loading .result-icon {
    color: #888;
}

.test-result-header.success {
    background: rgba(34, 197, 94, 0.1);
}

.test-result-header.success .result-icon {
    color: #666;
}

.test-result-header.error {
    background: rgba(239, 68, 68, 0.1);
}

.test-result-header.error .result-icon {
    color: #ef4444;
}

.test-result-header .result-icon {
    font-size: 20px;
}

.test-result-header .result-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.test-result-header .close-btn {
    padding: 6px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.test-result-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.test-result-body {
    padding: 20px;
}

/* 통계 그리드 */
.test-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2a2a3a;
    margin-bottom: 20px;
}

.test-stats-grid .stat-item {
    text-align: center;
}

.test-stats-grid .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: #fff;
}

.test-stats-grid .stat-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* 추출 데이터 섹션 */
.extracted-data-section {
    margin-bottom: 20px;
}

.extracted-data-section h5,
.action-logs-section h5,
.error-section h5 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.extracted-data-section h5 i {
    color: #555;
}

.action-logs-section h5 i {
    color: #666;
}

.error-section h5 i {
    color: #ef4444;
}

.extracted-data-table-wrapper {
    overflow-x: auto;
    max-height: 300px;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
}

.extracted-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.extracted-data-table th {
    background: #1a1a24;
    padding: 10px 12px;
    text-align: left;
    color: #888;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 1;
}

.extracted-data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a3a;
    color: #e0e0e0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.extracted-data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.data-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 12px;
    color: #888;
}

.data-pagination .page-btns {
    display: flex;
    gap: 8px;
}

.data-pagination button {
    padding: 6px 10px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.data-pagination button:hover:not(:disabled) {
    border-color: #555;
    background: rgba(59, 130, 246, 0.1);
}

.data-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 액션 로그 섹션 */
.action-logs-section {
    margin-bottom: 20px;
}

.action-logs {
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
}

.action-log-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #2a2a3a;
    font-size: 13px;
}

.action-log-item:last-child {
    border-bottom: none;
}

.action-log-item.success i {
    color: #666;
}

.action-log-item.warning i {
    color: #f59e0b;
}

.action-log-item.error {
    background: rgba(239, 68, 68, 0.1);
}

.action-log-item.error i {
    color: #ef4444;
}

.action-log-item .log-index {
    width: 24px;
    height: 24px;
    background: #2a2a3a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #888;
    flex-shrink: 0;
}

.action-log-item .log-type {
    font-weight: 500;
    color: #fff;
    min-width: 80px;
}

.action-log-item .log-target {
    color: #888;
    font-family: 'Consolas', 'Monaco', monospace;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-log-item .log-duration {
    color: #666;
    font-size: 12px;
}

.action-log-item .log-extracted {
    color: #555;
    font-size: 12px;
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.empty-logs {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* 에러 섹션 */
.error-section {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 16px;
}

.error-details {
    font-size: 13px;
}

.error-details .error-message {
    color: #ef4444;
    margin-bottom: 12px;
}

.error-details .failed-action-info {
    margin-bottom: 12px;
    color: #ccc;
}

.error-details .failed-action-info code {
    display: inline-block;
    background: #1a1a24;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #f59e0b;
    margin-left: 8px;
}

.error-details .debug-info {
    background: #1a1a24;
    border-radius: 6px;
    padding: 12px;
}

.error-details .debug-info pre {
    margin: 8px 0 0 0;
    font-size: 11px;
    color: #888;
    overflow-x: auto;
}

/* 미리보기 이미지 */
.preview-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* ========================================
   액션 시퀀스 에디터
   ======================================== */
.actions-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #2a2a3a;
}

.actions-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.actions-section .section-header h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.actions-section .section-header h4 i {
    color: #666;
}

.action-count {
    background: #666;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.section-actions {
    display: flex;
    gap: 8px;
}

.section-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-btn:hover {
    border-color: #555;
    color: #555;
}

.section-btn.primary {
    background: #666;
    border-color: #666;
    color: #fff;
}

.section-btn.primary:hover {
    background: #555;
    border-color: #555;
}

/* 액션 리스트 */
.actions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 10px;
    transition: all 0.2s;
}

.action-item:hover {
    border-color: #3a3a4a;
}

.action-item.dragging {
    opacity: 0.5;
    border-color: #666;
}

.action-item.drag-over-top {
    border-top: 2px solid #666;
}

.action-item.drag-over-bottom {
    border-bottom: 2px solid #666;
}

.action-item.test-success {
    border-color: #666;
    background: rgba(34, 197, 94, 0.05);
}

.action-item.test-failed {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* 드래그 핸들 */
.action-handle {
    cursor: grab;
    color: #666;
    padding: 4px;
    transition: color 0.2s;
}

.action-handle:hover {
    color: #fff;
}

.action-handle:active {
    cursor: grabbing;
}

/* 액션 인덱스 */
.action-index {
    width: 24px;
    height: 24px;
    background: #2a2a3a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}

/* 액션 아이콘 */
.action-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: #2a2a3a20;
    color: #888;
}

.action-icon.goto {
    background: rgba(59, 130, 246, 0.15);
    color: #555;
}

.action-icon.goto_search {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.action-icon.fill {
    background: rgba(34, 197, 94, 0.15);
    color: #666;
}

.action-icon.click {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.action-icon.wait {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.action-icon.extract {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.action-icon.screenshot {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.action-icon.scroll {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.action-icon.sleep {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

/* 액션 콘텐츠 */
.action-content {
    flex: 1;
    min-width: 0;
}

.action-header {
    margin-bottom: 10px;
}

.action-type-select {
    padding: 6px 10px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.action-type-select:focus {
    outline: none;
    border-color: #555;
}

/* 액션 파라미터 */
.action-params {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.param-row label {
    font-size: 12px;
    color: #888;
    min-width: 60px;
}

.param-input {
    flex: 1;
    min-width: 150px;
    padding: 6px 10px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    transition: border-color 0.2s;
}

.param-input:focus {
    outline: none;
    border-color: #555;
}

.param-input-small {
    width: 100px;
    padding: 6px 10px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    transition: border-color 0.2s;
}

.param-input-small:focus {
    outline: none;
    border-color: #555;
}

.param-select {
    padding: 6px 10px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.param-select:focus {
    outline: none;
    border-color: #555;
}

.param-unit {
    font-size: 12px;
    color: #666;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.extract-fields-info {
    font-size: 12px;
    color: #888;
    padding: 6px 10px;
    background: rgba(236, 72, 153, 0.1);
    border-radius: 4px;
}

.param-unknown {
    font-size: 12px;
    color: #f59e0b;
    padding: 6px 10px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 4px;
}

/* 액션 컨트롤 */
.action-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.action-ctrl-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-ctrl-btn:hover {
    border-color: #3a3a4a;
    color: #fff;
}

.action-ctrl-btn.test:hover {
    border-color: #666;
    color: #666;
    background: rgba(34, 197, 94, 0.1);
}

.action-ctrl-btn.delete:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* 빈 상태 */
.actions-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #12121a;
    border: 1px dashed #2a2a3a;
    border-radius: 10px;
    color: #666;
}

.actions-empty i {
    font-size: 32px;
    margin-bottom: 12px;
}

.actions-empty p {
    margin: 0 0 16px 0;
    font-size: 14px;
}

.add-first-action-btn {
    padding: 8px 16px;
    background: #666;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-first-action-btn:hover {
    background: #555;
}

/* 액션 추가 모달 */
.action-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.action-modal {
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
}

.action-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a3a;
}

.action-modal .modal-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-modal .modal-header h5 i {
    color: #666;
}

.action-modal .modal-close {
    padding: 6px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.action-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.action-modal .modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

/* 액션 타입 그리드 */
.action-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .action-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.action-type-card {
    padding: 16px;
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.action-type-card:hover {
    border-color: #666;
    background: rgba(34, 197, 94, 0.05);
}

.action-type-card i {
    font-size: 24px;
    color: #888;
}

.action-type-card:hover i {
    color: #666;
}

.action-type-card span {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.action-type-card small {
    font-size: 11px;
    color: #666;
}

.selector-item-value .copy-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    transition: color 0.2s;
}

.selector-item-value .copy-btn:hover {
    color: #fff;
}

/* ========================================
   미리보기 컨트롤 스타일
   ======================================== */
.preview-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
}

.preview-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    margin: 0;
}

.preview-toggle span {
    user-select: none;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    border-left: 1px solid #2a2a3a;
    border-right: 1px solid #2a2a3a;
    margin: 0 4px;
}

.zoom-label {
    font-size: 11px;
    color: #888;
    min-width: 36px;
    text-align: center;
}

.preview-btn.small {
    padding: 4px 6px;
    font-size: 12px;
}

/* 미리보기 로딩 */
.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    gap: 12px;
    color: #888;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #2a2a3a;
    border-top-color: #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 미리보기 에러 */
.preview-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #ef4444;
    min-height: 200px;
}

.preview-error i {
    font-size: 32px;
}

.preview-error span {
    font-size: 14px;
}

.retry-btn {
    padding: 8px 16px;
    background: #2a2a3a;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.retry-btn:hover {
    background: #3a3a4a;
}

/* 미리보기 이미지 */
.preview-frame {
    position: relative;
    overflow: auto;
    max-height: 400px;
    background: #0a0a10;
    border-radius: 8px;
}

.preview-frame .preview-img {
    width: 100%;
    height: auto;
    cursor: zoom-in;
    transition: transform 0.2s;
    transform-origin: top left;
}

.preview-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #888;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.preview-frame:hover .preview-overlay {
    opacity: 1;
}

/* 전체화면 모달 */
.preview-fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}

.fullscreen-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    z-index: 1;
}

.fullscreen-img {
    max-width: 100%;
    max-height: 95vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

.fullscreen-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.fullscreen-close:hover {
    color: #ef4444;
}

/* 미리보기 */
.preview-section {
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #16161f;
    border-bottom: 1px solid #2a2a3a;
}

.preview-header h4 {
    font-size: 14px;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-actions {
    display: flex;
    gap: 8px;
}

.preview-btn {
    padding: 6px 12px;
    background: #1f1f2e;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.preview-btn:hover {
    color: #fff;
    border-color: #3a3a4a;
}

.preview-btn.primary {
    background: #666;
    border-color: #666;
    color: #000;
}

.preview-btn.primary:hover {
    background: #555;
}

.preview-frame {
    height: 200px;
    background: #1a1a24;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-placeholder {
    text-align: center;
    color: #666;
}

.preview-placeholder i {
    font-size: 32px;
    margin-bottom: 8px;
}

/* 최종 버튼 */
.final-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.final-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.final-btn.secondary {
    background: #1f1f2e;
    border: 1px solid #2a2a3a;
    color: #e0e0e0;
}

.final-btn.secondary:hover {
    background: #2a2a3a;
}

.final-btn.primary {
    background: linear-gradient(135deg, #666, #555);
    border: none;
    color: #000;
}

.final-btn.primary:hover {
    background: linear-gradient(135deg, #555, #15803d);
}

/* ========== 우측 도움말 패널 ========== */
.help-panel {
    width: 280px;
    background: #0f0f15;
    border-left: 1px solid #2a2a3a;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: width 0.3s ease;
    flex-shrink: 0;
}

/* 도움말 패널 토글 버튼 */
.help-toggle-btn {
    position: absolute;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1f1f2e;
    border: 2px solid #3a3a4a;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 100;
    transition: all 0.2s;
    box-shadow: -2px 0 8px rgba(0,0,0,0.3);
}

.help-toggle-btn:hover {
    background: #2a2a3a;
    color: #fff;
    border-color: #4a4a5a;
    transform: translateY(-50%) scale(1.1);
}

/* 도움말 패널 콘텐츠 */
.help-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* 닫힌 상태 */
.help-panel.collapsed {
    width: 40px;
    min-width: 40px;
    border-left: none;
    background: transparent;
}

.help-panel.collapsed .help-panel-content {
    display: none;
}

.help-panel.collapsed .help-toggle-btn {
    left: 4px;
    background: #555;
    border-color: #555;
    color: #fff;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.4);
}

.help-panel .panel-header {
    padding: 16px;
    border-bottom: 1px solid #2a2a3a;
}

.help-panel .panel-header h3 {
    font-size: 14px;
    color: #fff;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-panel .panel-header h3 i {
    color: #f59e0b;
}

.help-panel .panel-header p {
    font-size: 12px;
    color: #888;
    margin: 0;
}

.help-panel .panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.help-card {
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.help-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-card-title i {
    color: #666;
}

.help-card-text {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}

.help-card-code {
    background: #0a0a0f;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    color: #666;
    line-height: 1.6;
}

/* ========== 백그라운드 작업 상태 ========== */
.background-task-status {
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.background-task-status.running {
    border-color: #555;
    background: rgba(59, 130, 246, 0.1);
}

.background-task-status.success {
    border-color: #666;
    background: rgba(34, 197, 94, 0.1);
}

.background-task-status.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.task-status-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #fff;
    font-weight: 500;
}

.task-status-header i {
    font-size: 18px;
}

.background-task-status.running .task-status-header i {
    color: #555;
}

.background-task-status.success .task-status-header i {
    color: #666;
}

.background-task-status.error .task-status-header i {
    color: #ef4444;
}

.task-status-header .close-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.task-status-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.task-status-progress {
    height: 6px;
    background: #2a2a3a;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.task-status-progress .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #555, #666);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.background-task-status.success .task-status-progress .progress-bar {
    background: #666;
}

.background-task-status.error .task-status-progress .progress-bar {
    background: #ef4444;
}

.task-status-message {
    font-size: 13px;
    color: #888;
}

.task-status-result {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    font-family: monospace;
}

/* ========== 백그라운드 콘솔 패널 ========== */
.bg-console-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 500px;
    max-height: 400px;
    background: #0a0a0f;
    border: 1px solid #666;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.3), 0 0 60px rgba(34, 197, 94, 0.1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    overflow: hidden;
    animation: consoleSlideIn 0.3s ease;
}

@keyframes consoleSlideIn {
    from {
        transform: translateY(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.bg-console-panel.minimized {
    max-height: 44px;
}

.bg-console-panel.minimized .bg-console-body,
.bg-console-panel.minimized .bg-console-status {
    display: none;
}

.bg-console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #0f1a0f 0%, #0a0f0a 100%);
    border-bottom: 1px solid #1a3a1a;
    cursor: move;
}

.bg-console-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-weight: 600;
    font-size: 13px;
}

.bg-console-title i {
    font-size: 16px;
    animation: terminalBlink 1s infinite;
}

@keyframes terminalBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

.bg-console-badge {
    background: #666;
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.bg-console-controls {
    display: flex;
    gap: 4px;
}

.bg-console-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #888;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.bg-console-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.bg-console-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 300px;
}

.bg-console-tasks {
    padding: 8px 12px;
    border-bottom: 1px solid #1a2a1a;
    background: #0d120d;
}

.bg-task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #101810;
    border: 1px solid #1a3a1a;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.bg-task-item:hover {
    background: #152015;
    border-color: #666;
}

.bg-task-item.active {
    background: rgba(34, 197, 94, 0.1);
    border-color: #666;
}

.bg-task-item .task-icon {
    font-size: 16px;
}

.bg-task-item .task-icon.running {
    color: #555;
    animation: spin 1s linear infinite;
}

.bg-task-item .task-icon.completed {
    color: #666;
}

.bg-task-item .task-icon.failed {
    color: #ef4444;
}

.bg-task-item .task-info {
    flex: 1;
    min-width: 0;
}

.bg-task-item .task-name {
    font-size: 12px;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bg-task-item .task-url {
    font-size: 10px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bg-task-item .task-progress {
    width: 60px;
    height: 4px;
    background: #1a2a1a;
    border-radius: 2px;
    overflow: hidden;
}

.bg-task-item .task-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #666, #777);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.bg-console-logs {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    background: #050805;
    font-size: 11px;
    line-height: 1.6;
}

.bg-console-logs::-webkit-scrollbar {
    width: 6px;
}

.bg-console-logs::-webkit-scrollbar-track {
    background: #0a0f0a;
}

.bg-console-logs::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

.log-line {
    display: flex;
    gap: 8px;
    padding: 2px 0;
    border-bottom: 1px solid rgba(34, 197, 94, 0.1);
}

.log-time {
    color: #4a5a4a;
    font-size: 10px;
    min-width: 70px;
}

.log-message {
    color: #8a9a8a;
    word-break: break-all;
}

.log-line.info .log-message {
    color: #8a9a8a;
}

.log-line.success .log-message {
    color: #666;
    font-weight: 500;
}

.log-line.warning .log-message {
    color: #f59e0b;
}

.log-line.error .log-message {
    color: #ef4444;
    font-weight: 500;
}

.log-line.debug .log-message {
    color: #6a7a6a;
    font-style: italic;
}

.bg-console-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #0d120d;
    border-top: 1px solid #1a2a1a;
    font-size: 11px;
    color: #6a8a6a;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
}

.status-dot.running {
    background: #666;
    animation: statusPulse 1.5s infinite;
}

.status-dot.idle {
    background: #666;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* 플로팅 버튼 */
.bg-console-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #666, #555);
    border: none;
    color: #000;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
    transition: all 0.3s;
    animation: fabPulse 2s infinite;
}

@keyframes fabPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(34, 197, 94, 0.6), 0 0 40px rgba(34, 197, 94, 0.3); }
}

.bg-console-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(34, 197, 94, 0.5);
}

.fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0a0a0f;
}

/* 콘솔 없을 때 숨김 */
.bg-console-fab.hidden,
.bg-console-panel.hidden {
    display: none !important;
}

/* ========== Schematic Collector 스타일 ========== */

/* 카테고리 컨트롤 */
.category-controls {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #2a2a3a;
}

.cat-ctrl-btn {
    flex: 1;
    padding: 6px 10px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 6px;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s;
}

.cat-ctrl-btn:hover {
    background: #252538;
    color: #fff;
    border-color: #555;
}

/* 카테고리 그룹 */
.category-groups {
    padding: 8px 0;
    max-height: 400px;
    overflow-y: auto;
}

.category-group {
    margin-bottom: 4px;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #1a1a2e;
    color: #ddd;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.group-header:hover {
    background: #252538;
}

.group-header i:first-child {
    color: #555;
}

.group-toggle {
    margin-left: auto;
    transition: transform 0.2s;
}

.group-items.collapsed {
    display: none;
}

.group-items {
    padding: 4px 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.category-item:hover {
    background: #1a1a2e;
}

.category-item input[type="checkbox"] {
    accent-color: #666;
}

.cat-name {
    flex: 1;
    font-size: 12px;
    color: #aaa;
}

.cat-count {
    font-size: 10px;
    color: #666;
    background: #1a1a2e;
    padding: 2px 6px;
    border-radius: 10px;
}

/* 설정 폼 */
.settings-form {
    padding: 12px;
}

.setting-item {
    margin-bottom: 12px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #aaa;
}

.setting-item input[type="number"] {
    width: 100%;
    margin-top: 6px;
    padding: 8px 10px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
}

.setting-item input[type="checkbox"] {
    accent-color: #666;
}

/* 수집 버튼 */
.collect-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #666, #555);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.collect-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.collect-btn:disabled {
    background: #333;
    cursor: not-allowed;
    opacity: 0.6;
}

.selected-count {
    text-align: center;
    font-size: 11px;
    color: #666;
    margin-top: 8px;
}

.selected-count strong {
    color: #666;
}

/* 결과 패널 */
.results-panel {
    background: #12121a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.results-header {
    margin-bottom: 20px;
}

.results-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 18px;
    margin-bottom: 8px;
}

.results-header h3 i {
    color: #555;
}

.results-header p {
    color: #888;
    font-size: 13px;
}

/* 진행 상황 */
.progress-section {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.progress-title {
    color: #fff;
    font-size: 14px;
}

.progress-percent {
    color: #666;
    font-weight: 600;
}

.progress-bar-container {
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-section .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #555, #666);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-detail {
    font-size: 12px;
    color: #888;
}

/* 가이드 섹션 */
.guide-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.guide-card {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #1a1a2e;
    border-radius: 8px;
    border: 1px solid #2a2a3a;
}

.guide-icon {
    font-size: 24px;
    color: #555;
}

.guide-text h4 {
    color: #fff;
    font-size: 14px;
    margin-bottom: 6px;
}

.guide-text p {
    color: #888;
    font-size: 12px;
    line-height: 1.5;
}

/* 결과 요약 */
.results-summary {
    margin-bottom: 16px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.summary-card {
    background: #1a1a2e;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.summary-card.highlight {
    background: rgba(34, 197, 94, 0.1);
    border-color: #666;
}

.summary-card .card-icon {
    font-size: 24px;
    color: #555;
    margin-bottom: 8px;
}

.summary-card.highlight .card-icon {
    color: #666;
}

.summary-card .card-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.summary-card .card-label {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* 로그 콘솔 */
.log-console {
    background: #0a0a0f;
    border: 1px solid #1a2a1a;
    border-radius: 8px;
    overflow: hidden;
}

.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #0d120d;
    border-bottom: 1px solid #1a2a1a;
    color: #666;
    font-size: 12px;
}

.console-header i {
    margin-right: 6px;
}

.console-clear-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.console-clear-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.console-body {
    height: 200px;
    overflow-y: auto;
    padding: 10px 14px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    line-height: 1.6;
}

.console-body::-webkit-scrollbar {
    width: 6px;
}

.console-body::-webkit-scrollbar-track {
    background: #0a0f0a;
}

.console-body::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

.console-welcome {
    color: #4a5a4a;
}

.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #666;
}

.error-state, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #666;
    text-align: center;
}

.error-state i {
    font-size: 32px;
    color: #ef4444;
}

/* ========== 반응형 ========== */
@media (max-width: 1024px) {
    .help-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .template-sidebar {
        display: none;
    }

    .webagent-header .header-tabs {
        margin-left: 8px;
    }

    .webagent-header .header-tab span {
        display: none;
    }
}

/* ========== 고급 편집 모드 ========== */
.advanced-edit-toggle {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #2a2a3a;
}

.advanced-edit-toggle .toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #555;
    cursor: pointer;
    font-size: 13px;
    width: 100%;
    transition: all 0.2s;
}

.advanced-edit-toggle .toggle-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.advanced-edit-toggle .toggle-btn i:last-child {
    margin-left: auto;
    transition: transform 0.2s;
}

.advanced-edit-section {
    margin-top: 16px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    overflow: hidden;
}

.json-editor-tabs {
    display: flex;
    background: #12121a;
    border-bottom: 1px solid #2a2a3a;
}

.json-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.json-tab:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.05);
}

.json-tab.active {
    color: #555;
    background: rgba(59, 130, 246, 0.1);
    border-bottom-color: #555;
}

.json-editor-content {
    padding: 12px;
}

.json-editor {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    background: #0a0a0f;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #a5d6ff;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.json-editor:focus {
    border-color: #555;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.json-editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.json-status {
    flex: 1;
    font-size: 12px;
    color: #888;
}

.json-status.success {
    color: #666;
}

.json-status.error {
    color: #ef4444;
}

.json-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.json-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #3a3a4a;
}

.json-btn.primary {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #555;
}

.json-btn.primary:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
}

.json-help {
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.05);
    border-top: 1px solid #2a2a3a;
}

.json-help p {
    margin: 0;
    font-size: 12px;
    color: #888;
}

.json-help strong {
    color: #555;
}

/* ========== 미리보기/데이터 탭 UI ========== */
.preview-tabs {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.preview-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-tab:hover:not(.active) {
    background: #1f1f2e;
    color: #ccc;
}

.preview-tab.active {
    background: rgba(34, 197, 94, 0.15);
    border-color: #666;
    color: #666;
}

.preview-tab i {
    font-size: 14px;
}

.preview-tab .data-count {
    font-size: 10px;
    padding: 2px 6px;
    background: #2a2a3a;
    border-radius: 10px;
    color: #888;
    min-width: 18px;
    text-align: center;
}

.preview-tab.active .data-count {
    background: #666;
    color: #000;
}

/* 탭 콘텐츠 표시/숨김 */
.preview-tab-content {
    display: none;
}

.preview-tab-content.active {
    display: flex;
    flex: 1;
    flex-direction: column;
}

/* 데이터 탭 내 테이블 개선 */
#dataTab .result-table-container {
    background: #fff;
    overflow: auto;
}

#dataTab .result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#dataTab .result-table th {
    position: sticky;
    top: 0;
    background: #f0f4f8;
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 2px solid #ddd;
    text-align: left;
    white-space: nowrap;
    z-index: 1;
}

#dataTab .result-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    color: #333;
}

#dataTab .result-table tbody tr:hover {
    background: #f5f9fc;
}

#dataTab .result-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

#dataTab .result-table tbody tr:nth-child(even):hover {
    background: #f0f5f9;
}

/* 데이터 없음 메시지 */
.no-data-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #888;
    text-align: center;
    background: #f5f5f5;
    height: 100%;
}

.no-data-message i {
    font-size: 48px;
    color: #ccc;
}

.no-data-message p {
    font-size: 14px;
    margin: 0;
}

/* 실시간 스트리밍 표시 */
.streaming-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    color: #555;
    font-size: 11px;
    margin-left: 8px;
}

.streaming-indicator .dot {
    width: 6px;
    height: 6px;
    background: #555;
    border-radius: 50%;
    animation: streamingPulse 1s infinite;
}

@keyframes streamingPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ========== 실시간 콘솔 패널 ========== */
.live-console-panel {
    width: 320px;
    background: linear-gradient(180deg, #0a0f0a 0%, #050805 100%);
    border-left: 2px solid #666;
    display: flex;
    flex-direction: column;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    box-shadow: -4px 0 20px rgba(34, 197, 94, 0.15);
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.live-console-panel.collapsed {
    width: 48px;
}

.live-console-panel.collapsed .console-body,
.live-console-panel.collapsed .console-status,
.live-console-panel.collapsed .console-title span,
.live-console-panel.collapsed .log-count {
    display: none;
}

/* 콘솔 헤더 */
.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, #0f1a0f 0%, #0a0f0a 100%);
    border-bottom: 1px solid #1a3a1a;
}

.console-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-weight: 600;
    font-size: 13px;
}

.console-title i {
    font-size: 16px;
}

.console-title i.pulse {
    animation: consolePulse 1s infinite;
}

@keyframes consolePulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 8px rgba(34, 197, 94, 0.8); }
    50% { opacity: 0.6; text-shadow: 0 0 2px rgba(34, 197, 94, 0.3); }
}

.log-count {
    background: #666;
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.console-controls {
    display: flex;
    gap: 4px;
}

.console-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(34, 197, 94, 0.1);
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.console-btn:hover {
    background: rgba(34, 197, 94, 0.25);
    transform: scale(1.1);
}

/* 콘솔 본문 */
.console-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #030503;
    min-height: 200px;
    max-height: calc(100vh - 250px);
}

.console-body::-webkit-scrollbar {
    width: 6px;
}

.console-body::-webkit-scrollbar-track {
    background: #0a0f0a;
}

.console-body::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

/* 웰컴 메시지 */
.console-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: #3a5a3a;
    text-align: center;
}

.console-welcome i {
    font-size: 32px;
    opacity: 0.5;
}

.console-welcome p {
    font-size: 11px;
    margin: 0;
    line-height: 1.5;
}

/* 로그 엔트리 */
.log-entry {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(34, 197, 94, 0.08);
    font-size: 11px;
    line-height: 1.4;
    animation: logSlideIn 0.3s ease;
}

@keyframes logSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
        background: rgba(34, 197, 94, 0.15);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        background: transparent;
    }
}

.log-entry:hover {
    background: rgba(34, 197, 94, 0.05);
}

.log-time {
    color: #3a5a3a;
    font-size: 9px;
    min-width: 55px;
    flex-shrink: 0;
}

.log-icon {
    font-size: 12px;
    min-width: 16px;
    text-align: center;
}

.log-message {
    flex: 1;
    word-break: break-word;
}

/* 로그 레벨별 스타일 */
.log-entry.info {
    color: #7a9a7a;
}

.log-entry.info .log-icon {
    color: #555;
}

.log-entry.success {
    color: #666;
    font-weight: 500;
}

.log-entry.success .log-icon {
    color: #666;
}

.log-entry.warning {
    color: #f59e0b;
}

.log-entry.warning .log-icon {
    color: #f59e0b;
}

.log-entry.error {
    color: #ef4444;
    font-weight: 500;
    background: rgba(239, 68, 68, 0.08);
}

.log-entry.error .log-icon {
    color: #ef4444;
}

.log-entry.debug {
    color: #5a6a5a;
    font-style: italic;
}

.log-entry.debug .log-icon {
    color: #666;
}

/* 하이라이트 효과 (새 로그) */
.log-entry.highlight {
    background: rgba(34, 197, 94, 0.2);
    border-left: 3px solid #666;
}

/* 콘솔 상태바 */
.console-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #0d120d 0%, #080a08 100%);
    border-top: 1px solid #1a3a1a;
    font-size: 11px;
    color: #5a7a5a;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3a5a3a;
    transition: all 0.3s;
}

.status-dot.running {
    background: #666;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: statusPulse 1s infinite;
}

.status-dot.error {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.status-dot.success {
    background: #666;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 16px rgba(34, 197, 94, 0.8);
    }
}

/* 반응형 - 작은 화면에서 콘솔 숨김 */
@media (max-width: 1200px) {
    .live-console-panel {
        width: 280px;
    }
}

@media (max-width: 1024px) {
    .live-console-panel {
        display: none;
    }
}

/* ========================================
   유효성 검사 스타일
   ======================================== */

/* 유효성 검사 요약 패널 */
.validation-summary {
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.validation-summary.has-errors {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.validation-summary.has-warnings {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.validation-summary.valid {
    border-color: #666;
    background: rgba(34, 197, 94, 0.05);
}

.validation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #16161f;
    border-bottom: 1px solid #2a2a3a;
    cursor: pointer;
    transition: background 0.2s;
}

.validation-header:hover {
    background: #1a1a24;
}

.validation-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.validation-summary.has-errors .validation-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.validation-summary.has-warnings .validation-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.validation-summary.valid .validation-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #666;
}

.validation-title {
    flex: 1;
}

.validation-title h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.validation-title span {
    font-size: 12px;
    color: #888;
}

.validation-badges {
    display: flex;
    gap: 8px;
}

.validation-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.validation-badge.errors {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.validation-badge.warnings {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.validation-toggle {
    color: #666;
    transition: transform 0.2s;
}

.validation-summary.expanded .validation-toggle {
    transform: rotate(180deg);
}

/* 유효성 검사 항목 리스트 */
.validation-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.validation-summary.expanded .validation-items {
    max-height: 300px;
    overflow-y: auto;
}

.validation-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #2a2a3a;
    cursor: pointer;
    transition: background 0.2s;
}

.validation-item:last-child {
    border-bottom: none;
}

.validation-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.validation-item-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
}

.validation-item.error .validation-item-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.validation-item.warning .validation-item-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.validation-item-content {
    flex: 1;
    min-width: 0;
}

.validation-item-message {
    font-size: 13px;
    color: #e0e0e0;
    margin-bottom: 2px;
}

.validation-item-field {
    font-size: 11px;
    color: #666;
    font-family: 'Consolas', 'Monaco', monospace;
}

.validation-item-fix {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid #2a2a3a;
    border-radius: 4px;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.validation-item-fix:hover {
    border-color: #555;
    color: #555;
    background: rgba(59, 130, 246, 0.1);
}

/* 필드 에러 표시 */
.field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    font-size: 12px;
    color: #ef4444;
}

.field-error i {
    font-size: 14px;
}

.field-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 6px;
    font-size: 12px;
    color: #f59e0b;
}

.field-warning i {
    font-size: 14px;
}

/* 유효하지 않은 입력 필드 */
.invalid-field {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

.invalid-field:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.warning-field {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.05) !important;
}

.warning-field:focus {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* 유효성 검사 성공 애니메이션 */
@keyframes validationSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.validation-summary.valid .validation-icon {
    animation: validationSuccess 0.3s ease;
}

/* 유효성 검사 흔들림 애니메이션 (에러 시) */
@keyframes validationShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.validation-summary.shake {
    animation: validationShake 0.5s ease;
}

/* ========================================
   JSON 에디터 스타일
   ======================================== */

/* 고급 편집 섹션 */
.advanced-edit-section {
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 16px;
}

/* JSON 에디터 헤더 */
.json-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #16161f;
    border-bottom: 1px solid #2a2a3a;
}

.json-editor-tabs {
    display: flex;
    gap: 4px;
}

.json-tab {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.json-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
}

.json-tab.active {
    background: #666;
    color: #000;
    font-weight: 500;
}

.json-tab i {
    font-size: 14px;
}

/* JSON 에디터 도구 */
.json-editor-tools {
    display: flex;
    gap: 4px;
}

.json-tool-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.json-tool-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #555;
    color: #555;
}

/* JSON 에디터 래퍼 (라인 번호 포함) */
.json-editor-wrapper {
    display: flex;
    background: #0a0a10;
    max-height: 400px;
    overflow: hidden;
}

.json-line-numbers {
    width: 40px;
    padding: 12px 8px;
    background: #0f0f16;
    border-right: 1px solid #2a2a3a;
    color: #555;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    text-align: right;
    user-select: none;
    overflow: hidden;
    flex-shrink: 0;
}

.json-line-numbers span {
    display: block;
}

.json-editor {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
    overflow-y: auto;
    tab-size: 2;
}

.json-editor::placeholder {
    color: #555;
}

.json-editor:focus {
    outline: none;
}

/* JSON 스크롤바 스타일 */
.json-editor::-webkit-scrollbar {
    width: 8px;
}

.json-editor::-webkit-scrollbar-track {
    background: #0a0a10;
}

.json-editor::-webkit-scrollbar-thumb {
    background: #2a2a3a;
    border-radius: 4px;
}

.json-editor::-webkit-scrollbar-thumb:hover {
    background: #3a3a4a;
}

/* JSON 에디터 푸터 */
.json-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #16161f;
    border-top: 1px solid #2a2a3a;
}

.json-status-bar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.json-status {
    font-size: 12px;
    color: #888;
    transition: color 0.2s;
}

.json-status.success {
    color: #666;
}

.json-status.error {
    color: #ef4444;
}

.json-status.warning {
    color: #f59e0b;
}

.json-stats {
    font-size: 11px;
    color: #555;
}

.json-editor-actions {
    display: flex;
    gap: 8px;
}

.json-btn {
    padding: 6px 12px;
    background: #1f1f2e;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.json-btn:hover {
    background: #2a2a3a;
    color: #fff;
    border-color: #3a3a4a;
}

.json-btn.primary {
    background: #666;
    border-color: #666;
    color: #000;
}

.json-btn.primary:hover {
    background: #555;
    border-color: #555;
}

/* JSON 도움말 */
.json-help {
    padding: 10px 16px;
    background: #0f0f16;
    border-top: 1px solid #2a2a3a;
}

.json-help-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 11px;
    color: #666;
}

.json-help-tips span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.json-help-tips i {
    color: #f59e0b;
}

/* 고급 편집 토글 */
.advanced-edit-toggle {
    margin-top: 16px;
}

.advanced-edit-toggle .toggle-btn {
    width: 100%;
    padding: 12px 16px;
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.advanced-edit-toggle .toggle-btn:hover {
    background: #1a1a24;
    color: #fff;
    border-color: #3a3a4a;
}

.advanced-edit-toggle .toggle-btn i:first-child {
    color: #555;
}

.advanced-edit-toggle .toggle-btn i:last-child {
    margin-left: auto;
    transition: transform 0.2s;
}

/* JSON 에러 하이라이트 */
.json-editor.has-error {
    border: 1px solid #ef4444;
}

/* JSON 구문 하이라이트 (간단한 버전) */
.json-highlighted {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    pointer-events: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
}

.json-highlighted .json-key {
    color: #f59e0b;
}

.json-highlighted .json-string {
    color: #666;
}

.json-highlighted .json-number {
    color: #555;
}

.json-highlighted .json-boolean {
    color: #ec4899;
}

.json-highlighted .json-null {
    color: #888;
}

/* ========================================
   자동 저장 & 세션 복구 스타일
   ======================================== */

/* 자동 저장 컨트롤 영역 */
.autosave-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* 자동 저장 인디케이터 */
.autosave-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 12px;
    color: #888;
    cursor: default;
}

.autosave-indicator .autosave-icon {
    font-size: 14px;
    transition: color 0.2s;
}

.autosave-indicator .autosave-text {
    font-size: 11px;
    min-width: 50px;
}

/* 수동 저장 버튼 */
.manual-save-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid #2a2a3a;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.manual-save-btn:hover {
    background: #1f1f2e;
    border-color: #3a3a4a;
    color: #666;
}

.manual-save-btn:active {
    transform: scale(0.95);
}

/* 초안 복구 모달 */
.draft-recovery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.draft-recovery-content {
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.draft-recovery-header {
    text-align: center;
    margin-bottom: 20px;
}

.draft-recovery-header .draft-recovery-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #555;
}

.draft-recovery-header h4 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.draft-recovery-header p {
    margin: 0;
    font-size: 14px;
    color: #888;
}

.draft-recovery-body {
    background: #12121a;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.draft-saved-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a2a3a;
}

.draft-saved-time i {
    color: #f59e0b;
}

.draft-info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.draft-info-item {
    display: flex;
    font-size: 13px;
}

.draft-info-item .label {
    color: #666;
    min-width: 50px;
}

.draft-info-item .value {
    color: #ccc;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.draft-recovery-actions {
    display: flex;
    gap: 12px;
}

.draft-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.draft-btn.secondary {
    background: transparent;
    border: 1px solid #2a2a3a;
    color: #888;
}

.draft-btn.secondary:hover {
    background: rgba(255, 68, 68, 0.1);
    border-color: #ff4444;
    color: #ff4444;
}

.draft-btn.primary {
    background: linear-gradient(135deg, #666, #555);
    border: none;
    color: #fff;
}

.draft-btn.primary:hover {
    background: linear-gradient(135deg, #555, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.draft-btn:active {
    transform: scale(0.98);
}
