body {
    margin: 0;
    font-family: 'Roboto', Open Sans, sans-serif;
    background-color: #f5f5f5;
    color: #222;
}
h3, h4 {
	margin: 5px 0;
	font-family: Aladin;
}
hr {
    clear: both;
    margin-top: 1px;
}
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}
.top-bar {
    display: flex;
    align-items: center;
    padding: 5px;
    border-bottom: 2px ridge #eee;
	background-color: #fff;
    position: relative;
}
.logo {
    font-weight: bold;
    margin-right: 20px;
}
.menu {
    display: flex;
}
.menu ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 5px;
	font-size: 20px;
}
.menu ul li {
    margin-right: 20px;
}
.menu ul li a {
    text-decoration: none;
    color: #333;
}

.mactive {
	border: 3px solid #00b7ff;
	border-radius: 50%;
}
.hamburger {
    display: none;
    font-size: 24px;
    cursor: pointer;
}
.left-column, .right-column {
    background-color: #fff;
    border-right: 1px solid #bbb;
    padding: 1px 1px 4px 1px;
    overflow-y: auto;
}
.left-column {
    width: 300px;
}
.right-column {
    width: 220px;
    border-left: 1px solid #bbb;
}
.left-column h3, .right-column h3 {
    margin-top: 0;
}
.left-column ul {
    list-style: none;
    padding: 0;
}

/* Hide background when image is loaded */
.canvas-area.image-loaded {
    background-image: none; 
}

.canvas-area {
	flex: 1;
	display: flex;
	background-image: url("./images/Drag-Drop.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 300px;
	max-height: 100%;
	position: relative;
    overflow: hidden; /* Important for containing the zoomed image */
}
#output {
	cursor: pointer;
}

.warning {
	color: #d32f2f;
	font-size: 0.9em;
	margin-top: 0.5em;
}
#processing-overlay {
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(0,0,0,0.7);
	color: white;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 0.9em;
	display: none;
	z-index: 10;
}

#saveBtn {
	padding: 5px;
	font-size: 14px;
	color: #000;
	border: 1px solid black;
    border-radius: 5px;
}
		
.main-content {
    display: flex;
    flex: 1;
    overflow: auto;
}
#menu-toggle {
    display: none;
}
.convert, .convertas {
	display: inline-block;
}

#loading{
	position:absolute;
	top:0;
	left:0;
	width:100%;
	height:100%;
	display:none;
	align-items: center;
	justify-content:center;
	color:white;
	background:rgba(0,0,0,0.5);
	font-size:1.5em;
	z-index:5;
}
.logo img {
	border: 0px;
	width: 150px;
	height: 34px;
}

.title {
	align-items: flex-end;
	justify-content: flex-end;
	display: flex;
	align-self: end;
	margin-left: auto;
}
.title h1 {
	margin: 0;
	font-family: 'Aladin', Open Sans, sans-serif;
	font-size: 30px;
}

/* Container to position input and exclamation */
.input-container {
  position: relative;
 /*  display: inline-block; */
}


/* Style the exclamation mark as a round button */
.exclamation {
	transform: translateY(-50%);
	width: 15px;
	height: 15px;
	background-color: #ececec;
	color: #1602ff;
	border-radius: 50%;
	display: inline-block;
	cursor: pointer;
	font-size: 12px;
	line-height: 13px;
	text-align: center;
	font-weight: bold;
	border: 1px solid #00abff;
}

/* Style the tooltip */
.tooltip {
  display: none;
  position: fixed; /* Use fixed to position relative to viewport */
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 1000;
  max-width: 200px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  width: 150px;
}

/* Show tooltip when active */
.tooltip.active {
  display: block;
}

/* New footer styles */
.footer-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 2px ridge #eee; /* Match top-bar border style */
    background-color: #fff; /* Match column background */
    width: 100%;
	min-height:95px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    /* max-width: 1200px; */ /* Optional: limit content width */
    /* padding: 0 20px; */
}

.footer-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.footer-nav ul li {
    margin-left: 20px;
}

.footer-nav ul li a {
    text-decoration: none;
    color: #333;
}

.footer-nav ul li a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
	
	.title{
		align-self: center;
	}
	
	.title h1 {
		margin: 0;
		font-size: 26px;
	}
	
	.canvas-area{
		background-size: 200px;
	}
	
}

@media (max-width: 400px) {
	.title h1 {
		margin: 0;
		font-size: 22px;
	}
}

@media (max-width: 1024px) {
    .top-bar {
        justify-content: space-between;
    }
	
	.container {
        height: auto; /* Remove fixed height */
        min-height: 100vh; /* Allow container to grow with content */
    }
	
	.main-content {
        flex-direction: column;
        overflow-y: auto;
    }
	
    .menu {
        display: none;
        position: fixed;
        top: 54px;
        right: 0;
        width: 200px;
        background-color: #fff;
        border-left: 1px solid #ddd;
        height: calc(100vh - 60px);
		z-index: 999;
    }
    .menu ul {
        flex-direction: column;
        padding-left: 15px;
    }
    .menu ul li {
        margin: 10px 0;
    }
    .hamburger {
        display: block;
    }
    #menu-toggle:checked ~ .menu {
        display: block;
    }
	
/*     .left-column, .right-column {
        width: 100%;
        height: auto;
        overflow-y: visible;
    } */
	
	.left-column, 
    .right-column {
        flex-basis: auto;
        flex-grow: 0;
        flex-shrink: 0;
        width: 99%;
    }
		
    .left-column {
        border-bottom: 1px solid #aaa;
    }
    .right-column {
        border-top: 1px solid #aaa;
    }
    .main-content {
        flex-direction: column;
    }
	.controls {
		display: block;
	}

	.input-container {
		/* display: flex; */
		float: left;
		margin-right: 15px;
	}
	
	.canvas-area {
        width: 100%;
        /* Prevent it from collapsing vertically */
        min-height: 50vh; /* FIX: Give it a minimum height (e.g., 50% of viewport height) */
        height: auto;     /* Allow height to adjust if needed */
        flex-basis: auto; /* Important: Prevents it from consuming all vertical space */
        flex-grow: 0;
        flex-shrink: 0;
    }
	
	 .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .footer-nav ul {
       /*  flex-direction: column; */
		gap: 20px;
    }

    .footer-nav ul li {
        margin: 5px 0;
    }
}

.input-container, .SVGpanel .input-container {
    padding-top: 5px;
    padding-bottom: 5px;
}
label {
    display: block;
}
.float-container label {
	display: inline-block;
}
.input-container select {
    /* width: 50%; */
    height: 29px;
    border: 1px solid black;
    border-radius: 5px;
    outline: none;
    margin-left: 10px;
}
.spectrum.with-add-on {
    width: 40px;
}
.custom-number-input {
    background: #ebebeb;
    display: flex;
    align-items: center;
    padding: 1px;
    height: 30px;
    background-color: #e4e4e4;
    border-radius: 6px;
    text-align: center;
}
.custom-number-input button {
    width: 36px !important;
    height: 30px !important;
    background-color: #fff;
    background-clip: padding-box;
    border-radius: 6px;
    color: #333;
    border: 1px solid transparent;
    font-size: 16px;
    cursor: pointer;
    outline: none;
}
.custom-number-input input {
    height: 30px !important;
    width: 60px !important;
    background: transparent !important;
    border: none;
    outline: none;
    text-align: center;
}
.custom-number-input input::-webkit-outer-spin-button,
.custom-number-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.custom-number-input input[type=number] {
    -moz-appearance: textfield;
}
.custom-container label {
    width: 27%;
}
.custom-container {
    display: flex;
    align-items: center;
    padding-top: 5px;
    padding-bottom: 5px;
}
.float-container {
    display: inline-block;
    padding-top: 5px;
    padding-bottom: 5px;
}
#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: inherit;
}
#theme-toggle .theme-icon {
    display: inline-block;
}
#theme-toggle .light-icon {
    display: inline;
}
#theme-toggle .dark-icon {
    display: none;
}
body.dark-theme {
    background-color: #1a1a1a;
    color: #e0e0e0;
}
body.dark-theme .top-bar {
    background-color: #2c2c2c;
    border-bottom: 1px solid #444;
}
body.dark-theme .menu ul li a {
    color: #ccc;
}
body.dark-theme .menu {
    background-color: #2c2c2c;
    border-left: 1px solid #444;
}
body.dark-theme .left-column, body.dark-theme .right-column {
    background-color: #2c2c2c;
    border-right: 1px solid #444;
    border-left: 1px solid #444;
}
body.dark-theme .canvas-area {
    background-color: #222;
   /*  background-image: url("./images/Drag-Drop-dark.svg"); */
}
body.dark-theme .canvas-area.image-loaded {
    background-image: none; /* Hide dark background when image is loaded */
}
body.dark-theme #output {
    /* background: #2c2c2c; */ /* Solid background for dark theme */
}
body.dark-theme .input-container select {
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #555;
}
body.dark-theme .input-container .custom-number-input {
    background-color: #333;
    border: 1px solid #555;
}
body.dark-theme .input-container .custom-number-input button {
    background-color: #444;
    color: #e0e0e0;
    border: 1px solid #555;
}
body.dark-theme .input-container .custom-number-input input {
    background: transparent !important;
    color: #e0e0e0;
}
body.dark-theme label {
    color: #e0e0e0;
}
body.dark-theme button.decrease, body.dark-theme button.increase {
    background-color: dimgrey;
    color: white;
}
body.dark-theme #theme-toggle .light-icon {
    display: none;
}
body.dark-theme #theme-toggle .dark-icon {
    display: inline;
}
body.dark-theme #theme-toggle {
    color: #ccc;
}

body.dark-theme .footer-bar {
    background-color: #2c2c2c;
    border-top: 1px solid #444; /* Match top-bar dark theme */
}

body.dark-theme .footer-nav ul li a {
    color: #ccc;
}

body.dark-theme .footer-content p {
    color: #e0e0e0;
}

body.dark-theme .tooltip{
	background-color: #000;
	border: 1px solid #444
}

body.dark-theme .exclamation {
	background-color: #444;
	color: #fff;
	border-radius: 50%;
}

/* Collapsible Sections */
.collapsible-section {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f5f5f5;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #ddd;
}

.collapsible-header h3,
.collapsible-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
}

.collapse-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: white;
}

.collapsible-content.active {
    max-height: 1000px; /* Adjust based on content */
}

.collapsible-content .controls,
.collapsible-content .settings {
    padding: 10px;
}

/* Convert Section (Always Visible) */
.convert-section {
    margin-top: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
	display: flex;
}

/* Dark Theme Support */
body.dark-theme .collapsible-header {
    background-color: #2c2c2c;
    border-bottom-color: #444;
    color: #e0e0e0;
}

body.dark-theme .collapsible-content {
    background-color: #2c2c2c;
}

body.dark-theme .convert-section {
    background-color: #2c2c2c;
    border-color: #444;
    color: #e0e0e0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .collapsible-section {
        margin-bottom: 5px;
    }
    
    .collapsible-header {
        padding: 6px 10px;
    }
    
    .collapsible-content .controls,
    .collapsible-content .settings {
        padding: 8px;
    }
    
    .convert-section {
        margin-top: 10px;
        padding: 8px;
    }
	
}

#canvas-wrapper {
    position: absolute; /* Allows for transform-based pan/zoom */
    transform-origin: 0 0; 
	/*
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);*/
}

.initsz {
    /*border: 2px dashed #aaa;*/
    width: 99%;
    height: 99%;
    position: relative;
    cursor: pointer;
}

#imageCanvas, #drawingCanvas {
    position: absolute;
    top: 0;
    left: 0;
}

/* Make drawing canvas interactive */
#drawingCanvas {
    z-index: 10;
}

#welcome-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 1.5em;
    pointer-events: none;
    z-index: 5;
}

.image-loaded #welcome-message {
    display: none;
}

/* Styles for the new tool buttons */
.tools-grid {
/*     display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 5px; */
}
.tools-grid button {
    padding: 5px;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
	width: 32px;
	height: 32px;
	margin-bottom: 5px;
}
.tools-grid button.active {
    background: #9ecdff;
    color: white;
    border-color: #007bff;
}
body.dark-theme .tools-grid button {
    background: #444;
    border-color: #666;
}
body.dark-theme .tools-grid button.active {
    background: #007bff;
    border-color: #007bff;
}



.preview-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.apply-btn {
    background: #4CAF50;
    color: white;
}

.cancel-btn {
    background: #f44336;
    color: white;
}

.preview-mode .collapsible-header {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

#crop-mobile-controls { text-align: center; }
.small-btn { font-size: 14px; padding: 6px 12px; margin: 0 4px; }

#crop-overlay {
	position: absolute;
	border: 3px dashed #ff0000;
	pointer-events: none;
	box-sizing: border-box;
	display: none;
	z-index: 10;
}
.crop-handle {
	position: absolute;
	width: 25px;
	height: 25px;
	background: #ff0000;
	border: 4px solid red;
	border-radius: 50%;
	pointer-events: all;
	transform: translate(-50%, -50%);
	cursor: pointer;
}
.crop-handle::after {
    content: '';
    position: absolute;
    top: -25px;    /* Extend the touch area upwards by 20px */
    left: -25px;   /* Extend leftwards */
    right: -25px;  /* Extend rightwards */
    bottom: -25px; /* Extend downwards */
    /* This creates a large, invisible square (approx 50x50px) around the small dot */
    pointer-events: all; /* Make sure this pseudo-element captures touch events */
}
.crop-handle.tl { cursor: nwse-resize; top: 0; left: 0; }
.crop-handle.tm { cursor: ns-resize; top: 0; left: 50%; }
.crop-handle.tr { cursor: nesw-resize; top: 0; right: 0; }
.crop-handle.ml { cursor: ew-resize; top: 50%; left: 0; }
.crop-handle.mr { cursor: ew-resize; top: 50%; right: 0; }
.crop-handle.bl { cursor: nesw-resize; bottom: 0; left: 0; }
.crop-handle.bm { cursor: ns-resize; bottom: 0; left: 50%; }
.crop-handle.br { cursor: nwse-resize; bottom: 0; right: 0; }


/* .canvas-area{
    cursor: none;
} */
.custom-cursor {
    position: fixed;
    pointer-events: none;
    width: 100px;
    height: 100px;
    background: center/contain no-repeat;
    z-index: 9999;
    left: 0;
    top: 0;
    /* Center of 100x100 element */
    /* Start hidden */
    opacity: 0;
    /* GPU layer */
    will-change: transform;
    transform: translate3d(-50px, -50px, 0);
}

/* Only show when .active */
/* .custom-cursor.active {
    opacity: 1;
} */

/* body.dynamic-cursor .custom-cursor {
    opacity: 1;
} */

/* body.dynamic-cursor {
    cursor: none;
} */

.custom-cursor.draw{ background-image: url('./images/cursors/brush.png'); }
.custom-cursor.erase{ background-image: url('./images/cursors/erase.png'); }
.custom-cursor.pan{ background-image: url('./images/cursors/pan.png'); }
