﻿/* Regex Tester Tool - Tool Styles */

/* Override tool-options for this tool */
.tool-options {
    padding: 1.25rem !important;
    margin-bottom: 1.5rem !important;
}

.tool-options .section-title,
.tool-options h3 {
    margin-bottom: 0.75rem !important;
    font-size: 1rem !important;
}

/* Error Message */
.error-msg {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: var(--radius-md);
    color: #c33;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: none;
}

.error-msg.show {
    display: block;
}

/* Tool Content Columns */
.tool-content-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    width: 100%;
    min-width: 0;
}

/* Input and Output Sections */
.tool-section {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    min-width: 0;
    overflow: hidden;
}

.input-group,
.output-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-group label,
.output-group label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.input-area,
.output-area,
.results-area {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.input-group textarea,
.output-group textarea {
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: none;
    background: var(--surface-color);
    color: var(--text-color);
    border: none;
    min-height: 300px;
    height: 300px;
}

.input-group textarea:focus,
.output-group textarea:focus {
    outline: none;
}

.results-area {
    background: var(--surface-color);
    padding: 1rem;
    min-height: 300px;
    height: 300px;
    max-height: 300px;
    overflow-y: auto;
    word-break: break-word;
    overflow-wrap: break-word;
}

.highlighted-text {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-color);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    word-break: break-word;
}

.highlighted-text pre {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: inherit;
}

.highlighted-text mark {
    background-color: #d4f5d4;
    color: #155e20;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-color-secondary);
    margin-top: 0.25rem;
}

/* Options Group */
.options-group {
    margin-bottom: 0.75rem;
}

.regex-input-section label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.regex-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    background: var(--surface-color);
    width: 100%;
    box-sizing: border-box;
    min-height: 45px;
}

.regex-prefix {
    color: var(--text-color-secondary);
    font-weight: 600;
}

.regex-input-wrapper input {
    flex: 1;
    border: none;
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    background: var(--surface-color);
    color: var(--text-color);
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    min-width: 200px;
    height: 100%;
}

.regex-input-wrapper input:focus {
    outline: none;
    background: var(--surface-color);
    color: var(--text-color);
}

.regex-input-wrapper input::placeholder {
    color: var(--text-color-secondary);
}

.regex-input-wrapper select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 0.9rem;
    height: 100%;
    cursor: pointer;
}

/* Tool Actions Horizontal */
.tool-actions-horizontal {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tool-actions-horizontal .action-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
}

/* Stats Display */
.stats-display {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 0.75rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-color-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Output Actions */
.output-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.output-actions .action-btn {
    flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-content-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .input-group textarea {
        min-height: 250px;
    }

    .results-area {
        min-height: 200px;
    }

    /* Buttons: 2 per row on mobile */
    .tool-actions-horizontal {
        gap: 0.5rem;
    }

    .tool-actions-horizontal .action-btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: auto;
        padding: 0.6rem 0.4rem;
        font-size: 0.85rem;
    }

    .tool-actions-horizontal .action-btn:nth-child(3) {
        flex: 1 1 calc(50% - 0.25rem);
    }
}

.tool-tips h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.tool-tips ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.tool-tips li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.4;
}


.tool-section {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.tool-container {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* Input Styles */
.input-section {
    margin-bottom: 1.5rem;
}

.input-section label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    display: block;
}

.input-textarea {
    width: 100%;
    height: 300px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    resize: none;
    overflow-y: auto;
    background: var(--surface-color);
}

.regex-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.regex-prefix {
    font-weight: 600;
    color: var(--text-color-secondary);
    font-size: 1.1rem;
}

.regex-input-wrapper input {
    flex: 1;
    border: none;
    padding: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    background: var(--surface-color);
}

.regex-input-wrapper input:focus {
    outline: none;
}

.regex-input-wrapper select {
    padding: 0.5rem 0.75rem;
    border: none;
    background: var(--surface-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
}

/* Action Buttons */
.action-btn {
    padding: 0.75rem 1.5rem;
    background: var(--surface-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.action-btn.primary:hover {
    opacity: 0.9;
}

.action-btn.success {
    border-color: var(--success-color);
    color: var(--success-color);
}

.action-btn.success:hover {
    background: var(--success-color);
    color: white;
}

.tool-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.tool-actions .action-btn {
    flex: 1;
}

/* Results Section */
.results-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.results-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.results-panel {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.highlighted-text {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
    color: var(--text-color);
}

.highlighted-text pre {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: inherit;
}

.highlighted-text mark {
    background-color: #4a7c4e;
    color: #e8f5e9;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}

.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.stats span {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-color);
}

.stats strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Formatting Guide and Tips */
.formatting-guide,
.related-tools {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.formatting-guide h2,
.related-tools h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1rem;
}

.formatting-guide h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.formatting-guide ul,
.related-tools ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.formatting-guide li,
.related-tools li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.95rem;
}

.formatting-guide li::before,
.related-tools li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.formatting-guide li:last-child,
.related-tools li:last-child {
    margin-bottom: 0;
}

.related-tools a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.related-tools a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Sidebar Styling */
.tool-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.tool-sidebar .formatting-guide,
.tool-sidebar .related-tools {
    margin-bottom: 0;
}
