/* Custom Reset & Base variables */
:root {
    --bg-dark: #08080a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f4f4f7;
    --text-secondary: #9a9ab0;
    --text-muted: #5f5f72;
    
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.15);
    --accent-emerald-bright: #34d399;
    
    --accent-danger: #f43f5e;
    --accent-danger-glow: rgba(244, 63, 94, 0.15);
    --accent-danger-bright: #fda4af;
    
    --accent-warning: #f59e0b;
    --accent-warning-glow: rgba(245, 158, 11, 0.15);
    
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.15);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --blur-val: 24px;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
}

/* Background Glow Blobs */
.glow-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: 0;
    mix-blend-mode: screen;
    pointer-events: none;
    animation: pulseGlow 15s infinite alternate ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 80%);
    top: -50px;
    left: 10%;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-emerald) 0%, transparent 80%);
    bottom: 10%;
    right: 5%;
    animation-delay: 3s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--accent-danger) 0%, transparent 80%);
    top: 40%;
    left: 45%;
    animation-delay: 6s;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translate(0, 0); opacity: 0.12; }
    50% { transform: scale(1.1) translate(30px, -20px); opacity: 0.18; }
    100% { transform: scale(0.9) translate(-10px, 30px); opacity: 0.12; }
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1300px;
    padding: 30px 20px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2.2rem;
    color: var(--accent-emerald);
    filter: drop-shadow(0 0 15px var(--accent-emerald-bright));
}

.app-header h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-emerald-bright), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-tagline {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 400;
}

.status-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-emerald-bright);
    animation: pulsePoint 1.5s infinite alternate;
}

@keyframes pulsePoint {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.3); opacity: 1; }
}

/* Panel System */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(var(--blur-val));
    -webkit-backdrop-filter: blur(var(--blur-val));
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px -15px rgba(0, 0, 0, 0.5);
    transition: border var(--transition-speed), box-shadow var(--transition-speed);
}

.panel:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

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

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h2 i {
    color: var(--text-secondary);
}

.panel-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Grid Layout */
.workspace-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 25px;
}

@media (max-width: 900px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

/* Preset Buttons */
.preset-triggers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.btn {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-speed);
}

.btn-preset {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.btn-preset:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.green-icon { color: var(--accent-emerald); }
.red-icon { color: var(--accent-danger); }

/* Drop Zone File Upload */
.drop-zone {
    border: 1.5px dashed var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.03);
}

.drop-icon {
    font-size: 2rem;
    color: var(--text-secondary);
    transition: color var(--transition-speed);
}

.drop-zone:hover .drop-icon {
    color: var(--accent-blue);
}

.drop-zone p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.drop-zone code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Text Editor Area */
.text-editor-container {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    height: 280px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.88rem;
    line-height: 1.5;
    resize: none;
}

/* Action buttons */
.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(244, 63, 94, 0.08);
    color: var(--accent-danger-bright);
    border-color: rgba(244, 63, 94, 0.2);
}

.btn-primary {
    background: var(--accent-emerald);
    color: #ffffff;
    border-color: transparent;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-emerald-bright);
    box-shadow: 0 0 20px var(--accent-emerald-glow);
    transform: translateY(-2px);
}

.btn-pulse {
    animation: btnGlowPulse 2s infinite alternate ease-in-out;
}

@keyframes btnGlowPulse {
    0% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.3); }
    100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.6); }
}

/* Widgets Dashboard */
.status-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .status-overview-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .status-overview-grid {
        grid-template-columns: 1fr;
    }
}

.status-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    transition: all var(--transition-speed);
}

.status-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.status-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.status-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
    font-size: 1.6rem;
    color: var(--text-secondary);
}

.status-indicator h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.status-indicator p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    max-width: 160px;
}

/* State changes for safety widget */
.state-neutral .status-icon-wrapper {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
}

.state-safe .status-icon-wrapper {
    color: var(--accent-emerald-bright);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 20px var(--accent-emerald-glow);
}

.state-flagged .status-icon-wrapper {
    color: var(--accent-danger-bright);
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    box-shadow: 0 0 20px var(--accent-danger-glow);
    animation: pulseSiren 1s infinite alternate;
}

@keyframes pulseSiren {
    0% { transform: scale(1); box-shadow: 0 0 10px var(--accent-danger-glow); }
    100% { transform: scale(1.06); box-shadow: 0 0 25px var(--accent-danger-glow); }
}

/* State changes for vocabulary widget */
.state-excellent .status-icon-wrapper {
    color: var(--accent-emerald-bright);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 20px var(--accent-emerald-glow);
}

.state-strong .status-icon-wrapper {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 20px var(--accent-blue-glow);
}

.state-weak .status-icon-wrapper {
    color: var(--accent-warning);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 0 20px var(--accent-warning-glow);
}

/* Radial Progress Ring */
.radial-progress-wrapper {
    position: relative;
    width: 75px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radial-progress {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 7;
}

.circle-fg {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 7;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease-in-out, stroke var(--transition-speed);
}

.ats-percentage {
    position: absolute;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-sub-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Structural Block */
.dashboard-block {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
}

.dashboard-block h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.dashboard-block h3 i {
    color: var(--accent-blue);
}

.checklist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 400px) {
    .checklist-grid {
        grid-template-columns: 1fr;
    }
}

.checklist-item {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    transition: all var(--transition-speed);
}

.check-icon {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Interactive checklist statuses */
.checklist-item.found {
    color: var(--text-primary);
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.02);
}
.checklist-item.found .check-icon {
    color: var(--accent-emerald);
}

.checklist-item.missing {
    color: var(--text-secondary);
    border-color: rgba(244, 63, 94, 0.15);
    background: rgba(244, 63, 94, 0.02);
}
.checklist-item.missing .check-icon {
    color: var(--accent-danger);
}

/* Violation categories breakdown list */
.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 8px;
    transition: all var(--transition-speed);
}

.breakdown-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.break-icon {
    font-size: 1rem;
    color: var(--text-muted);
}

.breakdown-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    transition: all var(--transition-speed);
}

.badge-neutral {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.badge-alert {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-danger-bright);
    border: 1px solid rgba(244, 63, 94, 0.3);
    box-shadow: 0 0 10px var(--accent-danger-glow);
}

.breakdown-item.flagged-active {
    border-color: rgba(244, 63, 94, 0.3);
    background: rgba(244, 63, 94, 0.03);
}
.breakdown-item.flagged-active .break-icon {
    color: var(--accent-danger);
}
.breakdown-item.flagged-active .breakdown-left span {
    color: var(--text-primary);
    font-weight: 500;
}

/* Document Inspector Panel */
.inspector-panel {
    grid-column: 1 / -1;
}

.inspector-content {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clean-state-message {
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.clean-state-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
}

.clean-state-message p {
    font-size: 0.88rem;
    max-width: 320px;
    line-height: 1.4;
}

.inspected-text-container {
    width: 100%;
    text-align: left;
}

.rendered-lines {
    display: flex;
    flex-direction: column;
    font-family: monospace;
    font-size: 0.88rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* Line styles for Inspector */
.line-row {
    display: flex;
    align-items: flex-start;
    padding: 2px 8px;
    border-radius: 4px;
    position: relative;
    transition: background var(--transition-speed);
}

.line-row:hover {
    background: rgba(255, 255, 255, 0.015);
}

.line-number {
    width: 40px;
    color: var(--text-muted);
    font-size: 0.78rem;
    user-select: none;
    text-align: right;
    padding-right: 15px;
    border-right: 1px solid var(--border-color);
    margin-right: 15px;
}

.line-text {
    flex: 1;
    color: var(--text-primary);
}

/* Highlighting flagged lines */
.line-row.flagged-line {
    background: rgba(244, 63, 94, 0.05);
    border-left: 3px solid var(--accent-danger);
}

.line-row.flagged-line .line-number {
    color: var(--accent-danger);
    font-weight: bold;
}

.line-row.flagged-line .line-text {
    position: relative;
}

/* Hover Tooltip Popover system */
.flagged-line-info {
    position: absolute;
    left: 45px;
    top: -45px;
    background: #111116;
    border: 1px solid rgba(244, 63, 94, 0.4);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8), 0 0 15px var(--accent-danger-glow);
    padding: 10px 14px;
    border-radius: 8px;
    z-index: 50;
    width: 280px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-body);
}

.line-row.flagged-line:hover .flagged-line-info {
    opacity: 1;
    transform: translateY(0);
}

.flagged-line-info h5 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-danger-bright);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.flagged-line-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.flagged-line-info span.match-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.72rem;
    margin-top: 5px;
}

/* Footer styling */
.app-footer {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 10px;
    line-height: 1.5;
}

.text-danger {
    color: var(--accent-danger);
}

/* ATS Power Verb Highlighter */
.verb-highlight {
    color: var(--accent-emerald-bright);
    background: rgba(16, 185, 129, 0.15);
    border-bottom: 1.5px solid var(--accent-emerald);
    padding: 0px 4px;
    border-radius: 4px;
    font-weight: 600;
    cursor: help;
    transition: all var(--transition-speed);
}

.verb-highlight:hover {
    background: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 8px var(--accent-emerald-glow);
}

/* Violation Matrix Grid System */
.inspector-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
}

.inspector-grid.has-violations {
    grid-template-columns: 1.2fr 1fr;
}

@media (max-width: 900px) {
    .inspector-grid.has-violations {
        grid-template-columns: 1fr;
    }
}

.matrix-container {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.matrix-container h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.matrix-container h3 i {
    color: var(--accent-danger-bright);
}

.matrix-scroll {
    overflow-x: auto;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.matrix-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.matrix-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    vertical-align: middle;
}

.matrix-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

.matrix-badge-line {
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--text-secondary);
}

.matrix-badge-cat {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-danger-bright);
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.matrix-term {
    font-family: monospace;
    color: var(--accent-warning);
    font-weight: 600;
}

.matrix-action {
    color: var(--text-secondary);
    line-height: 1.35;
}

/* ==========================================================================
   DYNAMIC RULES & TAB CUSTOMIZATIONS
   ========================================================================== */

/* Tab Navigation Styles */
.tab-header {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 2px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    padding: 11px 14px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    border-radius: 2px;
    transform: scaleX(0.6);
    transition: all var(--transition-speed);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--accent-emerald-bright);
}

.tab-btn.active::after {
    background: linear-gradient(95deg, var(--accent-emerald), var(--accent-blue));
    transform: scaleX(1);
    box-shadow: 0 0 10px var(--accent-emerald-glow);
}

.tab-content {
    display: none;
    animation: fadeInTab 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tab-content.active {
    display: block;
}

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

.panel-header-tab {
    margin-bottom: 18px;
}

.panel-header-tab p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Rules Manager Accordions & Cards */
.rules-editor-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 6px;
}

.rule-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-speed);
}

.rule-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.rule-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    user-select: none;
    transition: background var(--transition-speed);
}

.rule-card-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.rule-card-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rule-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

.rule-card-title-row span {
    font-family: var(--font-heading);
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rule-card-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rule-card-chevron {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform var(--transition-speed);
}

.rule-card.expanded .rule-card-chevron {
    transform: rotate(180deg);
}

.rule-card-body {
    display: none;
    padding: 18px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.18);
    flex-direction: column;
    gap: 16px;
}

.rule-card.expanded .rule-card-body {
    display: flex;
}

/* Category Configuration Inputs */
.rule-meta-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
}

.rule-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rule-input-group label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.rule-text-input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    outline: none;
    font-family: var(--font-body);
    transition: all var(--transition-speed);
}

.rule-text-input:focus {
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
}

.rule-select-input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    outline: none;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.rule-select-input:focus {
    border-color: var(--accent-blue);
}

.rule-select-input option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* Chips and Tags editing interface */
.chips-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chips-title {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 6px;
    min-height: 42px;
    align-items: center;
}

.chips-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 2px 4px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    font-size: 0.74rem;
    padding: 3px 9px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transition: all var(--transition-speed);
}

.chip:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.chip-delete-btn {
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0 1px;
    transition: color var(--transition-speed);
}

.chip-delete-btn:hover {
    color: var(--accent-danger-bright);
}

/* Tag adding inputs inline */
.chip-add-inline {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.chip-add-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    outline: none;
    font-family: monospace;
    transition: all var(--transition-speed);
}

.chip-add-input:focus {
    border-color: var(--accent-blue);
}

.btn-chip-add {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.btn-chip-add:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

/* Deletion card actions */
.rule-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.btn-delete-card {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color var(--transition-speed);
}

.btn-delete-card:hover {
    color: var(--accent-danger-bright);
}

/* Rules Section Action Bar */
.rules-actions {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 12px;
}

/* Bypassed keyword indicator styling */
.line-row.bypassed-line {
    background: rgba(59, 130, 246, 0.03);
    border-left: 3px dashed var(--accent-blue);
}

.line-row.bypassed-line .line-number {
    color: var(--accent-blue);
}

.line-row.bypassed-line .line-text {
    position: relative;
    color: var(--text-secondary);
}

.bypassed-line-info {
    position: absolute;
    left: 45px;
    top: -45px;
    background: #111116;
    border: 1px solid rgba(59, 130, 246, 0.45);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8), 0 0 15px var(--accent-blue-glow);
    padding: 10px 14px;
    border-radius: 8px;
    z-index: 50;
    width: 280px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-body);
}

.line-row.bypassed-line:hover .bypassed-line-info {
    opacity: 1;
    transform: translateY(0);
}

.bypassed-line-info h5 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bypassed-line-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.bypassed-line-info span.match-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.72rem;
    margin-top: 5px;
}

