.regex-main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.regex-input-column,
.regex-results-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.regex-input-section {
    margin-bottom: 0;
}
.regex-input-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}
.regex-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    transition: border-color 0.3s ease;
}
.regex-input-wrapper:focus-within {
    border-color: var(--primary-color);
}
.regex-delimiter {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
}
.regex-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
}
.flags-input {
    width: 80px;
    border: none;
    background: transparent;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    text-align: center;
}
.flags-helper {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.flags-helper label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}
.test-string-section {
    margin-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.test-string-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}
.test-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
    flex: 1;
    min-height: 300px;
}
.test-input:focus {
    outline: none;
    border-color: var(--primary-color);
}
.test-button {
    margin-top: 1rem;
    padding: 0.875rem 2rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
    width: 100%;
}
.test-button:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}
.test-button:active {
    transform: translateY(0);
}
.results-section,
.output-section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}
.results-section h3,
.output-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}
.match-count {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 600;
}
.match-count.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}
.match-count.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}
.match-results {
    min-height: 100px;
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.match-item {
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}
.match-position {
    display: inline-block;
    margin-left: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.capture-groups {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}
.capture-group {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}
.no-matches,
.error-message {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}
.error-message {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 8px;
}
.highlighted-output {
    padding: 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
    flex: 1;
}
.highlighted-output mark {
    background: rgba(255, 193, 7, 0.4);
    color: var(--text-primary);
    padding: 2px 4px;
    border-radius: 3px;
}
.regex-reference {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}
.ref-column h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}
.ref-column ul {
    list-style: none;
    padding: 0;
}
.ref-column li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}
.ref-column li:last-child {
    border-bottom: none;
}
.ref-column code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-primary);
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive design for mobile devices */
@media (max-width: 968px) {
    .regex-main-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .regex-input-column,
    .regex-results-column {
        gap: 1.5rem;
    }
    
    .test-input {
        min-height: 250px;
    }
    
    .match-results,
    .highlighted-output {
        max-height: 300px;
    }
}
