/**
 * [Senior Standard] RegEx Tool Style v2.2
 * Features: Wide Input, Checkbox Flags
 */

.regex-tool-container {
    max-width: 1200px;
    margin: 0 auto;
}

.regex-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 25px;
    align-items: start;
}

/* Pattern Container */
.pattern-container {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 15px;
}

.regex-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.regex-input-wrapper:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }

.slash-prefix, .slash-suffix {
    font-size: 1.5rem; color: #94a3b8; font-weight: 700; padding: 0 10px;
}

.main-pattern-input {
    flex: 1; border: none; background: transparent;
    font-size: 1.2rem; font-family: 'Monaco', monospace; color: #334155;
    letter-spacing: 0.5px; width: 100%;
}
.main-pattern-input:focus { outline: none; }

/* Flags */
.flags-wrapper {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    padding: 0 10px;
    align-items: center;
    flex-wrap: wrap;
}
.flags-label { font-weight: 700; color: #64748b; font-size: 0.9rem; }
.flag-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.9rem; color: #334155; cursor: pointer;
}
.flag-item input { accent-color: #10b981; width: 16px; height: 16px; }

/* Text Areas */
textarea.input-pastel {
    width: 100%; padding: 15px;
    border: 1px solid #cbd5e1; border-radius: 12px;
    background: #f8fafc;
    min-height: 200px;
    resize: vertical;
    box-sizing: border-box;
}
textarea.input-pastel:focus { outline: none; border-color: #3b82f6; background: #fff; }

.code-font { font-family: 'Monaco', monospace; font-size: 0.95rem; line-height: 1.6; }

.result-view {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    min-height: 250px;
    white-space: pre-wrap;
    color: #94a3b8;
    overflow-y: auto;
    max-height: 500px;
}

/* Highlighting */
.match {
    background-color: #dcfce7;
    color: #166534;
    border-radius: 4px;
    padding: 0 2px;
    font-weight: 600;
    border-bottom: 2px solid #22c55e;
}
.match:nth-child(even) {
    background-color: #dbeafe;
    color: #1e40af;
    border-bottom-color: #3b82f6;
}

/* Cheatsheet */
.cheatsheet-scroll {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 5px;
}
.cheatsheet-scroll::-webkit-scrollbar { width: 6px; }
.cheatsheet-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.cheat-category { margin-bottom: 20px; }
.cheat-category h5 {
    font-size: 0.85rem; color: #64748b; border-bottom: 1px solid #e2e8f0; padding-bottom: 5px; margin-bottom: 10px;
}
.cheat-category ul { list-style: none; padding: 0; margin: 0; }
.cheat-category li {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: 6px; cursor: pointer;
    transition: background 0.2s;
}
.cheat-category li:hover { background: #f1f5f9; }
.cheat-category .token {
    background: #e0f2fe; color: #0369a1; padding: 4px 8px; border-radius: 4px; font-size: 0.9rem; font-weight: 700;
}
.cheat-category .desc { font-size: 0.85rem; color: #475569; }

/* Utils */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.badge { background: #3b82f6; color: #fff; padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: 700; }
.time-badge { color: #64748b; font-size: 0.8rem; margin-left: 10px; }
.text-sm { font-size: 0.85rem; }
.text-gray { color: #94a3b8; }
.h-100 { height: 100%; }

.group-list { list-style: none; padding: 0; margin: 0; max-height: 150px; overflow-y: auto; }
.group-item { background: #f8fafc; padding: 10px; border-radius: 8px; margin-bottom: 5px; font-size: 0.9rem; display: flex; gap: 10px; }
.group-idx { font-weight: 700; color: #64748b; }
.group-val { color: #334155; font-family: monospace; }
.empty-item { color: #94a3b8; font-size: 0.85rem; text-align: center; padding: 10px; }

@media (max-width: 900px) {
    .regex-layout { grid-template-columns: 1fr; }
    .sidebar-column { order: 2; }
}
