body {
    background: #f5f7fa;
}

.regex-tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.input-section,
.output-section,
.examples-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    color: #444;
    font-size: 1.3rem;
}

.regex-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.regex-delimiter {
    font-size: 1.5rem;
    color: #667eea;
    font-weight: bold;
}

#regexPattern {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: 'Consolas', 'Monaco', monospace;
}

#regexPattern:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.flags-section {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.flags-section label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #666;
}

.flags-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#regexTextInput {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

#regexTextInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.action-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 8px 20px rgba(102,126,234,0.3);
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.result-container {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 100px;
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.8;
}

.result-container pre {
    margin: 0;
    white-space: pre-wrap;
}

.result-container mark {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: bold;
}

#matchCount {
    color: #666;
    font-size: 0.95rem;
}

.examples-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.example-item {
    padding: 1rem;
    background: #f5f7fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.example-item:hover {
    background: #e8f0fe;
    border-color: #667eea;
    transform: translateY(-2px);
}

.example-name {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.example-item code {
    display: block;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    color: #667eea;
    word-break: break-all;
}

.info-section {
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    padding: 1.5rem;
}

.info-section h3 {
    color: #065f46;
    margin-bottom: 1rem;
}

.info-section ul {
    padding-left: 1.5rem;
    margin: 0;
}

.info-section li {
    color: #374151;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .regex-tool-container {
        padding: 1rem;
    }
    
    .examples-list {
        grid-template-columns: 1fr;
    }
    
    .flags-section {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
