/* Regex Generator Styles */

/* Regex block container */
.regex-output {
    background: #1a1a2e;
    border: 1px solid #ff6b6b40;
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.1);
}

/* Regex header with flavor indicator */
.regex-header {
    background: rgba(255, 107, 107, 0.1);
    padding: 8px 15px;
    border-bottom: 1px solid #ff6b6b40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.regex-flavor-badge {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.regex-flavor-badge .pattern-icon {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1.1em;
}

.regex-variation-label {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 10px;
}

.regex-copy-btn {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
}

.regex-copy-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff8a8a;
}

.regex-copy-btn.copied {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4CAF50;
    color: #4CAF50;
}

/* Regex pattern display */
.regex-pattern-display {
    padding: 15px;
    background: #0d1117;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: auto;
}

.regex-pattern-display .pattern {
    color: #ff6b6b;
    word-break: break-all;
}

.regex-pattern-display .flags {
    color: #ffd93d;
    margin-left: 4px;
}

.regex-pattern-display .delimiter {
    color: #666;
}

/* Regex content area (for code snippets) */
.regex-content {
    padding: 15px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #d4d4d4;
    background: #0d1117;
}

.regex-content pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.regex-content code {
    font-family: inherit;
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Explanation section */
.regex-explanation {
    padding: 15px;
    background: rgba(255, 107, 107, 0.05);
    border-top: 1px solid #ff6b6b20;
}

.regex-explanation-title {
    font-weight: 600;
    color: #ff6b6b;
    margin-bottom: 10px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.regex-explanation-content {
    color: #aab;
    font-size: 0.95em;
    line-height: 1.6;
}

.regex-explanation-content code {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* Test cases section */
.regex-test-cases {
    padding: 15px;
    background: rgba(76, 175, 80, 0.05);
    border-top: 1px solid rgba(76, 175, 80, 0.2);
}

.regex-test-cases-title {
    font-weight: 600;
    color: #4CAF50;
    margin-bottom: 10px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.regex-test-case {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 4px;
    margin-bottom: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.regex-test-case:last-child {
    margin-bottom: 0;
}

.regex-test-case .match-icon {
    color: #4CAF50;
}

.regex-test-case .test-string {
    color: #a5d6ff;
}

/* Preview lines for browse view */
.regex-preview-lines {
    padding: 15px;
    background: #0d1117;
}

.regex-preview-lines .line {
    height: 8px;
    background: linear-gradient(90deg, #ff6b6b20 0%, transparent 100%);
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Regex tester section */
.regex-tester {
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.regex-tester-title {
    font-weight: 600;
    color: #6afcff;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.regex-tester-input {
    width: 100%;
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 10px;
    color: #fff;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.regex-tester-input:focus {
    outline: none;
    border-color: #6afcff;
}

.regex-tester-result {
    margin-top: 10px;
    padding: 10px;
    background: #0d1117;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
}

.regex-tester-result .match {
    background: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    padding: 1px 3px;
    border-radius: 2px;
}

/* Scrollbar styling */
.regex-pattern-display::-webkit-scrollbar,
.regex-content::-webkit-scrollbar {
    height: 8px;
    background: rgba(255, 107, 107, 0.1);
}

.regex-pattern-display::-webkit-scrollbar-thumb,
.regex-content::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 107, 0.3);
    border-radius: 4px;
}

.regex-pattern-display::-webkit-scrollbar-thumb:hover,
.regex-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 107, 0.5);
}

/* Loading state */
.regex-loading {
    text-align: center;
    padding: 40px;
    color: #ff6b6b;
}

.regex-loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive */
@media (max-width: 768px) {
    .regex-pattern-display {
        font-size: 14px;
        padding: 10px;
    }
    
    .regex-content {
        font-size: 12px;
        padding: 10px;
    }
    
    .regex-header {
        padding: 6px 10px;
    }
    
    .regex-copy-btn {
        font-size: 0.8em;
        padding: 3px 8px;
    }
}

/* Selection styling */
.regex-pattern-display ::selection,
.regex-content ::selection {
    background: rgba(255, 107, 107, 0.3);
}

.regex-pattern-display ::-moz-selection,
.regex-content ::-moz-selection {
    background: rgba(255, 107, 107, 0.3);
}

/* Collapsible sections */
.regex-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.regex-section-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.regex-section-toggle .toggle-icon {
    transition: transform 0.2s;
}

.regex-section-toggle.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.regex-section-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.regex-section-content.collapsed {
    max-height: 0;
}

