/* Core Layout & Typography */
main.container {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    color: #1e293b !important;
    background-color: #f8fafc;
    padding: 40px 15px !important;
    border-radius: 16px;
}

.regex-hero {
    text-align: center;
    margin-bottom: 30px;
}
.regex-title-main {
    font-size: 2.2rem !important;
    font-weight: 850 !important;
    color: #0f172a !important;
    letter-spacing: -1px !important;
    margin-bottom: 10px !important;
}
.regex-subtitle-main {
    font-size: 16px !important;
    color: #64748b !important;
    font-weight: 500;
}

.regex-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .regex-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.regex-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 6px;
}

.small-action-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #4f46e5;
    border-radius: 6px;
    cursor: pointer;
}

/* Regex Slash Pattern Controls Row */
.regex-input-row {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: 10px;
    gap: 8px;
}
.regex-slash {
    font-size: 20px;
    font-weight: 800;
    color: #94a3b8;
}
.pro-input-text {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    outline: none;
}
.pattern-field { flex: 1; font-family: monospace; color: #0f172a; }
.flags-field { width: 60px; font-family: monospace; color: #b45309; text-align: center; }
.pro-input-text:focus { border-color: #4f46e5; }

.regex-error-msg {
    background: #fef2f2;
    color: #ef4444;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid #fee2e2;
}

/* Live Highlighter Text Layer Mechanics */
.highlight-container {
    position: relative;
    width: 100%;
    height: 260px;
}
.backdrop-layer, .textarea-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    padding: 14px;
    box-sizing: border-box;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}
.backdrop-layer {
    background-color: #f8fafc;
    color: transparent;
    overflow-y: auto;
    pointer-events: none;
    border: 2px solid transparent;
}
/* This class injects over text matches behind the translucent text area */
.backdrop-layer mark {
    background-color: #fde047;
    color: transparent;
    border-radius: 3px;
}
.textarea-field {
    background: transparent;
    color: #0f172a;
    border: 2px solid #e2e8f0;
    resize: none;
    outline: none;
    overflow-y: auto;
}
.textarea-field:focus {
    border-color: #4f46e5;
}

/* Explanation Output Components */
.explanation-card { background: #fafafa; }
.match-badge {
    font-size: 12px;
    font-weight: 800;
    background: #dcfce7;
    color: #15803d;
    padding: 4px 10px;
    border-radius: 20px;
}
.explanation-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    height: 310px;
    overflow-y: auto;
}
.explain-item {
    margin-bottom: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    padding-bottom: 8px;
    border-bottom: 1px dashed #f1f5f9;
}
.explain-item:last-child { border-bottom: none; }
.explain-token {
    font-family: monospace;
    background: #0f172a;
    color: #38bdf8;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-right: 6px;
}

/* SEO Step-Guide Styles */
.seo-guide-section { max-width: 1200px; margin: 50px auto 0 auto; }
.step-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 25px; }
@media (min-width: 768px) { .step-grid { grid-template-columns: repeat(3, 1fr); } }
.step-card { background: #fff; border: 1px solid #e2e8f0; padding: 22px; border-radius: 12px; position: relative; }
.step-num { position: absolute; top: -12px; left: 20px; background: #4f46e5; color: #fff; font-weight: 800; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 13px; }
.step-card h4 { margin: 8px 0 8px 0; font-size: 16px; font-weight: 750; color: #0f172a; }
.step-card p { margin: 0; font-size: 13.5px; color: #475569; line-height: 1.5; }

/* FAQ Styles */
.faq-section { max-width: 850px; margin: 50px auto 20px auto; }
.faq-main-title { font-size: 24px !important; font-weight: 850 !important; color: #0f172a; text-align: center; margin-bottom: 25px; }
.faq-item { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; margin-bottom: 15px; }
.faq-question { font-size: 16px !important; font-weight: 750 !important; color: #0f172a; margin-top: 0; margin-bottom: 8px; }
.faq-answer { font-size: 14px; color: #475569; line-height: 1.6; margin: 0; }