/*
    --------------------------------------------------------
    1. Base Styles (Unchanged)
    --------------------------------------------------------
*/
html,
body {
    height: 100%;
}

#right-panel-top {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    min-height: 0;
    padding: 1rem;
    overflow: hidden;
    box-sizing: border-box;
}

#canvas-container {
    position: relative;
    cursor: default;
    flex-shrink: 0;
}

#signalCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#right-panel-top>.flex-grow-1 {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    min-height: 0;
}

.legend-button {
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    width: 100%;
    text-align: left;
    transition: color 0.2s ease;
}

[data-bs-toggle="collapse"] .legend-button .bi {
    transition: transform 0.2s ease-in-out;
    display: inline-block;
}

[data-bs-toggle="collapse"][aria-expanded="true"] .legend-button .bi {
    transform: rotate(-180deg);
}

.object-name:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--bs-primary);
}

#main-split {
    display: flex;
    flex-direction: row;
}

.editable-name-area {
    padding: 2px 6px;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out;
}

.editable-name-area:hover {
    cursor: text;
    background-color: var(--bs-tertiary-bg);
}

.editable-name-area .bi-pencil-fill {
    opacity: 0.5;
    transition: opacity 0.2s ease-in-out;
}

.editable-name-area:hover .bi-pencil-fill {
    opacity: 1;
}

.form-range::-webkit-slider-runnable-track {
    background-color: var(--bs-border-color);
}

.form-range::-moz-range-track {
    background-color: var(--bs-border-color);
}

[data-bs-toggle="collapse"] {
    user-select: none;
}

/* -------------------------------------------------------- */
/* 2. Dark Theme (Default) Toolbar Styles (Unchanged)       */
/* -------------------------------------------------------- */

/* The solid effect is applied below in the light theme block. 
   These remain for the dark theme's default outline appearance. */
#toolbar .btn.btn-outline-secondary:not([disabled]) {
    --bs-btn-border-color: var(--bs-gray-600);
    --bs-btn-color: var(--bs-gray-400);
}

#toolbar .btn.btn-outline-secondary:not([disabled]):hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: var(--bs-light);
}

#pixel-editor-grid-container {
    display: grid;
    grid-gap: 1px;
    border: 1px solid #444;
}

.pixel-editor-cell {
    width: 100%;
    padding-bottom: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    position: relative;
}

.notification-read {
    opacity: 0.6;
    background-color: #343a40;
}

.notification-read .text-danger {
    opacity: 0.7;
}

/* -------------------------------------------------------- */
/* 3. Custom Control Styles (Unchanged for dark defaults)   */
/* -------------------------------------------------------- */

.gradient-picker-container {
    position: relative;
    user-select: none;
    touch-action: none;
}

.gradient-preview-bar {
    width: 100%;
    height: 30px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-image:
        linear-gradient(45deg, #444 25%, transparent 25%),
        linear-gradient(-45deg, #444 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #444 75%),
        linear-gradient(-45deg, transparent 75%, #444 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    position: relative;
}

.gradient-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 4px;
}

.gradient-stops-container {
    position: relative;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.gradient-stop-marker {
    position: absolute;
    top: 0;
    width: 25px;
    height: 25px;
    border: 2px solid #000;
    border-radius: 50%;
    transform: translateX(-50%);
    cursor: grab;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease-out, border-color 0.1s ease-out;
}

.gradient-stop-marker.active {
    border-color: #ffffff;
    transform: translateX(-50%) scale(1.0);
    z-index: 10;
}

.gradient-active-stop-controls {
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.node-table {
    --bs-table-bg: var(--bs-body-bg);
}

/* -------------------------------------------------------- */
/* 4. HIGH-CONTRAST LIGHT THEME OVERRIDES                   */
/* -------------------------------------------------------- */

[data-bs-theme="light"] {
    /* Define High-Contrast Colors: Light Gray for Panels, Pure White for Inputs */
    --bs-body-bg-custom: var(--bs-gray-200);
    /* Light Gray for #left-panel, #toolbar, bg-body-tertiary */
    --bs-body-bg-custom-lighter: #fff;
    /* Pure White for inner content, inputs */
    --bs-border-color-strong: var(--bs-gray-500);
    /* Darker border for controls */
    --bs-text-color-dark: var(--bs-gray-900);
    /* Dark text */

    /* NEW: Define a prominent dark color for the Authentication Group area */
    --bs-auth-fill: var(--bs-gray-700);

    /* Apply Custom Backgrounds for Panel and Headers */
    #left-panel,
    #toolbar,
    .bg-body-tertiary {
        background-color: var(--bs-body-bg-custom) !important;
    }

    /* Stronger Border for all Fieldsets/Borders */
    .border {
        border-color: var(--bs-border-color-strong) !important;
    }

    /* Input/Select Contrast */
    .form-control,
    .form-select,
    .input-group-text,
    .card-body {
        border-color: var(--bs-border-color-strong) !important;
        background-color: var(--bs-body-bg-custom-lighter) !important;
        color: var(--bs-text-color-dark) !important;
    }

    /* FIX 1: Pixel Editor Contrast */
    #pixel-editor-grid-container {
        border: 1px solid var(--bs-gray-700);
        /* Very dark border around the grid */
    }

    /* FIX 2: Transparent Pixel Cells (Clearer Checkerboard) */
    .pixel-editor-cell {
        background-color: rgba(0, 0, 0, 0.15);
    }

    /* FIX 3: Gradient Preview Bar - Use Darkest Grays for Checkerboard */
    .gradient-preview-bar {
        border-color: var(--bs-border-color-strong);
        background-image:
            linear-gradient(45deg, var(--bs-gray-400) 25%, transparent 25%),
            linear-gradient(-45deg, var(--bs-gray-400) 25%, transparent 25%),
            linear-gradient(45deg, transparent 75%, var(--bs-gray-400) 75%),
            linear-gradient(-45deg, transparent 75%, var(--bs-gray-400) 75%);
    }

    /* FIX 4 & 5: Gradient Marker Contrast */
    .gradient-stop-marker {
        border-color: var(--bs-gray-900);
        /* Dark border for visibility */
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    }

    .gradient-stop-marker.active {
        border-color: var(--bs-primary);
        /* Strong color for active state */
    }

    /* FIX 6: Gradient Active Controls Background (Distinct, clean background) */
    .gradient-active-stop-controls {
        background-color: var(--bs-body-bg-custom-lighter);
        border: 1px solid var(--bs-border-color-strong);
        box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
    }

    /* FIX 7: Polyline Node Table (Clear White Table with Stronger Borders) */
    .node-table {
        --bs-table-bg: var(--bs-body-bg-custom-lighter);
        --bs-table-color: var(--bs-text-color-dark);
        --bs-table-border-color: var(--bs-border-color-strong);
    }

    /* FIX 8: Control Group Header/Background */
    .bg-body-tertiary {
        background-color: var(--bs-body-bg-custom) !important;
    }

    /* FIX 9: Notification Read Item (Clear background for high contrast) */
    .notification-read {
        background-color: var(--bs-gray-200);
        opacity: 1;
    }

    /* -------------------------------------------------------- */
    /* CRITICAL FIX: Make TOOLBAR BUTTONS SOLID in Light Theme  */
    /* -------------------------------------------------------- */

    #toolbar .btn.btn-outline-secondary {
        /* Set base appearance to be a filled button */
        --bs-btn-bg: var(--bs-gray-300);
        /* Light gray background */
        --bs-btn-border-color: var(--bs-gray-400);
        /* Clear border */
        --bs-btn-color: var(--bs-gray-900);
        /* Dark text/icon color */
    }

    #toolbar .btn.btn-outline-secondary:hover:not([disabled]),
    #toolbar .btn.btn-outline-secondary:active:not([disabled]) {
        /* Increase contrast and give feedback on hover/active */
        --bs-btn-bg: var(--bs-gray-400);
        --bs-btn-border-color: var(--bs-gray-500);
        --bs-btn-color: var(--bs-gray-900);
    }

    /* Ensure the Constrain button's 'on' state (btn-secondary) remains solid and prominent */
    #toolbar .btn.btn-secondary {
        --bs-btn-bg: var(--bs-gray-600);
        --bs-btn-border-color: var(--bs-gray-600);
        --bs-btn-color: #fff;
    }
}

/* -------------------------------------------------------- */
/* 5. Utility and Layout (Unchanged)                        */
/* -------------------------------------------------------- */

.color-picker-swatch {
    width: 100%;
    height: 2.375rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    cursor: pointer;
}

#modal-picker-container {
    width: 240px;
    height: 240px;
}

.gradient-active-stop-controls>.d-flex>.d-flex {
    align-items: center !important;
}

#left-panel {
    width: 500px;
    flex-shrink: 0;
}

#right-panel {
    flex-grow: 1;
    min-width: 0;
}

.gradient-stop-marker.is-dragging {
    transition: none !important;
}


#pixel-editor-palette {
    flex-wrap: wrap;
    gap: 5px;
}

/* This rule is updated */
#gif-results-container .card-img-top {
    height: 120px;
    width: 100%;
    object-fit: contain;
    /* Changed from 'cover' to 'contain' */
    background-color: #333;
}

#gif-search-modal .modal-body {
    padding: 0;
    /* Remove padding from the main scrollable area */
}

#gif-search-form {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bs-modal-bg);
    padding: 1rem;
    /* Add padding to the form itself to create space */
    border-bottom: 1px solid var(--bs-border-color);
    /* Add a separator line */
}

#gif-results-container {
    padding: 1rem;
    /* Add padding to the results area so it's not stuck to the edges */
}

.gif-dims-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 5px;
    font-size: 0.75rem;
    border-top-left-radius: 0.25rem;
}

.custom-color-inputs .input-group-text {
    width: 50px;
    /* Aligns the HEX and RGB labels */
    justify-content: center;
}

.comment-item {
    display: flex;
    gap: 0.75rem; /* 12px */
    margin-bottom: 1rem; /* 16px */
    font-size: 0.875rem; /* 14px */
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0; /* Prevent avatar from shrinking */
}

.comment-body {
    flex-grow: 1;
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem; /* 8px */
    margin-bottom: 0.25rem;
}

.comment-author {
    font-weight: 600;
    color: var(--bs-body-color);
}

.comment-date {
    font-size: 0.75rem; /* 12px */
    color: var(--bs-secondary-color);
}

.comment-text {
    color: var(--bs-body-color);
    white-space: pre-wrap; /* Respect newlines */
    word-break: break-word; /* Break long words */
}

.comment-delete a {
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s ease-in-out;
}

.comment-delete a:hover {
    opacity: 1;
}

#canvas-container {
    position: relative; /* Ensure absolute children position relative to this */
}

.srgb-gif-overlay {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left; /* Logic calculates center, so we transform from top-left reference */
    pointer-events: none; /* CRITICAL: Allows clicking "through" the GIF to select the object on canvas */
    z-index: 10;
}

#canvas-container {
    position: relative;
    overflow: hidden;
}

/* --- Kebab Menu Button --- */
.btn-kebab {
    background: transparent;
    border: none;
    color: var(--bs-body-color);
    padding: 0.25rem 0.5rem;
    line-height: 1;
    font-size: 1.25rem;
    opacity: 0.7;
    transition: opacity 0.2s, color 0.2s;
}

.btn-kebab:hover, .btn-kebab:focus {
    opacity: 1;
    color: var(--bs-primary);
}

/* Optional: Remove the default bootstrap dropdown toggle arrow if present */
.btn-kebab::after {
    display: none;
}

/* --------------------------------------------------------
   GTranslate Custom Styling (Bootstrap Dark Theme)
   -------------------------------------------------------- */

/* 5. Hide the floating popup if it ever tries to appear */
#goog-gt-tt {
    display: none !important;
}

/* STABILIZE THE GOOGLE GLOBE (Robust Version) */

/* 1. Target the first DIV inside your wrapper */
/* This catches the container regardless of its weird class name */
#google_translate_element > div {
    z-index: 10000 !important;
    position: fixed !important;
    
    /* Hardware acceleration to stop flickering */
    transform: translate3d(0, 0, 0) !important;
    will-change: transform;
    backface-visibility: hidden;
    
    /* Position settings */
    bottom: 20px !important;
    right: 20px !important;
    top: auto !important;
    left: auto !important;
}

/* 2. Target the SVG (The actual globe graphic) */
/* This ensures the vector graphic itself is stable */
#google_translate_element svg {
    transform: translateZ(0); 
    shape-rendering: geometricPrecision;
    width: 48px !important; /* Optional: Enforce a stable size */
    height: 48px !important;
}

/* Optional: Hide the powered by text if you want a cleaner look */
.gt_powered_by {
    display: none !important;
}

/* Make the brand area look like a clickable button on hover */
.brand-dropdown-toggle {
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Subtle background highlight. Adjust the rgba values if you want it brighter */
.brand-dropdown-toggle:hover,
.brand-dropdown-toggle[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.1); 
}

/* Base style for the chevron icon */
.dropdown-indicator {
    font-size: 0.8rem;
    opacity: 0.8;
    transition: transform 0.3s ease-in-out; /* Makes the rotation smooth */
}

/* Rotate the arrow 180 degrees when the menu is open */
.brand-dropdown-toggle[aria-expanded="true"] .dropdown-indicator {
    transform: rotate(-180deg);
    color: var(--bs-primary); /* Highlights the arrow in blue when open */
}

/* Creates a radar-like ripple effect */
@keyframes load-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.8);
        background-color: rgba(13, 110, 253, 0.2);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(13, 110, 253, 0);
        background-color: transparent;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
        background-color: transparent;
    }
}

/* Apply this class to the element you want to grab attention */
.pulse-on-load {
    /* Runs the 1.5 second animation exactly 2 times, then stops forever */
    animation: load-pulse 1.5s cubic-bezier(0.165, 0.84, 0.44, 1) 2; 
    border-radius: 0.5rem; /* Keeps the glowing outline rounded */
}

/* -------------------------------------------------------- */
/* 6. MOBILE RESPONSIVENESS (View-Only Mode)                */
/* -------------------------------------------------------- */

@media (max-width: 992px) {
    /* Stack elements vertically if needed */
    #main-split {
        flex-direction: column !important;
    }

    /* Hide the controls panel to prioritize the canvas */
    #left-panel {
        display: none !important;
    }

    /* Make the canvas panel take the full width */
    #right-panel {
        width: 100% !important;
        flex-grow: 1;
    }

    /* Ensure the canvas scales down to fit the screen */
    #canvas-container,
    #signalCanvas {
        max-width: 100%;
        height: auto !important;
    }
    
    /* Hide the toolbar to maximize canvas viewing space */
    #toolbar {
        display: none !important;
    }

    /* 1. Show the title and author above the canvas */
    #mobile-effect-header {
        display: block !important;
    }

    /* 2. Keep the like/share buttons below the canvas, but center them nicely */
    #effect-details-row {
        justify-content: center;
        flex-wrap: wrap;
        padding: 1rem 0 !important;
    }

    /* Hide New, Open, and Save buttons on mobile */
    #new-ws-btn,
    #load-ws-btn,
    #save-ws-btn {
        display: none !important;
    }
}

/* Extra small devices (phones) */
@media (max-width: 576px) {
    /* Hide the text on major action buttons to save space, keeping only the icons */
    .navbar .btn i + span, 
    .navbar .btn i + b,
    .navbar .btn i + .me-1 {
        display: none;
    }
    
    .navbar-brand img {
        height: 1.2em !important;
    }
    
    /* Hide the coordinate tracker since there is no mouse hover on mobile */
    #coords-display, 
    .bi-crosshair {
        display: none !important;
    }
}

/* Container - Matches the height of your other buttons exactly */
.translate-container {
    position: relative;
    display: flex;
    align-items: center;
    height: 38px; /* Standard Bootstrap btn-secondary is usually 38px or 40px */
    margin-right: 1rem !important;
}

/* The actual dropdown menu */
.gtranslate_wrapper select {
    background-color: #6c757d !important; /* Standard Bootstrap secondary gray */
    color: white !important;
    border: none !important;
    border-radius: 6px !important; /* Bootstrap default radius */
    
    /* Height and Line-Height are key for vertical alignment */
    height: 38px !important; 
    line-height: 38px !important; 
    font-size: 14px !important;
    cursor: pointer !important;
    outline: none !important;

    /* Padding: Pushes text right for the icon and left for the arrow */
    padding: 0 32px 0 42px !important; 
    width: 100% !important;

    /* Custom Arrow */
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 10px 10px !important;
    
    transition: background-color 0.15s ease-in-out !important;
}

/* The Icon positioning */
.translate-icon {
    position: absolute;
    left: 12px;
    z-index: 2;
    pointer-events: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* --- Sleek Preset Card Styles --- */
.preset-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.preset-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--bs-info);
    transform: translateX(4px);
}

.preset-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.1rem;
}

.preset-details {
    font-size: 0.75rem;
    color: #adb5bd;
    font-family: 'Segoe UI Mono', 'Consolas', monospace;
}

.btn-preset-preview {
    border-color: rgba(13, 202, 240, 0.4);
    color: #0dcaf0;
}

.btn-preset-preview:hover {
    background-color: #0dcaf0;
    color: #000;
}

/* Custom Accordion Styling */
.accordion-button:not(.collapsed) {
    background-color: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

.x-small { font-size: 0.7rem; }
.btn-xxs { padding: 0.1rem 0.4rem; font-size: 0.65rem; }

/* Keep the preview pinned while scrolling content */
#effect-iframe-container {
    background: radial-gradient(circle, #1a1a1a 0%, #000 100%);
}

/* --- 1. CORE ALIGNMENT & GUTTER FIX --- */

/* Removes the internal 1.25rem padding from the button to align text left */
#propsAccordion {
    --bs-accordion-btn-padding-x: 0 !important;
    --bs-accordion-padding-x: 0 !important;
    --bs-accordion-btn-padding-y: 1rem !important; /* Keeps vertical spacing */
}

/* Scorched earth approach for the button itself */
#propsAccordion .accordion-button {
    --bs-accordion-btn-padding-x: 0 !important;
    padding-left: 0 !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
}

/* Ensure the text and icon inside the button have no offset */
#propsAccordion .accordion-button > div {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* Alignment fix for the table inside when expanded */
#propsAccordion .accordion-body {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Removes the default rounded corners and borders from the item container */
#propsAccordion .accordion-item {
    background-color: transparent !important;
    border: none !important;
}

/* --- 2. VISUAL CUES & INTERACTIVITY --- */

/* Adds a subtle cyan indicator bar on the far left when hovered */
#propsAccordion .accordion-item:hover {
    border-left: 3px solid #0dcaf0 !important;
    padding-left: 10px; /* Slight shift to signal it is clickable */
    transition: all 0.2s ease-in-out;
}

/* Styles the "Click to expand" hint text */
.accordion-hint {
    font-size: 0.65rem;
    display: block;
    color: #6c757d;
    font-weight: 400;
    margin-top: -2px;
}

/* Makes the Bootstrap arrow icon white to match the dark theme */
#propsAccordion .accordion-button::after {
    filter: invert(1) grayscale(1) brightness(2);
    margin-left: auto;
}

/* --- 3. INTERNAL TABLE STYLING --- */

/* Ensures the properties table looks like a native SignalRGB tool */
#propsAccordion .table {
    border-color: #333 !important;
    margin-top: 10px;
}

#propsAccordion .table-light {
    --bs-table-bg: #2a2a2a;
    --bs-table-color: #0dcaf0;
    border-color: #444;
}

#propsAccordion code.text-primary {
    color: #0dcaf0 !important; /* Keeps variable names cyan */
    background: rgba(13, 202, 240, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
}

/* Target the button specifically to override internal SCSS values */
.accordion-button.bg-dark.text-info {
    /* Nuke the horizontal padding variables */
    --bs-accordion-btn-padding-x: 0 !important;
    --bs-accordion-padding-x: 0 !important;
    
    /* Force properties for browsers not using variables */
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Align the internal div to the absolute left */
.accordion-button .w-100 {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Optional: Subtle divider to replace the 'box' look */
.accordion-button.border-secondary {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* --- Global Section Card Style --- */
.section-card {
    background-color: rgba(255, 255, 255, 0.03); /* Subtle dark lift */
    border: 1px solid rgba(255, 255, 255, 0.1); /* Thin divider line */
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s ease;
}

.section-card:hover {
    border-color: rgba(13, 202, 240, 0.3); /* Subtle cyan glow on hover */
}

.section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

/* Ensure the preview container is exactly the scaled height */
#effect-iframe-container {
    background: radial-gradient(circle, #1a1a1a 0%, #000 100%);
    width: 100% !important; /* Adapt to modal width instead of a fixed 640px */
    height: 400px; /* Fixed height to match 200px * scale(2) */
    position: relative;
}

/* Sharp rendering for the SignalRGB canvas */
#effect-preview-iframe {
    image-rendering: pixelated; 
    image-rendering: crisp-edges;
    transform-origin: center center; /* Critical for flex centering */
}

/* --- Preview Stage Styling --- */
.preview-stage {
    background-color: #000;
    height: 400px;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#effect-preview-iframe {
    width: 320px;
    height: 200px;
    border: none;
    transform-origin: center center; /* Critical for centering when scaled */
    /* Prevents blurriness on high-DPI screens */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Ensure the scrollbar doesn't overlap the preview header */
.modal-dialog-scrollable .modal-content {
    max-height: 90vh;
}

/* Jose, this locks the stage to exactly the 1.6 aspect ratio */
.preview-stage {
    background-color: #000;
    width: 100%;
    /* 400px height is exactly 200px * scale(2.0) */
    height: 400px; 
    display: flex;
    justify-content: center;
    /* This is the key: prevents Bootstrap from stretching the iframe */
    align-items: center; 
    overflow: hidden;
    position: relative;
}

#effect-preview-iframe {
    /* Lock the base resolution */
    width: 320px !important;
    height: 200px !important;
    border: none;
    background-color: #000;
    /* Ensures scaling happens from the center point */
    transform-origin: center center;
    /* Keeps SignalRGB pixels sharp */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Jose, add this to your styles.css to nuke that 20px offset */
#propertiesAccordion .accordion-button {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#propertiesAccordion .accordion-body {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Sleek dark-mode scrollbar for the side-by-side modal */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}