/**
 * ConvMaster - Regex Tester Styles v1.0
 * 
 * @package    ConvMaster
 * @version    1.0.0
 */

/* =====================================================
   TOOL PAGE LAYOUT
   ===================================================== */
.tool-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tool-header__icon {
    font-size: 2.5rem;
}

.tool-header__icon .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 700;
    font-size: 1.5rem;
}

.tool-header__icon .icon--purple {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.tool-header__text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

.tool-header__text p {
    margin: 0;
    color: var(--text-secondary);
}

/* =====================================================
   FORMAT BADGES
   ===================================================== */
.format-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.format-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
}

.format-badge--regex {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.format-badge--dev {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.format-badge--js {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.format-badge--php {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.format-badge--python {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

/* =====================================================
   REGEX TESTER WIDGET
   ===================================================== */
.regex-tester {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* =====================================================
   MODE TABS
   ===================================================== */
.regex-tester__tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.regex-tab {
    flex: 1;
    min-width: max-content;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.regex-tab:hover {
    color: var(--text-primary);
    background: rgba(168, 85, 247, 0.05);
}

.regex-tab--active {
    color: #a855f7;
    background: var(--bg-card);
}

.regex-tab--active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #a855f7;
}

.regex-tab__icon {
    font-size: 1.1rem;
}

/* =====================================================
   CONTENT AREA
   ===================================================== */
.regex-tester__content {
    padding: 1.5rem;
}

.regex-mode[hidden] {
    display: none !important;
}

.regex-tester__workspace {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* =====================================================
   REGEX INPUT
   ===================================================== */
.regex-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.regex-input__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.regex-input__header label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.regex-input__actions {
    display: flex;
    gap: 0.5rem;
}

.regex-input__stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.regex-input__stats .match-count {
    color: #22c55e;
    font-weight: 600;
}

.regex-input__stats .no-match {
    color: var(--text-tertiary);
}

.regex-input__hint {
    display: flex;
    gap: 0.5rem;
}

.hint-item {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--text-secondary);
    cursor: help;
}

/* =====================================================
   PATTERN WRAPPER
   ===================================================== */
.regex-pattern-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.regex-pattern-wrapper:focus-within {
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.regex-delimiter {
    padding: 0 0.75rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: #a855f7;
    user-select: none;
}

.regex-pattern-input {
    flex: 1;
    padding: 0.875rem 0;
    border: none;
    background: transparent;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
}

.regex-pattern-input::placeholder {
    color: var(--text-tertiary);
}

.regex-flags {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    border-left: 1px solid var(--border-color);
}

.regex-flag {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.regex-flag:hover {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.regex-flag--active {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.regex-flag--active:hover {
    background: rgba(168, 85, 247, 0.25);
    color: #a855f7;
}

/* =====================================================
   ERROR MESSAGE
   ===================================================== */
.regex-error {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: #ef4444;
}

.regex-error[hidden] {
    display: none !important;
}

.regex-error__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.regex-error__content {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
}

.regex-error__text {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.regex-error__close {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.regex-error__close:hover {
    opacity: 1;
}

/* =====================================================
   TEST AREA WITH HIGHLIGHT OVERLAY
   ===================================================== */
.regex-test-area {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.regex-test-textarea,
.regex-source-textarea,
.regex-result-textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    resize: vertical;
    transition: border-color 0.2s ease;
}

.regex-test-textarea:focus,
.regex-source-textarea:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.regex-test-textarea::placeholder,
.regex-source-textarea::placeholder,
.regex-result-textarea::placeholder {
    color: var(--text-tertiary);
}

.regex-result-textarea {
    background: var(--bg-secondary);
}

.regex-highlight-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    pointer-events: none;
    overflow: hidden;
    color: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}

.regex-test-textarea {
    position: relative;
    z-index: 1;
    background: transparent;
}

.regex-test-area .regex-test-textarea {
    background: var(--bg-tertiary);
    caret-color: var(--text-primary);
}

.regex-highlight-overlay mark {
    background: rgba(168, 85, 247, 0.3);
    color: transparent;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.5);
}

/* Replacement input */
.regex-replacement-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.regex-replacement-input:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.regex-replacement-input::placeholder {
    color: var(--text-tertiary);
}

/* =====================================================
   MATCH RESULTS
   ===================================================== */
.regex-results {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.regex-results[hidden] {
    display: none !important;
}

.regex-results__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.regex-results__header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.regex-results__icon {
    color: #22c55e;
}

.regex-matches {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.regex-match {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.regex-match:hover {
    background: var(--bg-secondary);
}

.regex-match__index {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    color: #a855f7;
}

.regex-match__content {
    flex: 1;
    min-width: 0;
}

.regex-match__value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-all;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.regex-match__groups {
    margin-top: 0.5rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border-color);
}

.regex-match__group {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    padding: 0.25rem 0;
}

.regex-match__group-label {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.regex-match__group-value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--text-secondary);
    word-break: break-all;
}

.regex-match__position {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* =====================================================
   CODE GENERATION
   ===================================================== */
.regex-code {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.regex-code__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.regex-code__header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.regex-code__tabs {
    display: flex;
    gap: 0.25rem;
}

.regex-code-tab {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.regex-code-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.regex-code-tab--active {
    background: #a855f7;
    color: white;
}

.regex-code-tab--active:hover {
    background: #9333ea;
    color: white;
}

.regex-code__output {
    position: relative;
    padding: 1rem;
}

.regex-code__output pre {
    margin: 0;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.regex-code__output code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: pre;
}

.regex-code__copy {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

/* =====================================================
   LIBRARY
   ===================================================== */
.regex-library {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.regex-library__search {
    position: relative;
}

.regex-library__search input {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-left: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.regex-library__search input:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.regex-library__search input::placeholder {
    color: var(--text-tertiary);
}

.regex-library__search::before {
    content: '🔍';
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
}

.regex-library__categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.regex-category h3 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.regex-patterns {
    display: grid;
    gap: 0.75rem;
}

.regex-pattern-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.regex-pattern-card:hover {
    border-color: rgba(168, 85, 247, 0.3);
    background: var(--bg-secondary);
}

.regex-pattern-card[hidden] {
    display: none;
}

.pattern-name {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 120px;
}

.regex-pattern-card code {
    flex: 1;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.use-pattern-btn {
    flex-shrink: 0;
}

/* =====================================================
   CHEATSHEET
   ===================================================== */
.regex-cheatsheet {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.cheatsheet-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cheatsheet-section h3 {
    margin: 0;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.cheatsheet-items {
    padding: 0.5rem;
}

.cheatsheet-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.cheatsheet-item:hover {
    background: var(--bg-secondary);
}

.cheatsheet-item code {
    flex-shrink: 0;
    min-width: 80px;
    padding: 0.25rem 0.5rem;
    background: rgba(168, 85, 247, 0.1);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #a855f7;
    text-align: center;
}

.cheatsheet-item span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* =====================================================
   PRIVACY NOTICE
   ===================================================== */
.regex-privacy {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.regex-privacy span {
    font-size: 1.25rem;
}

.regex-privacy p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* =====================================================
   TOOL CONTENT (SEO SECTION)
   ===================================================== */
.tool-content {
    margin-top: 3rem;
}

.tool-section {
    margin-bottom: 2.5rem;
}

.tool-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--text-primary);
}

.tool-section > p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.feature-card {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
}

.feature-card:hover {
    border-color: rgba(168, 85, 247, 0.3);
    transform: translateY(-2px);
}

.feature-card__icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.feature-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.step-card {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
}

.step-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.step-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.step-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Usecases Grid */
.usecases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.usecase-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.usecase-card code {
    flex-shrink: 0;
    padding: 0.35rem 0.75rem;
    background: rgba(168, 85, 247, 0.15);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a855f7;
}

.usecase-card span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* FAQ List */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: '+';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-weight: 700;
    color: #a855f7;
    transition: transform 0.2s;
}

.faq-item[open] summary::before {
    content: '−';
}

.faq-item summary:hover {
    background: var(--bg-secondary);
}

.faq-item p {
    margin: 0;
    padding: 0 1.25rem 1rem 3.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =====================================================
   BUTTON STYLES
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn--small {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
}

.btn--primary {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: white;
}

.btn--primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn--secondary:hover {
    background: var(--bg-secondary);
    border-color: rgba(168, 85, 247, 0.3);
}

.btn svg {
    width: 1em;
    height: 1em;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .tool-page {
        padding: 1rem;
    }
    
    .tool-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .tool-header__icon .icon {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }
    
    .tool-header__text h1 {
        font-size: 1.5rem;
    }
    
    .regex-tester__tabs {
        gap: 0;
    }
    
    .regex-tab {
        padding: 0.875rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .regex-tab__name {
        display: none;
    }
    
    .regex-tester__content {
        padding: 1rem;
    }
    
    .regex-pattern-wrapper {
        flex-wrap: wrap;
    }
    
    .regex-flags {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        justify-content: center;
    }
    
    .regex-input__header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .regex-code__header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .regex-pattern-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pattern-name {
        min-width: 0;
    }
    
    .regex-pattern-card code {
        width: 100%;
        white-space: normal;
        word-break: break-all;
    }
    
    .regex-cheatsheet {
        grid-template-columns: 1fr;
    }
    
    .features-grid,
    .steps-grid,
    .usecases-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .regex-tab__icon {
        font-size: 1.25rem;
    }
    
    .regex-delimiter {
        padding: 0 0.5rem;
        font-size: 1rem;
    }
    
    .regex-pattern-input {
        font-size: 0.9rem;
        padding: 0.75rem 0;
    }
    
    .regex-flag {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

/* =====================================================
   LIGHT THEME ADJUSTMENTS
   ===================================================== */
[data-theme="light"] .regex-highlight-overlay mark {
    background: rgba(168, 85, 247, 0.25);
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.4);
}

[data-theme="light"] .regex-pattern-card:hover {
    background: rgba(168, 85, 247, 0.05);
}

[data-theme="light"] .cheatsheet-item:hover {
    background: rgba(168, 85, 247, 0.05);
}

[data-theme="light"] .feature-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
