
/* --- Reset and Base Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f1f5f9; /* bg-slate-100 */
    color: #1e293b; /* text-slate-800 */
}

button, input, select {
    font-family: inherit;
    vertical-align: middle;
}

/* --- Main App Layout --- */
.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-header {
    position:relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem; /* py-3 px-4 */
    padding-left:10px;
    border-radius: 10px 10px 0 0;
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); /* shadow-sm */
    border-bottom: 1px solid #e2e8f0; /* border-b border-slate-200 */
    z-index: 20; /* Ensure header is on top */
}

.app-header h1 {
    font-size: 1.25rem; /* text-xl */
    font-weight: 700; /* font-bold */
    color: #4f46e5; /* text-indigo-600 */
    margin:0px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 5px; /* gap-3 */
}





.header-btn {
    padding: 0.5rem; /* p-2 */
    border-radius: 0.5rem; /* rounded-lg */
    color: #64748b; /* text-slate-500 */
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.header-btn:hover {
    background-color: #f1f5f9; /* hover:bg-slate-100 */
    color: #334155; /* hover:text-slate-700 */
}

.header-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.btn {
    padding: 0.5rem 1rem; /* px-4 py-2 */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    border-radius: 0.5rem; /* rounded-lg */
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary {
    background-color: #ffffff;
    border: 1px solid #cbd5e1; /* border border-slate-300 */
    color: #334155; /* text-slate-700 */
}
.btn-secondary:hover {
    background-color: #f8fafc; /* hover:bg-slate-50 */
}

.btn-primary {
    color: #ffffff;
    background-color: #4f46e5; /* bg-indigo-600 */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); /* shadow-sm */
}
.btn-primary:hover {
    background-color: #4338ca; /* hover:bg-indigo-700 */
}
.google-font-btn {
    font-family: inherit;
    padding: 4px 10px;
    border: 1px solid #ddd;
    background: #fff;
    color: #222;
    cursor: pointer;
}
.btn-close {
     
        margin-left: 0.5rem;
    position: absolute;
    top: -13px;
    right: -12px;
    border: 1px solid white;
    border-radius: 50%;
    padding: 4px;
    background: #ffffff;
    box-shadow: 0px 0px 11px 1px #a19e9e;
}


#closeButton {
    position: relative;
    padding: 5px 10px;
    background-color: transparent;
    color: black;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 30px;
    float: right;
    background: white;
    /* border: 1px solid gray; */
    padding: 7px;
    width: 35px;
    height: 35px;
    display: flex;
    align-content: center;
    align-items: center;
    flex-wrap: wrap;
    border-radius: 50%;
    font-size: 19px;
    justify-content: center;
    box-shadow: 0px 0px 9px 3px #cdcdcd;
}

/* --- Top Contextual Menubar --- */
.app-menubar {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 0.5rem; /* gap-2 */
    padding: 0.5rem 1rem; /* p-2 px-4 */
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    min-height: 53px; /* Set a min-height */
    z-index: 10;
}

.menubar-divider {
    width: 1px;
    height: 1.5rem; /* h-6 */
    background-color: #e2e8f0; /* bg-slate-200 */
    margin: 0 0.25rem; /* mx-1 */
}

/* This holds the contextual properties */
.menubar-properties {
    /* display: none;  */
    display: flex; 
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.menubar-properties.active {
    display: flex;
}

/* This holds the default message */
.menubar-default {
        display: none;
}
.menubar-default.active {
    display: flex;
    align-items: center;
    color: #64748b;
}
    .menubar-default svg {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    }

/* --- Form Elements for Menubar --- */
.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    margin-left: 0.5rem;
    margin-right: 0.25rem;
}

.form-input, .form-select {
    padding: 0.375rem 0.75rem; /* py-1.5 px-3 */
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem; /* rounded-md */
}
.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px #c7d2fe;
}

.form-select {
    width: 9rem; /* w-36 */
}
.form-input[type="number"] {
    width: 5rem; /* w-20 */
}

.form-color {
       width: 2.0rem;
    height: 2.0rem;
    padding: 0.05rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    cursor: pointer;
    vertical-align: middle;
}

.form-range {
    width: 8rem; /* w-32 */
    vertical-align: middle;
}

/* Buttons for Menubar */
.btn-menubar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    /* padding: 0.375rem 0.75rem; */
    padding: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    background: #fff;
    cursor: pointer;
}
.btn-menubar:hover {
    background-color: #f8fafc;
}
.btn-menubar:focus {
    background-color: #eef2ff;
    color: #4338ca;
}
.btn-menubar svg {
    width: 16px; height: 16px;
}

.btn-menubar-icon {
    padding: 0.5rem;
    color: #334155;
    border-radius: 0.375rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
        margin-top: 6px;
}



.btn-panel-action {
    padding: 5px;
    color: #334155;
    border-radius: 0.375rem;
    /* border: 1px solid #cbd5e1; */
    background: #fff;
    cursor: pointer;
    display: flex
;
    align-items: center;
    justify-content: center;
}

.btn-panel-action :hover {
    /* background-color: #f8fafc; */
}


.btn-panel-action svg {
    width: 16px; height: 16px;
}


.btn-menubar-icon:hover {
    background-color: #f8fafc;
}
.btn-menubar-icon.delete-btn {
    color: #dc2626;
    border-color: #fecaca;
}
.btn-menubar-icon.delete-btn:hover {
    background-color: #fee2e2;
}

.fonts-tab-desc{
    color:gray;
}


#canvasNavigatorSidebarIcon {
    border-radius: 3px;
    padding: 3px;
}
#canvasNavigatorSidebarIcon svg{
    fill:#252525;
}


 

#canvasNavigatorSidebarIcon:focus {
    background-color: rgb(19, 38, 244);
}

#canvasNavigatorSidebarIcon svg:focus {
    fill: rgb(255, 255, 255);
}


.btn-menubar-icon svg {
    width: 18px; height: 18px; display: block;
}
/* --- End of Menubar Styles --- */


.app-content {
    display: flex;
    flex: 1 1 0%;
    overflow: hidden;
}

/* --- Left Toolbar --- */
.left-toolbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 4rem; /* w-16 */
    gap: 0.25rem; /* gap-1 */
    padding: 0.5rem; /* p-2 */
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    z-index: 5;
}

.tool-button {
    width: 100%;
    padding: 0.75rem; /* p-3 */
    border-radius: 0.5rem;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.tool-button:hover {
    background-color: #eef2ff; /* hover:bg-indigo-50 */
    color: #4f46e5; /* hover:text-indigo-600 */
}

.tool-button.active {
       /* background-color: #fff;
    color: #4f46e5; */
    background-color: #4f46e5;
    color: #fff;
    box-shadow: 0px 0px 9px 3px #c8c8c8;
}


.tool-button.active svg, .tool-button.active path {
    fill: #fff;
    stroke: #fff;
}

.tool-button svg {
    width: 24px;
    height: 24px;
    margin: 0 auto;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toolbar-spacer {
    flex: 1 1 0%;
}

/* --- Properties Panel (Sidebar) --- */
.properties-panel {
    width: 18rem; /* w-72 */
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    z-index: 5;
}

/* Custom scrollbar */
.properties-panel::-webkit-scrollbar {
    width: 6px;
}
.properties-panel::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}
.properties-panel::-webkit-scrollbar-track {
    background-color: #f1f5f9;
}

.panel-content {
    display: none; /* 'hidden' class */
    padding: 1rem; /* p-4 */
    padding-top: 0px;
    max-height: 467px;
    height: 467px;
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: #b6b6b6 #fff;
}

/* Supermodern Mac-like scrollbar for Webkit browsers */
.panel-content::-webkit-scrollbar {
    width: 6px;
    background: transparent;
    border-radius: 8px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #e0e0e0 0%, #b6b6b6 100%);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(49,97,83,0.15);
    border: none;
    min-height: 24px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #b6b6b6 0%, #888888 100%);
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 8px;
}

.panel-content.active {
    display: block;
}

.panel-content-flex {
    display: none; /* for default panel */
}

.panel-content-flex.active {
    display: flex;
}

.panel-content > *:not(h2) {
    margin-top: 1rem; /* space-y-4 */
}
.panel-content h2 {
    margin-top: 0;
}


#panel-default {
    text-align: center;
    color: #64748b;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#panel-default svg {
    margin-bottom: 0.75rem;
    color: #94a3b8;
}
#panel-default .font-medium {
    font-weight: 500;
}
#panel-default .text-sm {
    font-size: 0.875rem;
}

/* Panel Form Elements */
.panel-content h2 {
    font-size: 1.125rem; /* text-lg */
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}
.properties-panel .panel-header h2{
     font-size: 1.125rem; /* text-lg */
    font-weight: 600;
    margin:0px;
 
    padding-bottom: 0.5rem;
}

.properties-panel .panel-header{
    display:flex;
    justify-content:space-between;
    padding: 8px;
    position: sticky;
    padding-bottom: 0px;
       border-bottom: 1px solid #e2e8f0;
}

/* Re-using menubar form styles for panel */
.panel-content .form-label {
    display: block;
    margin-left: 0;
    margin-bottom: 0.25rem;
}

.panel-content .form-input,
.panel-content .form-select,
.panel-content .form-color,
.panel-content .form-range {
    width: 100%;
}

.panel-content .form-color {
        height: 2.5rem; /* h-10 */
}

.flex-row {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
}
.flex-row > .flex-1 {
    flex: 1 1 0%;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem; /* gap-2 */
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem; /* gap-3 */
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem; /* gap-1 */
}

.btn-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    width: 100%;
}
.btn-panel:hover {
    background-color: #f8fafc;
}
.btn-panel:focus {
    background-color: #eef2ff;
    color: #4338ca;
}
.btn-panel svg {
    width: 16px; height: 16px;
}

.btn-panel-icon {
    padding: 0.5rem;
    color: #334155;
}
.btn-panel-icon svg {
    margin: 0 auto;
}

.btn-panel-primary {
    width: 100%;
    font-weight: 500;
    color: #ffffff;
    background-color: #4f46e5;
    border: none;
}
.btn-panel-primary:hover {
    background-color: #4338ca;
    color: #ffffff !important;
}

.btn-panel-danger {
    width: 100%;
    font-weight: 500;
    color: #ffffff;
    background-color: #dc2626; /* bg-red-600 */
    border: none;
}
.btn-panel-danger:hover {
    background-color: #b91c1c; /* hover:bg-red-700 */
}

.shape-button {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    height:80px;
}

.properties-panel-collapsed {
    width: 48px !important;
    min-width: 48px !important;
    transition: width 0.3s;
    overflow: hidden;

}
.properties-panel-toggle {
    position: absolute;
    top: 12px;
    left: -18px;
    background: #23272f;
    border-radius: 50%;
    border: 1px solid #37c89f;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(49,97,83,0.10);
}
 
.shape-button:hover {
    background-color: #f1f5f9;
}
.shape-button svg {
    width: 32px;
    height: 32px;
    color: #334155;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.clipart-item {
    aspect-ratio: 1 / 1;
    background-color: #e2e8f0;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.875rem;
    cursor: pointer;
}
.clipart-item:hover {
    box-shadow: 0 0 0 2px #4f46e5; /* hover:ring-2 */
}
/* --- End Sidebar Panel Styles --- */


/* --- Main Canvas Area --- */
.canvas-area {
    flex: 1 1 0%; /* Takes up remaining space */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem; /* p-8 */
    overflow: auto;
    background-color: #f1f5f9;
    position: relative;
}

#canvas-wrapper {
    background-color: #ffffff;
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); /* shadow-lg */
    position: relative;
    width: 400px;
    height: 600px;
}

#canvas-wrapper .canvas-sidebar-left {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4rem; /* w-16 */
    background-color: #7dd3fc; /* bg-sky-300 */
    border-top-left-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
}

#canvas-wrapper .canvas-sidebar-right {
    position: absolute;
    inset: 0 0 0 auto;
    width: 4rem; /* w-16 */
    background-color: #7dd3fc; /* bg-sky-300 */
    border-top-right-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

/* Mock Objects */
#mock-pennant {
    position: absolute;
    cursor: pointer;
    top: 200px;
    left: 60px;
    border: 2px dashed transparent;
    transition: border-color 0.2s;
}

#mock-text {
    position: absolute;
    cursor: pointer;
    padding: 0.5rem; /* p-2 */
    top: 100px;
    left: 100px;
    border: 2px dashed transparent;
    transition: border-color 0.2s;
}

#mock-text span {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700; /* font-bold */
    font-family: 'ABeeZee', sans-serif;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* shadow-md */
    border-radius: 0.5rem;
    padding: 0.25rem;
    border: 1px solid #e2e8f0;
    z-index: 5;
}
.zoom-controls button {
    padding: 0.5rem;
    border-radius: 0.25rem;
    color: #334155;
    background: transparent;
    border: none;
    cursor: pointer;
}
.zoom-controls button:hover {
    background-color: #f1f5f9;
}
.zoom-controls button svg {
    width: 18px; height: 18px; display: block;
}
.zoom-controls span {
    padding: 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}



/* navigator css */

/* 
#canvasNavigatorPanel {
    position: fixed;
    top: 80px;
    right: 40px;
    z-index: 999;
    width: 260px;
    min-height: 48px;
    max-height: 420px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0px 1px 11px 4px rgb(49 97 83);
    padding: 0 0 8px 0;
    overflow: auto;
    user-select: none;
    display: none;
    transform: scale(0.2) translateY(-120px) skewY(-18deg) rotateZ(-12deg);
    opacity: 0;
    filter: blur(24px) brightness(1.2);
    transition: transform 0.5s cubic-bezier(.22,1.61,.36,1), opacity 0.4s, filter 0.4s;
}

#canvasNavigatorPanel.opening {
    display: block;
    transform: scale(1.08) translateY(10px) skewY(2deg) rotateZ(2deg);
    opacity: 1;
    filter: blur(0px) brightness(1);
}

#canvasNavigatorPanel.opened {
    transform: scale(1) translateY(0) skewY(0deg) rotateZ(0deg);
}

#canvasNavigatorPanel.closing {
    transform: scale(1.08) translateY(10px) skewY(2deg) rotateZ(2deg);
    opacity: 0.7;
    filter: blur(6px) brightness(1.1);
}

#canvasNavigatorPanel.closed {
    transform: scale(0.2) translateY(-120px) skewY(-18deg) rotateZ(-12deg);
    opacity: 0;
    filter: blur(24px) brightness(1.2);
    display: none;
}

#canvasNavigatorPanel .navigator-drag-handle {
    width: 100%;
    height: 32px;
    cursor: move;
    background: #37c89f;
    border-radius: 14px 14px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

#canvasNavigatorPanel .navigator-drag-handle span {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

#canvasNavigatorPanel .navigator-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    display: flex;
    align-items: center;
}

#canvasNavigatorList {
    padding: 8px 12px;
}

#canvasNavigatorList .navigator-item {
    padding: 7px 0 7px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

#canvasNavigatorList .navigator-item:hover {
    background: #f8fafc;
}

#canvasNavigatorList .navigator-label {
    font-size: 1rem;
    color: #334155;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
} */




#close-button{
    display:none;
}

.menubar-header{
    display:none;
}
/* --- Shortcuts Modal --- */
.shortcuts-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    display: none; /* Changed from display: flex !important */
    justify-content: center !important;
    align-items: center !important;
    z-index: 10000000 !important;
}

.shortcuts-modal.show {
    display: flex !important;
}

.shortcuts-modal-content {
    background-color: #ffffff !important;
    width: 90% !important;
    max-width: 600px !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    animation: modalFadeIn 0.3s ease-out !important;
    position: relative !important;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.shortcuts-modal-header {
    padding: 1.25rem 1.5rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background-color: #f8fafc !important;
}

.shortcuts-modal-header h2 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #4f46e5 !important;
    margin: 0 !important;
}

.close-modal-btn {
    background: none !important;
    border: none !important;
    font-size: 2.5rem !important;
    color: #64748b !important;
    cursor: pointer !important;
    line-height: 1 !important;
}

.close-modal-btn:hover {
    color: #1e293b !important;
}

.shortcuts-modal-body {
    padding: 1.5rem !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
}

.shortcut-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
}

.shortcut-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.75rem !important;
    background-color: #f1f5f9 !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
}

.shortcut-key {
    font-weight: 700 !important;
    color: #4f46e5 !important;
    background-color: #fff !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    border-bottom: 2px solid #cbd5e1 !important;
    font-size: 0.85rem !important;
    font-family: monospace !important;
}

.shortcut-label {
    font-size: 0.9rem !important;
    color: #334155 !important;
}

@media (max-width: 640px) {
    .shortcut-grid {
        grid-template-columns: 1fr !important;
    }
}
