/* ==========================================================================
   1. BASE & GENERAL STYLES
   ========================================================================== */

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    background-color: #0F172A;
}

/* --- Heading Highlights --- */

.highlight-h1 {
    background-color: #FFD700;
    /* Gold */
    padding: 2px 5px;
    border-radius: 3px;
}

.highlight-h2 {
    background-color: #ADD8E6;
    /* Light Blue */
    padding: 2px 5px;
    border-radius: 3px;
}

.highlight-h3 {
    background-color: #90EE90;
    /* Light Green */
    padding: 2px 5px;
    border-radius: 3px;
}

.highlight-h4 {
    background-color: #FFB6C1;
    /* Light Pink */
    padding: 2px 5px;
    border-radius: 3px;
}

.highlight-h5 {
    background-color: #FF7F50;
    /* Coral */
    padding: 2px 5px;
    border-radius: 3px;
}

.highlight-h6 {
    background-color: #DA70D6;
    /* Orchid */
    padding: 2px 5px;
    border-radius: 3px;
}

/* --- Header --- */

.content-wizard-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.content-wizard-header h1 {
    font-size: 1.25rem;
    font-weight: bold;
    color: #ffffff;
    margin-right: auto;
}

/* --- Main Layout Containers --- */

.editor-container {
    display: flex;
    flex-grow: 1;
    padding: 0 1rem 1rem 1rem;
    gap: 1rem;
    margin: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow-y: hidden;
    overflow-x: hidden;
}

.main-editor-area {
    display: flex;
    flex-grow: 1;
    gap: 1rem;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.info-modal-content a {
    color: #4CAF50;
    text-decoration: underline;
}

.info-modal-content a:hover {
    text-decoration: none;
}

/* --- Panels (Code, Rich-Text, Sidebar) --- */

.code-panel,
.richtext-output-panel,
.sidebar-panel {
    background-color: #1E293B;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0;
    height: 100%;
    box-sizing: border-box;
    overflow-y: hidden;
    overflow-x: hidden;
}

#monacoEditorContainer {
    min-height: 200px;
    flex-grow: 1;
    flex-shrink: 1;
    height: 100%;
}

iframe {
    width: 100%;
    height: 100%;
    flex-grow: 1;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    background-color: #ffffff;
    overflow: auto;
}

.sidebar-panel {
    flex-basis: 300px;
    flex-grow: 0;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    background-color: #1E293B;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* --- Typography & Forms --- */

h1 {
    color: #ffffff;
    margin-bottom: 1rem;
    text-align: center;
}

h2 {
    color: #ffffff;
}

h3 {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

label {
    color: #CBD5E1;
}

input[type="text"] {
    background-color: #334155;
    color: #ffffff;
    border-color: #475569;
}

input[type="text"]::placeholder {
    color: #94A3B8;
}

input[type="number"] {
    background-color: #334155;
    color: #ffffff;
    border-color: #475569;
}

input[type="number"]::placeholder {
    color: #94A3B8;
}

/* --- Panel Sizing Fixes --- */

#richtextOutputPanel>div.flex.items-center.mb-4 {
    flex-shrink: 0;
}

#codePanel>div.flex.items-center.mb-4.flex-wrap {
    flex-shrink: 0;
}

#codePanel>div.mt-auto.pt-4.flex.justify-center.space-x-2 {
    flex-shrink: 0;
}

/* ==========================================================================
   2. RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 768px) {
    .editor-container {
        flex-direction: column;
        height: 100%;
    }

    .main-editor-area {
        flex-direction: column;
        height: auto;
        flex-grow: 1;
    }

    .code-panel,
    .richtext-output-panel,
    .sidebar-panel {
        height: auto;
        flex-basis: auto;
        flex-grow: 1;
        overflow-y: hidden;
    }

    #monacoEditorContainer {
        width: 100%;
        flex-grow: 1;
        flex-shrink: 1;
        min-height: 250px;
    }

    .sidebar-panel {
        width: 100%;
        flex-grow: 1;
        flex-shrink: 1;
        min-height: 250px;
        overflow-y: auto;
        overflow-x: hidden;
    }
}


/* ==========================================================================
   3. BUTTONS & INTERACTIVE ELEMENTS
   ========================================================================== */

.button-group {
    display: flex;
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #475569;
    flex-wrap: wrap;
}

.button-group button {
    flex: 1;
    border-radius: 0;
    border: none;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    position: relative;
    color: #ffffff;
    font-weight: bold;
}

#toggleSectionsBtn,
#toggleHeadingsBtn {
    flex: none;
    width: auto;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    margin-left: 0.5rem;
}

.button-group:not(.no-border-buttons):not(.individual-rounded-buttons) button:not(:last-child) {
    border-right: 1px solid rgba(71, 85, 105, 0.5);
}

.button-group:not(.individual-rounded-buttons) button:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.button-group:not(.individual-rounded-buttons) button:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.button-group button:hover {
    z-index: 1;
}

/* --- Visibility Classes --- */

.panel-hidden {
    display: none;
}

.panel-visible {
    display: flex;
}

/* --- Collapsible Customize Section --- */

.customize-section {
    background-color: #334155;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.customize-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.customize-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
    border-radius: 0 0 0.5rem 0.5rem;
}

.collapsible-content.expanded {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.customize-header svg {
    transition: transform 0.3s ease;
}

.customize-header.expanded svg {
    transform: rotate(180deg);
}

/* --- Fullscreen Adjustments --- */

.code-panel h2 .inline-flex.mr-auto button,
.richtext-output-panel h2 .inline-flex.mr-auto button {
    margin-right: 0.5rem;
}

.editor-container.fullscreen-editor .code-panel h2 .inline-flex.mr-auto {
    margin-left: 0 !important;
}

.editor-container.fullscreen-richtext .richtext-output-panel h2 .inline-flex.mr-auto {
    margin-left: 0 !important;
}

.editor-container.fullscreen-editor .code-panel h2 .inline-flex.mr-auto #fullScreenBtn,
.editor-container.fullscreen-editor .code-panel h2 .inline-flex.mr-auto #exitFullScreenBtn,
.editor-container.fullscreen-richtext .richtext-output-panel h2 .inline-flex.mr-auto #fullScreenRichTextBtn,
.editor-container.fullscreen-richtext .richtext-output-panel h2 .inline-flex.mr-auto #exitFullScreenRichTextBtn {
    margin-left: 0;
}


/* ==========================================================================
   4. MODALS
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* --- Regex Guide Modal --- */

.regex-guide-modal-content {
    width: 90%;
    max-width: 700px;
    min-width: 300px;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
}

.regex-guide-modal-content ul {
    margin-left: 1.5rem;
}

.regex-guide-modal-content li {
    margin-bottom: 0.5rem;
}

.regex-guide-modal-content code {
    display: inline-block;
    background-color: #334155;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 0.9em;
    color: #e0f2f7;
    white-space: nowrap;
}

/* --- Standard Modal Content --- */

.modal-content {
    background-color: #1E293B;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    text-align: left;
    max-width: 90%;
    width: 400px;
}

.modal-content h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-align: left;
}

.modal-content p {
    margin-bottom: 1.5rem;
}

.modal-content button {
    background-color: #64748B;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.modal-content button:hover {
    background-color: #475569;
}

.modal-content .button-group {
    border: none;
    box-shadow: none;
    width: auto;
}

.modal-content .button-group button {
    flex: none;
    margin: 0.25rem;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.modal-content .button-group button.active {
    background-color: #4338CA;
    color: white;
    border-color: #4338CA;
}

/* --- Preview Modal --- */

.preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.preview-modal-content {
    background-color: #2d3748;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    text-align: left;
    max-width: 90%;
    width: 400px;
    position: relative;
}

.preview-modal-content h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-align: left;
}

.preview-modal-content p {
    margin-bottom: 1.5rem;
}

.preview-modal-content button {
    color: white;
    border-radius: 0.5rem;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

#modalWetGcdsToggleBtn {
    font-family: 'Courier New', Courier, monospace;
}

.preview-modal-content button:hover {
    background-color: #3182ce;
}

#previewModal .preview-modal-content {
    position: relative;
    width: 98%;
    max-width: 1500px;
    height: 95%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.5rem;
}

#previewModal .preview-modal-content .preview-modal-header-controls {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

#previewModal .preview-modal-content h3 {
    font-size: 1.25rem;
    text-align: left;
    margin-bottom: 0;
    margin-right: 0.75rem;
}

#previewModal iframe {
    width: 100%;
    height: 100%;
    border: 1px solid #4a5568;
    border-radius: 0.5rem;
    background-color: #ffffff;
    flex-grow: 1;
}

/* These are the crucial styles for the preview's customize section */
#previewModal .customize-section {
    background-color: #3b455a;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

#previewModal .customize-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

#previewModal .customize-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#previewModal .customize-content.expanded {
    max-height: 500px;
    transition: max-height 0.5s ease-in;
    padding-top: 0.5rem;
}

#previewModal .customize-header svg {
    transition: transform 0.3s ease;
}

#previewModal .customize-header.expanded svg {
    transform: rotate(180deg);
}

#previewModal .button-group {
    display: flex;
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #4a5568;
    flex-wrap: wrap;
}

#previewModal .button-group button {
    flex: 1;
    border-radius: 0;
    border: none;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    position: relative;
    color: #ffffff;
    font-weight: bold;
}

#previewModal .button-group button:hover {
    background-color: #3182ce;
}

#previewModal .button-group button:not(:last-child) {
    border-right: 1px solid rgba(74, 85, 104, 0.5);
}

#previewModal .button-group.individual-rounded-buttons {
    border: none;
    box-shadow: none;
    width: auto;
    gap: 0.5rem;
}

#previewModal .button-group.individual-rounded-buttons button {
    flex: none;
    border-radius: 0.5rem;
    border: 1px solid #4a5568;
}

#previewModal .button-group button:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

#previewModal .button-group button:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

#previewModal .button-group button.active {
    color: white !important;
    background-color: #4a5568 !important;
}

#previewModal #modalWetGcdsToggleBtn.active,
#previewModal #modalLangEnBtn.active,
#previewModal #modalLangFrBtn.active {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

#previewModal #modalWetGcdsToggleBtn[class*="indigo-600"].active {
    background-color: #4f46e5 !important;
    border-color: #4f46e5 !important;
}

#previewModal #modalToggleSectionsBtn.active,
#previewModal #modalToggleHeadingsBtn.active {
    background-color: #facc15 !important;
    color: #1f2937 !important;
    border-color: #facc15 !important;
}

#previewModal .button-group.individual-rounded-buttons button.active {
    background-color: #2563eb !important;
}

#previewModal input[type="text"] {
    background-color: #4a5568;
    color: #ffffff;
    border-color: #4a5568;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

#previewModal label {
    color: #cbd5e0;
}

#modalPreviewFindPrevBtn,
#modalPreviewFindNextBtn {
    background-color: #2563eb !important;
}

#closePreviewModalBtn {
    background-color: transparent;
    color: #cbd5e0;
    border: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-size: 1.5rem;
    font-weight: bold;
}

#closePreviewModalBtn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* ==========================================================================
   5. UTILITY & STATE STYLES
   ========================================================================== */

.message-box {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 1rem 2rem;
    font-weight: bold;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: fadeInOut 4s ease-in-out forwards;
    color: white;
    background-color: #38a169;
}

.message-box.error {
    background-color: #f56565;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.9);
    }
    10% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) scale(0.9);
    }
}

/* --- Find/Replace & Editor Highlights --- */

.find-highlight {
    background-color: rgba(255, 255, 0, 0.6);
    color: #000000 !important;
}

.highlight-all-magenta {
    background-color: rgba(255, 0, 255, 0.5);
    color: #ffffff !important;
}

.find-current-match-highlight {
    box-shadow: 0 0 0 2px #f97316;
    background-color: rgba(255, 165, 0, 0.8);
    z-index: 10;
}

.id-highlight {
    border-bottom: 1px solid rgba(0, 255, 255, 1);
    z-index: 1;
}

.tag-highlight {
    border-bottom: 2px solid rgba(255, 0, 255, 1);
}

.regex-active-border {
    border: 2px solid #3498db !important;
}

/* --- Sidebar Collapsible Sections --- */

.collapsible-section {
    background-color: #475569;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background-color: #475569;
    border-bottom: 1px solid #64748B;
    border-radius: 0.5rem 0.5rem 0 0;
}

.collapsible-header.collapsed {
    border-bottom: none;
    border-radius: 0.5rem;
}

.collapsible-header h4 {
    font-size: 1rem;
    font-weight: bold;
    color: #ffffff;
}

.collapsible-header svg {
    transition: transform 0.3s ease;
}

.collapsible-header.expanded svg {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
    padding: 0 1rem;
    background-color: #475569;
    border-radius: 0 0 0.5rem 0.5rem;
}

/* --- Sidebar Toggle Switches --- */

.toggle-switch-container {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    padding: 0.25rem 0;
    gap: 0.5rem;
    justify-content: flex-start;
}

.toggle-switch-label {
    color: #CBD5E1;
    font-size: 0.9rem;
    flex-shrink: 1;
    min-width: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background-color: #64748B;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch-slider {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch.is-checked {
    background-color: #22c55e;
}

.toggle-switch.is-checked .toggle-switch-slider {
    transform: translateX(20px);
}

.entity-highlight {
    color: gold !important;
}

.button-list button:disabled,
.flex.justify-center.space-x-2 button:disabled,
.flex.items-center.mb-4 button:disabled,
.modal-content button:disabled {
    background-color: #4a4a4a !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.button-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.button-list button {
    width: 100%;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(71, 85, 105, 0.5);
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-weight: 600;
    background-color: #475569;
    color: #ffffff;
}

.button-list button:hover {
    background-color: #64748B;
}

.modal-content .button-group.inline-flex {
    border: none;
    box-shadow: none;
    gap: 0.5rem;
}

.modal-content .button-group.inline-flex button {
    flex: none;
    border-radius: 0.5rem;
    margin: 0;
    border: 1px solid #475569;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* --- Search Panel Visibility --- */

.search-controls-hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    pointer-events: none;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.search-controls-visible {
    max-height: 500px;
    opacity: 1;
    transition: max-height 0.3s ease-in, opacity 0.3s ease-in;
    pointer-events: auto;
}

/* --- Validation Panel --- */

#validationResults {
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    flex-grow: 1;
    height: 150px;
    overflow-y: auto;
    background-color: #f9fafb;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

#validationResults.bg-green-100 {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
}

#validationResults.bg-red-100 {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

#validationResults ul li {
    cursor: pointer;
    padding: 4px 0;
    transition: background-color 0.2s ease;
}

#validationResults ul li:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: underline;
}

#monacoEditorContainer .highlighted-line {
    background-color: rgba(255, 99, 71, 0.2);
    border-left: solid 3px red;
}

.bottom-panel-content-hidden {
    display: none;
}

#searchValidateToggle button.active {
    background-color: #3b82f6;
    color: white;
    font-weight: bold;
}

.view-hidden {
    display: none !important;
}


/* ==========================================================================
   6. TABLE WIZARD STYLES
   ========================================================================== */

.tbl-button-group {
    display: flex;
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #3f3f46;
    flex-wrap: wrap;
}

.tbl-button-group button {
    flex: 1;
    border-radius: 0;
    border: none;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    position: relative;
    color: #ffffff;
    font-weight: bold;
    background-color: #27272a;
    transition: background-color 0.2s ease;
}

.tbl-button-group button:hover {
    background-color: #3f3f46;
    z-index: 1;
}

.tbl-button-group button.active {
    background-color: #3b82f6;
    color: #ffffff;
}

.tbl-button-group button:not(:last-child) {
    border-right: 1px solid rgba(63, 63, 70, 0.5);
}

.tbl-button-group button:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.tbl-button-group button:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

#tbl-message-box {
    position: fixed;
    top: 1rem;
    left: 50%;
    z-index: 9999;
    min-width: 350px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transform: translateX(-50%);
}

.tbl-message-box-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.tbl-message-box-fade-out {
    animation: fadeOut 0.5s ease-in forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.tbl-toggle-switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0.25rem;
    padding: 0.25rem 0;
    gap: 0.5rem;
}

.tbl-toggle-switch-label {
    color: #d4d4d8;
    font-size: 0.875rem;
    flex-grow: 1;
    text-align: left;
    cursor: pointer;
}

.tbl-toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background-color: #71717a;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.tbl-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.tbl-toggle-switch-slider {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.tbl-toggle-switch.is-checked {
    background-color: #3b82f6;
}

.tbl-toggle-switch.is-checked .tbl-toggle-switch-slider {
    transform: translateX(18px);
}

.tbl-options-section {
    background-color: #3f3f46;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    flex: 1;
}

.tbl-options-section h4 {
    font-size: 1rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #52525b;
}

.tbl-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding-top: 0.5rem;
}

.tbl-alignment-group-container {
    margin-bottom: 0.75rem;
}

.tbl-alignment-group-container label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e4e4e7;
    margin-bottom: 0.3rem;
    display: block;
}

.tbl-option-text-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    justify-content: flex-start;
}

.tbl-option-text-input label {
    flex-shrink: 0;
    font-size: 0.875rem;
}

.tbl-option-text-input input[type="text"] {
    width: 80px;
    padding: 0.2rem 0.4rem;
    font-size: 0.875rem;
    height: 22px;
    border-radius: 0.25rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.code-panel button:disabled,
.tbl-modal-content button:disabled {
    background-color: #4a4a4a !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.tbl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.tbl-modal-content {
    background-color: #18181b;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    text-align: left;
    max-width: 95%;
    width: 1700px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.tbl-modal-tbl-options-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    flex-grow: 1;
}

@media (max-width: 900px) {
    .tbl-modal-tbl-options-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .tbl-modal-tbl-options-row {
        grid-template-columns: 1fr;
    }
}

.tbl-modal-content h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-align: left;
}

.tbl-modal-content p {
    margin-bottom: 1.5rem;
}

.tbl-modal-content .tbl-modal-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tbl-modal-content .tbl-modal-buttons button {
    background-color: #3b82f6;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.tbl-modal-content .tbl-modal-buttons button:hover {
    background-color: #2563eb;
}

#tbl-options-tbl-modal-overlay .tbl-modal-buttons {
    justify-content: center;
}

#tbl-options-tbl-modal-overlay .tbl-modal-buttons button {
    width: 100%;
}

#tbl-customize-modal-overlay #format-specific-table-button {
    background-color: #3b82f6;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: bold;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

#tbl-customize-modal-overlay #format-specific-table-button:hover {
    background-color: #2563eb;
}

.table-select-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #d4d4d8;
}

#table-search-dropdown {
    background-color: #27272a;
    color: #ffffff;
    border: 1px solid #3f3f46;
    border-radius: 0.25rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
    width: 380px;
    flex-shrink: 0;
}

#table-search-dropdown:focus,
.table-select-container select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.tbl-selected-line-highlight {
    background-color: rgba(59, 130, 246, 0.2);
    border-radius: 4px;
}

#tbl-customize-modal-overlay .tbl-modal-content {
    width: 95%;
    max-width: 1700px;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tbl-customize-main-content-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 1rem;
    overflow: hidden;
    padding: 1rem 0 0 0;
}

@media (min-width: 768px) {
    .tbl-customize-main-content-wrapper {
        flex-direction: row;
    }
}

.tbl-customize-preview-wrapper {
    width: 100%;
    height: 70%;
    flex-shrink: 1;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    border-radius: 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
    .tbl-customize-preview-wrapper {
        width: 75%;
        height: auto;
    }
}

#tbl-customize-preview-iframe {
    width: 100%;
    height: 100%;
    border: 1px solid #475569;
    border-radius: 0.375rem;
    background-color: #e2e8f0;
}

.tbl-customize-options-panel {
    width: 100%;
    height: 30%;
    flex-shrink: 1;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    .tbl-customize-options-panel {
        width: 15%;
        height: auto;
    }
}

.tbl-customize-options-panel .tbl-options-section {
    background-color: #27272a;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.attached-tbl-button-group {
    display: inline-flex;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.attached-tbl-button-group>* {
    border-radius: 0;
}

.attached-tbl-button-group>*:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.attached-tbl-button-group>*:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.attached-tbl-button-group>*:not(:first-child):not(:last-child) {
    border-radius: 0;
}

.trash-button {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.attached-tbl-button-group.blue button {
    background-color: #1d4ed8;
    color: white;
}

.attached-tbl-button-group.blue button:hover {
    background-color: #1e40af;
}

.attached-tbl-button-group.orange button {
    background-color: #c2410c;
    color: white;
}

.attached-tbl-button-group.orange button:hover {
    background-color: #9a3412;
}

.attached-tbl-button-group.green button {
    background-color: #15803d;
    color: white;
}

.attached-tbl-button-group.green button:hover {
    background-color: #166534;
}

.attached-tbl-button-group.purple button {
    background-color: #6d28d9;
    color: white;
}

.attached-tbl-button-group.purple button:hover {
    background-color: #5b21b6;
}

.tbl-cell-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tbl-cell-actions-group button {
    background-color: #3f3f46;
    color: white;
    padding: 0.25rem 0.6rem !important;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.tbl-cell-actions-group button:hover {
    background-color: #52525b;
}

.tbl-cell-actions-group input[type="text"] {
    width: 120px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    height: auto;
    border: 1px solid #52525b;
}
