:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #10b981;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --card-border: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --input-bg: #0f172a;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --get-color: #22c55e;
    --post-color: #f59e0b;
    --put-color: #3b82f6;
    --patch-color: #8b5cf6;
    --delete-color: #ef4444;
    --head-color: #6366f1;
    --options-color: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fff;
    color: #181818;
    min-height: 100vh;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 10px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Client-side note */
.client-side-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    display: inline-block;
}

.dark-mode .client-side-note {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.2rem;
    margin-top: 1.2rem;
    padding: 0 20px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2em 0.2em;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.theme-toggle-btn:focus {
    outline: none;
}

#theme-icon svg, .github-link svg {
    width: 28px !important;
    height: 28px !important;
    display: block;
    color: #181818;
    fill: #181818;
    transition: color 0.2s, fill 0.2s;
}

.dark-mode #theme-icon svg, .dark-mode .github-link svg {
    color: #fff !important;
    fill: #fff !important;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Sections */
.request-section,
.response-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    font-size: 0.95rem;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.request-section h2,
.response-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #181818;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: color 0.3s;
}

.dark-mode .request-section h2,
.dark-mode .response-section h2 {
    color: #e5e7eb;
}

/* Request Line (Method + URL + Send) */
.request-line {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.method-select {
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #181818;
    cursor: pointer;
    min-width: 120px;
    transition: border-color 0.3s, background 0.3s;
}

.method-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.dark-mode .method-select {
    background: #181c1f;
    border-color: #2d3237;
    color: #e5e7eb;
}

.url-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #181818;
    transition: border-color 0.3s, background 0.3s;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.url-input::placeholder {
    color: #9ca3af;
}

.dark-mode .url-input {
    background: #181c1f;
    border-color: #2d3237;
    color: #e5e7eb;
}

.dark-mode .url-input::placeholder {
    color: #6b7280;
}

.send-btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.send-btn:active {
    transform: translateY(0);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Request Tabs */
.request-tabs,
.response-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.dark-mode .request-tabs,
.dark-mode .response-tabs {
    border-color: #2d3237;
}

.tab-btn,
.resp-tab-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    background: none;
    border: none;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover,
.resp-tab-btn:hover {
    background: #f3f4f6;
    color: #181818;
}

.tab-btn.active,
.resp-tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.dark-mode .tab-btn:hover,
.dark-mode .resp-tab-btn:hover {
    background: #333a41;
    color: #e5e7eb;
}

/* Tab Content */
.tab-content,
.resp-tab-content {
    display: none;
}

.tab-content.active,
.resp-tab-content.active {
    display: block;
}

/* Key-Value Editor */
.kv-editor {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.dark-mode .kv-editor {
    border-color: #2d3237;
}

.kv-header {
    display: grid;
    grid-template-columns: 1fr 1fr 40px;
    gap: 10px;
    padding: 10px 12px;
    background: #f3f4f6;
    font-weight: 600;
    font-size: 0.85rem;
    color: #6b7280;
}

.dark-mode .kv-header {
    background: #181c1f;
    color: #94a3b8;
}

.kv-rows {
    max-height: 200px;
    overflow-y: auto;
}

.kv-row {
    display: grid;
    grid-template-columns: 1fr 1fr 40px;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid #e5e7eb;
}

.dark-mode .kv-row {
    border-color: #2d3237;
}

.kv-key,
.kv-value {
    padding: 8px 10px;
    font-size: 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #181818;
    transition: border-color 0.3s;
}

.kv-key:focus,
.kv-value:focus {
    outline: none;
    border-color: var(--primary-color);
}

.kv-key::placeholder,
.kv-value::placeholder {
    color: #9ca3af;
}

.dark-mode .kv-key,
.dark-mode .kv-value {
    background: #181c1f;
    border-color: #2d3237;
    color: #e5e7eb;
}

.dark-mode .kv-key::placeholder,
.dark-mode .kv-value::placeholder {
    color: #6b7280;
}

.remove-row-btn {
    padding: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    background: none;
    border: none;
    border-radius: 6px;
    color: #ef4444;
    cursor: pointer;
    transition: background 0.2s;
}

.remove-row-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.add-row-btn {
    width: 100%;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    background: none;
    border: none;
    border-top: 1px solid #e5e7eb;
    color: var(--primary-color);
    cursor: pointer;
    transition: background 0.2s;
}

.add-row-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

.dark-mode .add-row-btn {
    border-color: #2d3237;
}

/* Body Type Selector */
.body-type-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.body-type-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
}

.dark-mode .body-type-option {
    color: #d1d5db;
}

.body-type-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Body Content */
.body-content textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #181818;
    resize: vertical;
    transition: border-color 0.3s ease, background 0.3s;
}

.body-content textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.body-content textarea::placeholder {
    color: #9ca3af;
}

.dark-mode .body-content textarea {
    background: #181c1f;
    border-color: #2d3237;
    color: #e5e7eb;
}

.dark-mode .body-content textarea::placeholder {
    color: #6b7280;
}

/* Auth Fields */
.auth-type-selector {
    margin-bottom: 15px;
}

.auth-type-selector label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.dark-mode .auth-type-selector label {
    color: #d1d5db;
}

.auth-type-selector select {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #181818;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}

.auth-type-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.dark-mode .auth-type-selector select {
    background: #181c1f;
    border-color: #2d3237;
    color: #e5e7eb;
}

.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.dark-mode .auth-field label {
    color: #d1d5db;
}

.auth-field input,
.auth-field select {
    padding: 10px 12px;
    font-size: 0.95rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #181818;
    transition: border-color 0.3s, background 0.3s;
}

.auth-field input:focus,
.auth-field select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-field input::placeholder {
    color: #9ca3af;
}

.dark-mode .auth-field input,
.dark-mode .auth-field select {
    background: #181c1f;
    border-color: #2d3237;
    color: #e5e7eb;
}

.dark-mode .auth-field input::placeholder {
    color: #6b7280;
}

/* Response Section */
.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.response-meta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.status-badge {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.response-time,
.response-size {
    font-size: 0.85rem;
    color: #6b7280;
}

.dark-mode .response-time,
.dark-mode .response-size {
    color: #94a3b8;
}

/* Response Body Actions */
.response-body-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.copy-btn,
.format-btn,
.download-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover,
.format-btn:hover,
.download-btn:hover {
    background: #e5e7eb;
}

.copy-btn.copied {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.dark-mode .copy-btn,
.dark-mode .format-btn,
.dark-mode .download-btn {
    background: #23272b;
    border-color: #2d3237;
    color: #d1d5db;
}

.dark-mode .copy-btn:hover,
.dark-mode .format-btn:hover,
.dark-mode .download-btn:hover {
    background: #333a41;
}

/* Response Body Textarea */
#response-body {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #181818;
    resize: vertical;
    transition: border-color 0.3s ease, background 0.3s;
}

#response-body:focus {
    outline: none;
    border-color: var(--primary-color);
}

#response-body::placeholder {
    color: #9ca3af;
}

.dark-mode #response-body {
    background: #181c1f;
    border-color: #2d3237;
    color: #e5e7eb;
}

.dark-mode #response-body::placeholder {
    color: #6b7280;
}

/* Response Headers List */
.response-headers-list {
    max-height: 300px;
    overflow-y: auto;
}

.header-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.dark-mode .header-item {
    border-color: #2d3237;
}

.header-key {
    font-weight: 600;
    color: #374151;
    min-width: 150px;
}

.dark-mode .header-key {
    color: #d1d5db;
}

.header-value {
    color: #6b7280;
    word-break: break-all;
}

.dark-mode .header-value {
    color: #94a3b8;
}

.placeholder-text {
    color: #9ca3af;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.dark-mode .placeholder-text {
    color: #6b7280;
}

/* History Section */
.history-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    font-size: 0.95rem;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

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

.history-header h2 {
    font-size: 1.2rem;
    color: #181818;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: color 0.3s;
}

.dark-mode .history-header h2 {
    color: #e5e7eb;
}

.clear-history-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-history-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.dark-mode .clear-history-btn {
    background: #23272b;
    border-color: #2d3237;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: grid;
    grid-template-columns: 1fr 100px 150px 60px;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f9fafb;
}

.dark-mode .history-item {
    border-color: #2d3237;
}

.dark-mode .history-item:hover {
    background: #23272b;
}

.history-method {
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    text-align: center;
    color: white;
}

.history-method.get { background: var(--get-color); }
.history-method.post { background: var(--post-color); }
.history-method.put { background: var(--put-color); }
.history-method.patch { background: var(--patch-color); }
.history-method.delete { background: var(--delete-color); }
.history-method.head { background: var(--head-color); }
.history-method.options { background: var(--options-color); }

.history-url {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark-mode .history-url {
    color: #d1d5db;
}

.history-status {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.history-status.success {
    color: var(--success-color);
}

.history-status.error {
    color: var(--error-color);
}

.history-time {
    font-size: 0.85rem;
    color: #6b7280;
    text-align: center;
}

.dark-mode .history-time {
    color: #94a3b8;
}

.history-date {
    font-size: 0.8rem;
    color: #9ca3af;
}

.dark-mode .history-date {
    color: #6b7280;
}

.history-load-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--primary-color);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.history-load-btn:hover {
    background: var(--primary-hover);
}

/* Status Messages */
.status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.status.success {
    background: var(--success-color);
    color: white;
}

.status.error {
    background: var(--error-color);
    color: white;
}

.status.info {
    background: var(--primary-color);
    color: white;
}

.status.hidden {
    display: none;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #e5e7eb;
}

.dark-mode footer {
    border-color: #2d3237;
}

footer p {
    color: #6b7280;
    font-size: 0.9rem;
}

.dark-mode footer p {
    color: #94a3b8;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.copyright {
    margin-top: 5px;
    font-size: 0.85rem;
}

/* Dark Mode Styles */
body.dark-mode {
    background: var(--bg-color);
    color: var(--text-primary);
}

.dark-mode .request-section,
.dark-mode .response-section,
.dark-mode .history-section {
    background: var(--card-bg);
    border-color: var(--card-border);
}

.dark-mode .method-select,
.dark-mode .url-input,
.dark-mode .kv-key,
.dark-mode .kv-value,
.dark-mode .auth-field input,
.dark-mode .auth-field select,
.dark-mode .auth-type-selector select,
.dark-mode .body-content textarea,
.dark-mode #response-body {
    background: var(--input-bg);
    border-color: var(--card-border);
    color: var(--text-primary);
}

.dark-mode .method-select:focus,
.dark-mode .url-input:focus,
.dark-mode .kv-key:focus,
.dark-mode .kv-value:focus,
.dark-mode .auth-field input:focus,
.dark-mode .auth-field select:focus,
.dark-mode .auth-type-selector select:focus,
.dark-mode .body-content textarea:focus,
.dark-mode #response-body:focus {
    border-color: var(--primary-color);
}

.dark-mode .kv-header {
    background: var(--input-bg);
    color: var(--text-secondary);
}

.dark-mode .kv-row {
    border-color: var(--card-border);
}

.dark-mode .add-row-btn {
    border-color: var(--card-border);
}

.dark-mode .copy-btn,
.dark-mode .format-btn,
.dark-mode .download-btn,
.dark-mode .clear-history-btn {
    background: var(--input-bg);
    border-color: var(--card-border);
    color: var(--text-primary);
}

.dark-mode .copy-btn:hover,
.dark-mode .format-btn:hover,
.dark-mode .download-btn:hover,
.dark-mode .clear-history-btn:hover {
    background: var(--card-border);
}

.dark-mode .history-item {
    border-color: var(--card-border);
}

.dark-mode .history-item:hover {
    background: var(--input-bg);
}

.dark-mode .header-item {
    border-color: var(--card-border);
}

/* ==================== Regex Tester Specific Styles ==================== */

/* Pattern Section */
.pattern-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    font-size: 0.95rem;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.pattern-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #181818;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: color 0.3s;
}

.dark-mode .pattern-section {
    background: var(--card-bg);
    border-color: var(--card-border);
}

.dark-mode .pattern-section h2 {
    color: #e5e7eb;
}

/* Pattern Input Container */
.pattern-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.pattern-delimiter {
    font-size: 1.5rem;
    font-weight: 600;
    color: #6b7280;
    font-family: 'Consolas', 'Monaco', monospace;
}

.dark-mode .pattern-delimiter {
    color: #94a3b8;
}

.pattern-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: 'Consolas', 'Monaco', monospace;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #181818;
    transition: border-color 0.3s, background 0.3s;
}

.pattern-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.pattern-input::placeholder {
    color: #9ca3af;
}

.dark-mode .pattern-input {
    background: var(--input-bg);
    border-color: var(--card-border);
    color: var(--text-primary);
}

.dark-mode .pattern-input::placeholder {
    color: #6b7280;
}

/* Flags Container */
.flags-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.flag-option {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
}

.dark-mode .flag-option {
    color: #d1d5db;
}

.flag-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.flag-option span {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
}

/* Pattern Error */
.pattern-error {
    padding: 10px 12px;
    margin-bottom: 15px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 6px;
    color: var(--error-color);
    font-size: 0.9rem;
}

/* Test String Section */
.test-string-section {
    margin-top: 20px;
}

.test-string-section h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #181818;
    font-weight: 600;
    transition: color 0.3s;
}

.dark-mode .test-string-section h3 {
    color: #e5e7eb;
}

.test-string-input {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #181818;
    resize: vertical;
    transition: border-color 0.3s ease, background 0.3s;
}

.test-string-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.test-string-input::placeholder {
    color: #9ca3af;
}

.dark-mode .test-string-input {
    background: var(--input-bg);
    border-color: var(--card-border);
    color: var(--text-primary);
}

.dark-mode .test-string-input::placeholder {
    color: #6b7280;
}

/* Results Section */
.results-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    font-size: 0.95rem;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

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

.results-header h2 {
    font-size: 1.2rem;
    color: #181818;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: color 0.3s;
}

.dark-mode .results-section {
    background: var(--card-bg);
    border-color: var(--card-border);
}

.dark-mode .results-header h2 {
    color: #e5e7eb;
}

.results-meta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.match-count {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* Results Tabs */
.results-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.dark-mode .results-tabs {
    border-color: var(--card-border);
}

.result-tab-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    background: none;
    border: none;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.result-tab-btn:hover {
    background: #f3f4f6;
    color: #181818;
}

.result-tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.dark-mode .result-tab-btn:hover {
    background: #333a41;
    color: #e5e7eb;
}

/* Result Tab Content */
.result-tab-content {
    display: none;
}

.result-tab-content.active {
    display: block;
}

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

.match-item {
    padding: 15px;
    margin-bottom: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: background 0.2s;
}

.match-item:hover {
    background: #f3f4f6;
}

.dark-mode .match-item {
    background: var(--input-bg);
    border-color: var(--card-border);
}

.dark-mode .match-item:hover {
    background: #23272b;
}

.match-header {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

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

.match-position,
.match-length {
    color: #6b7280;
}

.dark-mode .match-position,
.dark-mode .match-length {
    color: #94a3b8;
}

.match-context {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    padding: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow-x: auto;
}

.dark-mode .match-context {
    background: var(--bg-color);
    border-color: var(--card-border);
}

.match-before,
.match-after {
    color: #6b7280;
}

.dark-mode .match-before,
.dark-mode .match-after {
    color: #94a3b8;
}

.match-highlight {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
}

.match-value {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.match-value code {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    display: block;
    overflow-x: auto;
}

.dark-mode .match-value code {
    background: var(--bg-color);
    border-color: var(--card-border);
}

/* Groups List */
.groups-list {
    max-height: 400px;
    overflow-y: auto;
}

.group-section {
    padding: 15px;
    margin-bottom: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.dark-mode .group-section {
    background: var(--input-bg);
    border-color: var(--card-border);
}

.group-section h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: #181818;
    font-weight: 600;
}

.dark-mode .group-section h4 {
    color: #e5e7eb;
}

.group-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.group-item:last-child {
    border-bottom: none;
}

.dark-mode .group-item {
    border-color: var(--card-border);
}

.group-number,
.group-name {
    font-weight: 600;
    color: #374151;
    min-width: 80px;
}

.dark-mode .group-number,
.dark-mode .group-name {
    color: #d1d5db;
}

.group-value {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    color: #6b7280;
}

.dark-mode .group-value {
    color: #94a3b8;
}

/* Details Content */
.details-content {
    max-height: 400px;
    overflow-y: auto;
}

.detail-item {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.detail-item:last-child {
    border-bottom: none;
}

.dark-mode .detail-item {
    border-color: var(--card-border);
}

.detail-label {
    font-weight: 600;
    color: #374151;
    min-width: 150px;
}

.dark-mode .detail-label {
    color: #d1d5db;
}

.detail-value {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    color: #6b7280;
}

.dark-mode .detail-value {
    color: #94a3b8;
}

/* History Section - Regex Tester Specific */
.history-pattern {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark-mode .history-pattern {
    color: #d1d5db;
}

.history-matches {
    font-size: 0.85rem;
    color: #6b7280;
    text-align: center;
}

.dark-mode .history-matches {
    color: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .request-line {
        flex-direction: column;
    }

    .method-select {
        width: 100%;
    }

    .history-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .history-pattern,
    .history-matches,
    .history-date,
    .history-load-btn {
        text-align: left;
    }

    .response-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .response-meta {
        flex-wrap: wrap;
    }

    .pattern-input-container {
        flex-direction: column;
        align-items: stretch;
    }

    .flags-container {
        justify-content: center;
    }

    .match-header {
        flex-direction: column;
        gap: 5px;
    }
}

/* ==================== Case Converter Styles ==================== */

/* Input Section */
.input-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    font-size: 0.95rem;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.input-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #181818;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: color 0.3s;
}

.dark-mode .input-section h2 {
    color: #e5e7eb;
}

.dark-mode .input-section {
    background: var(--card-bg);
    border-color: var(--card-border);
}

.input-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #181818;
    resize: vertical;
    transition: border-color 0.3s ease, background 0.3s;
}

.input-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-textarea::placeholder {
    color: #9ca3af;
}

.dark-mode .input-textarea {
    background: #181c1f;
    border-color: #2d3237;
    color: #e5e7eb;
}

.dark-mode .input-textarea::placeholder {
    color: #6b7280;
}

/* Conversions Section */
.conversions-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    font-size: 0.95rem;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.conversions-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #181818;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: color 0.3s;
}

.dark-mode .conversions-section h2 {
    color: #e5e7eb;
}

.dark-mode .conversions-section {
    background: var(--card-bg);
    border-color: var(--card-border);
}

.conversions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.conversion-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 80px;
}

.conversion-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.conversion-btn:active {
    transform: translateY(0);
}

.btn-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.btn-example {
    font-size: 0.75rem;
    opacity: 0.8;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Output Section */
.output-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    font-size: 0.95rem;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

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

.output-header h2 {
    font-size: 1.2rem;
    color: #181818;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: color 0.3s;
}

.dark-mode .output-header h2 {
    color: #e5e7eb;
}

.dark-mode .output-section {
    background: var(--card-bg);
    border-color: var(--card-border);
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--secondary-color);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #0ea572;
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background: #22c55e;
}

.output-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #181818;
    resize: vertical;
    transition: border-color 0.3s ease, background 0.3s;
}

.output-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.output-textarea::placeholder {
    color: #9ca3af;
}

.dark-mode .output-textarea {
    background: #181c1f;
    border-color: #2d3237;
    color: #e5e7eb;
}

.dark-mode .output-textarea::placeholder {
    color: #6b7280;
}

.case-select-wrapper {
    margin-bottom: 15px;
}

.case-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #181818;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}

.case-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.dark-mode .case-select {
    background: #181c1f;
    border-color: #2d3237;
    color: #e5e7eb;
}

/* Responsive adjustments for case converter */
@media (max-width: 768px) {
    .conversions-select-wrapper {
        flex-direction: column;
    }
    
    .case-select {
        width: 100%;
    }
    
    .convert-btn {
        width: 100%;
    }
}

/* Case Select Dropdown */
.conversions-select-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.case-select {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #181818;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}

.case-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.dark-mode .case-select {
    background: var(--input-bg);
    border-color: var(--card-border);
    color: var(--text-primary);
}

.convert-btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.convert-btn:active {
    transform: translateY(0);
}

.convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
