/* ============================================
   Tool Pages - Unified Styles
   ============================================ */

/* Tool Navigation Bar */
.tool-nav-bar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(243, 244, 247, 0.55) 100%);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    padding: 1rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 2;
}

.tool-nav-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tool-nav-label {
    font-weight: 600;
    color: #6c757d;
    margin: 0;
    white-space: nowrap;
    font-size: 0.9rem;
}

.tool-nav-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.tool-nav-buttons .btn {
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
}

.tool-nav-buttons .btn:hover {
    background: #e9ecef;
    border-color: #1e88e5;
    color: #1e88e5;
}

.tool-nav-buttons .btn.active {
    background: #1e88e5;
    border-color: #1e88e5;
    color: white;
}

.tool-nav-buttons .btn i {
    margin-right: 0.25rem;
}

/* Dark theme frosted glass adaptation */
:root[data-theme="dark"] .tool-nav-bar {
    background: linear-gradient(135deg, rgba(40,45,54,0.55) 0%, rgba(30,33,39,0.45) 100%);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] .tool-nav-label {
    color: rgba(255, 255, 255, 0.85);
}

/* Dropdown for more tools */
.dropdown-toggle::after {
    margin-left: 0.5rem;
}

/* Container */
.tool-container {
    background: white;
    border-radius: 0 0 8px 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Tool Card Main */
.tool-card-main {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    /* transition: box-shadow 0.3s ease; */
}

.tool-card-main:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.tool-card-main .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1.5rem;
}

.tool-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #212529;
}

.tool-card-title i {
    margin-right: 0.5rem;
    color: #1e88e5;
}

.tool-card-description {
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d;
}

.tool-card-main .card-body {
    padding: 1.5rem;
    background: white;
}

/* Tool Header inside container (legacy) */
.tool-header {
    margin-bottom: 2rem;
}

.tool-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.5rem;
}

.tool-header p {
    color: #6c757d;
    margin: 0;
    font-size: 0.95rem;
}

/* Textarea Styles */
.textarea-container {
    position: relative;
    margin-bottom: 0;
}

.textarea-label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: block;
    color: #495057;
    font-size: 0.95rem;
}

.textarea-label i {
    margin-right: 0.25rem;
    color: #6c757d;
}

textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 0.875rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    resize: vertical;
    min-height: 450px;
    width: 100%;
    box-sizing: border-box;
    /* transition: all 0.3s ease; */
    background-color: #f8f9fa;
}

textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
    outline: none;
    background-color: white;
}

textarea:disabled,
textarea[readonly] {
    background-color: #f8f9fa;
    cursor: default;
}

textarea.is-valid {
    border-color: #198754;
}

textarea.is-invalid {
    border-color: #dc3545;
}

/* Button Groups */
.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.button-group .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.button-group .btn i {
    margin-right: 0.375rem;
}

.button-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-action {
    flex: 1;
    min-width: 120px;
}

.btn-utility {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Info Box */
.info-box {
    background-color: #e7f3ff;
    border-left: 4px solid #0d6efd;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.info-box p {
    margin: 0;
    color: #004085;
}

/* Alert Messages */
.alert {
    margin-bottom: 1rem;
}

.error-message {
    color: #dc3545;
    padding: 1rem;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-top: 1rem;
    display: none;
}

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

.result-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
    display: none;
}

.result-info.show {
    display: block;
}

/* Output Section */
.output-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #dee2e6;
}

/* FAQ Section */
.faq-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #dee2e6;
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-question {
    font-weight: 600;
    color: #0d6efd;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: #0a58ca;
}

.faq-answer {
    margin-top: 0.5rem;
    color: #6c757d;
    display: none;
    line-height: 1.6;
}

.faq-answer.show {
    display: block;
}

/* Loading Indicator */
.loading {
    display: none;
}

.loading.show {
    display: inline-block;
}

/* Input/Output Layout - Side by Side */
.input-output-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.input-column,
.output-column {
    display: flex;
    flex-direction: column;
}

.input-column textarea,
.output-column textarea {
    flex: 1;
    min-height: 300px;
}

/* Output Results Styling */
.output-results {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.output-results h6 {
    font-weight: 700;
    color: #495057;
    margin-bottom: 1rem;
}

.output-results .input-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.output-results .form-control {
    background: white;
    border: 2px solid #dee2e6;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 0.875rem;
}

.output-results .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

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

    .tool-container {
        padding: 1rem;
    }

    .tool-card-main .card-header {
        padding: 1.5rem;
    }

    .tool-card-main .card-body {
        padding: 1.5rem;
    }

    .tool-card-title {
        font-size: 1.5rem;
    }

    textarea {
        min-height: 250px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
    }

    .button-group .btn {
        width: 100%;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.text-muted {
    color: #6c757d;
}

/* Preset Quick Buttons (Regex Tester) */
.preset-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.preset-group .btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.82rem;
    border-radius: 18px;
    line-height: 1.2;
    border: 1px solid #0d6efd;
    background-color: #0d6efd;
    color: #fff;
    transition: all 0.2s ease-in-out;
}
.preset-group .btn:hover {
    filter: brightness(1.05);
    box-shadow: 0 2px 6px rgba(13,110,253,0.3);
}
.preset-group .btn:active {
    transform: translateY(1px);
}

