.tool-section {
    max-width: 1000px;
    margin: 0 auto;
}

/* Input Area */

/* Flag Options */
.flag-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.flag-option:hover {
    background: var(--surface);
    border-color: var(--brand);
}

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

.flag-option span {
    color: var(--text);
    font-weight: 500;
}

/* Regex Input Group */
.regex-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 8px 12px;
}

.regex-delimiter {
    font-family: monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--brand);
}

.regex-input {
    flex: 1;
    padding: 8px 0;
    border: none;
    background: transparent;
    font-family: monospace;
    font-size: 16px;
    outline: none;
}

.regex-input:focus {
    outline: none;
}

/* Textarea */
textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-soft);
    resize: vertical;
    box-sizing: border-box;
}

/* Controls Row */
.controls-row {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

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

/* Results Area */
.results-area {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

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

.results-title {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.results-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.match-count {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-soft);
    padding: 4px 10px;
    border-radius: 20px;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.copy-btn.success {
    color: var(--success-color);
}

/* Matches List */
.matches-list {
    max-height: 300px;
    overflow-y: auto;
}

.matches-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-item {
    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px;
}

.match-header {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.match-number {
    font-weight: 600;
    color: var(--brand);
}

.match-index {
    font-family: monospace;
}

.match-length {
    font-family: monospace;
}

.match-content {
    font-family: monospace;
    font-size: 14px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    word-break: break-all;
}

.match-groups {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
}

.groups-title {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.group-item {
    font-family: monospace;
    padding: 2px 0;
    color: var(--text-muted);
}

.no-matches {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-style: italic;
}

/* Output Area */

.highlighted-output {
    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 16px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
}

.highlight-match {
    background: #e6f0ff;
    color: #1e4bd2;
    padding: 2px 0;
    border-radius: 3px;
    font-weight: 600;
}

.highlight-info {
    font-size: 13px;
    color: var(--text-muted);
}

/* Error Message - Position below buttons */
.error-message {
    margin: 20px 0 20px 0;
    padding: 16px;
    background: #ffeaea;
    color: #c53030;
    border-radius: 8px;
    border: 1px solid #fc8181;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    

    

    .regex-input-group {
        flex-wrap: wrap;
    }

    .regex-input {
        width: 100%;
    }

    .action-buttons {
        width: 100%;
    }

    .action-buttons button {
        flex: 1;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
