.CanvasEditor_Mask {
    background-color: rgba(0, 0, 0, 0.4);
}

.CanvasEditor_Outer {
    position: fixed;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    width: 100%;
    height: 100%;
    z-index: 1040;
    background: linear-gradient(180deg, rgba(159, 195, 237, 1) 80%, rgb(222 234 247) 100%);
}

.CanvasEditor_Header {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 58px;
    background-color: rgb(48, 48, 48);
    z-index: 100;
    padding: 0.75rem 1rem;
    box-shadow: 0px 2px 7px 0px rgba(31, 41, 60, 0.3);
}

.CanvasEditor_Toolbar {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 50px;
    background-color: #e9ecef;
    z-index: 99;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Toolbar button styling - cleaner outline style to match side panel */
.CanvasEditor_Outer .CanvasEditor_Toolbar .btn-primary {
    background-color: #fff !important;
    color: #6e81a5 !important;
    border: 2px solid #6e81a5 !important;
    border-radius: 5px !important;
    border-bottom-width: 2px !important;
    text-shadow: none !important;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    transition: all 0.15s ease;
}

.CanvasEditor_Outer .CanvasEditor_Toolbar .btn-primary:hover {
    background-color: #6e81a5 !important;
    color: #fff !important;
    border-color: #6e81a5 !important;
    border-bottom-width: 2px !important;
    text-shadow: none !important;
}

.CanvasEditor_Outer .CanvasEditor_Toolbar .btn-primary:active {
    background-color: #5c6f8f !important;
    border-color: #5c6f8f !important;
    transform: none !important;
    border-bottom-width: 2px !important;
}

.CanvasEditor_Outer .CanvasEditor_Toolbar .btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(110, 129, 165, 0.25) !important;
    border-bottom-width: 2px !important;
    background-color: #fff !important;
    color: #6e81a5 !important;
}

.CanvasEditor_Toolbar_Child {
    position: absolute;
    top: 30px;
    left: 42px;
    width: 100px;
    height: 100%;
    background-color: #f8f9fa;
    z-index: 50;
    box-shadow: 2px 0px 4px 0px rgba(0, 0, 0, 0.2);
}

/* Match site's primary button styling */
.CanvasEditor_Outer .btn-primary {
    border-color: transparent;
    border-radius: 7px;
    color: #FFF;
    text-decoration: none;
    transition: all 0.1s;
    -webkit-transition: all 0.1s;
    background-color: #6e81a5;
    border-bottom: 5px solid #4f5b70;
    text-shadow: 0px -2px #5a6a89;
}

.CanvasEditor_Outer .btn-primary:hover {
    background-color: #7c91b7;
    border-bottom: 5px solid #4f5b70;
    text-shadow: 0px -2px #637495;
    box-shadow: none;
}

.CanvasEditor_Outer .btn-primary:not(:disabled):not(.disabled):active,
.CanvasEditor_Outer .btn-primary:not(:disabled):not(.disabled).active,
.CanvasEditor_Outer .show>.btn-primary.dropdown-toggle {
    background-color: #4f5b70;
    border-bottom: 5px solid #4f5b70;
}

.CanvasEditor_Outer .btn-primary:focus,
.CanvasEditor_Outer .btn-primary.focus {
    border-color: #7c91b7;
    background-color: #7c91b7;
    border-bottom: 5px solid #4f5b70;
    text-shadow: 0px -2px #7c91b7;
    box-shadow: none;
}

.CanvasEditor_Outer .btn-primary.disabled,
.CanvasEditor_Outer .btn-primary:disabled {
    border-color: #7c91b7;
    background-color: #7c91b7;
    border-bottom: 5px solid #4f5b70;
    text-shadow: 0px -2px #7c91b7;
    opacity: 0.4;
}

/* Match site's danger button styling */
.CanvasEditor_Outer .btn-danger {
    border-color: transparent;
    border-radius: 7px;
    color: #FFF;
    text-decoration: none;
    transition: all 0.1s;
    -webkit-transition: all 0.1s;
    background-color: #c03d3d;
    border-bottom: 5px solid #8b2c2c;
    text-shadow: 0px -2px #8b2c2c;
}

.CanvasEditor_Outer .btn-danger:hover {
    background-color: #d15d5d;
    border-bottom: 5px solid #862b2b;
    text-shadow: 0px -2px #8b2c2c;
    box-shadow: none;
}

.CanvasEditor_Outer .btn-danger:focus,
.CanvasEditor_Outer .btn-danger.focus {
    border-color: #8b2c2c;
    background-color: #c03d3d;
    border-bottom: 5px solid #8b2c2c;
    text-shadow: 0px -2px #8b2c2c;
    box-shadow: none;
}

/* Match site's outline button styling */
.CanvasEditor_Outer .btn-outline-primary {
    border-color: #6e81a5;
    border-radius: 7px;
    color: #6e81a5;
    background-color: #fff;
    text-decoration: none;
    transition: all 0.1s;
    -webkit-transition: all 0.1s;
    border-width: 2px;
    border-bottom-width: 3px;
}

.CanvasEditor_Outer .btn-outline-primary:hover {
    background-color: #f0f4f8;
    border-color: #7c91b7;
    color: #7c91b7;
    box-shadow: none;
}

.CanvasEditor_Outer .btn-outline-danger {
    border-color: #c03d3d;
    border-radius: 7px;
    color: #c03d3d;
    background-color: #fff;
    text-decoration: none;
    transition: all 0.1s;
    -webkit-transition: all 0.1s;
    border-width: 2px;
    border-bottom-width: 3px;
}

.CanvasEditor_Outer .btn-outline-danger:hover {
    background-color: #fff5f5;
    border-color: #d15d5d;
    color: #d15d5d;
    box-shadow: none;
}

.CanvasEditor_Outer .btn-outline-danger.disabled,
.CanvasEditor_Outer .btn-outline-primary.disabled {
    opacity: 0.4;
}

/* Button active state with press effect */
.CanvasEditor_Outer .btn:active:not(:disabled):not(.disabled) {
    transform: translate(0px, 2px);
    -webkit-transform: translate(0px, 2px);
    border-bottom-width: 1px;
}

.CanvasEditor_Container {
    position: absolute;
    top: 58px;
    left: 0px;
    right: 320px;
    bottom: 0px;
    overflow: auto;
}

.CanvasEditor_CanvasOuter {
    position: absolute;
    top: 50px;
    left: 0px;
    background-color: transparent;
}

.CanvasEditor_Canvas {
    position: relative;
}

.CanvasEditor_Outer .details-section-header {
    font-weight: bold;
    font-size: 0.9rem;
    color: #303030;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid #6e81a5;
}

.CanvasEditor_Background {
    background-color: white;
    z-index: 0;
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.CanvasEditor_Border {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    z-index: 90;
    pointer-events: none;
    box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.4);
}

.canvas-container {
    z-index: 10;
}

.CanvasEditor_Details {
    position: absolute;
    top: 58px;
    right: 0;
    bottom: 0;
    width: 323px;
    background-color: #f8f9fa;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    border-left: 1px solid #dee2e6;
    box-shadow: -2px 0px 7px 0px rgba(31, 41, 60, 0.1);
    z-index: 150;
}

.details-group {
    width: 100%;
    display: block;
    margin-bottom: 1rem;
}

.details-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: #687a9c;
    font-weight: 500;
}

.CanvasEditor_Outer .form-control {
    min-width: 50px;
    border-radius: 5px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.CanvasEditor_Outer .form-control:focus {
    border-color: #6e81a5;
    box-shadow: 0 0 0 0.2rem rgba(110, 129, 165, 0.25);
}

.Template_Popover,
.Snippet_Popover {
    max-height: 80%;
    overflow: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.Template_Img {
    width: 95%;
    height: auto;
    background-color: white;
    cursor: pointer;
    overflow: auto;
    border-radius: 5px;
    transition: transform 0.2s ease;
}

.Template_Img:hover {
    transform: scale(1.05);
}

.SaveCmds {
    float: right;
}

.CanvasEditor_HeaderTitle {
    float: left;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.5;
    padding: 0.375rem 0;
    display: flex;
    align-items: center;
}

.font-size-label {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: #6e81a5;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}

/* Button icon styling */
.btn-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 0.35rem;
    margin-top: -2px;
    display: inline-block;
}

/* Dropdown menu styling */
.CanvasEditor_Outer .dropdown-menu {
    border-radius: 7px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.CanvasEditor_Outer .dropdown-item {
    transition: background-color 0.1s ease;
}

.CanvasEditor_Outer .dropdown-item:hover {
    background-color: #f0f4f8;
    color: #6e81a5;
}

/* Button groups in side panel */
.CanvasEditor_Details .btn-group {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.CanvasEditor_Details .btn-group .btn {
    flex: 1;
    margin-right: 0;
}

.CanvasEditor_Outer .btn-group .btn {
    margin-right: 0;
}

/* Full width buttons in side panel */
.CanvasEditor_Details .btn {
    width: 100%;
}

.CanvasEditor_Details .btn-group .btn {
    width: auto;
}

/* Form controls in side panel */
.CanvasEditor_Details .form-control {
    width: 100%;
}

/* Horizontal color picker row */
.colors-row {
    display: flex;
    gap: 0.5rem;
}

.colors-row .details-group {
    flex: 1;
    margin-bottom: 0.5rem;
}

/* Spacing utilities */
.CanvasEditor_Outer .mr-2 {
    margin-right: 0.5rem;
}

/* Small button adjustments */
.CanvasEditor_Outer .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 5px;
}

/* Custom scrollbar for details panel */
.CanvasEditor_Details::-webkit-scrollbar {
    width: 8px;
}

.CanvasEditor_Details::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.CanvasEditor_Details::-webkit-scrollbar-thumb {
    background: #6e81a5;
    border-radius: 4px;
}

.CanvasEditor_Details::-webkit-scrollbar-thumb:hover {
    background: #5c75a6;
}

/* Empty state for details panel */
.details-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
    margin-top: 2rem;
    color: #687a9c;
}

.details-empty-icon {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.details-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5a78;
    margin-bottom: 0.5rem;
}

.details-empty-hint {
    font-size: 0.82rem;
    line-height: 1.5;
    color: #8a9bba;
}

.Snippet_Img {
    max-width: 150px;
    max-height: 100px;
    cursor: pointer;
    display: block;
    margin: 0 auto 0.5rem;
}

/* Math symbols grid */
.math-symbols-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.3rem;
}

.math-symbols-grid .mathSymbol {
    width: 100%;
    min-width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}

/* Math symbols modal */
.math-symbols-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.math-symbols-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
}

.math-symbols-modal-content {
    position: relative;
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    max-width: 280px;
    width: 100%;
}

.math-symbols-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #303030;
}

.math-symbols-modal-close {
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Active state for super/sub toggle buttons */
.CanvasEditor_Outer .btn-outline-primary.active {
    background-color: #6e81a5 !important;
    color: #fff !important;
    border-color: #6e81a5 !important;
}