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: 350px;
}
.right-column {
    width: 200px;
    border-left: 1px solid #bbb;
}
.left-column h3, .right-column h3 {
    margin-top: 0;
}
.left-column ul {
    list-style: none;
    padding: 0;
}


.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: auto;
}
		
.main-content {
    display: flex;
    flex: 1;
    overflow: auto;
}
#menu-toggle {
    display: none;
}
.convert, .convertas {
	display: inline-block;
}

.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;
}

/* 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;
    }
}

label {
    display: block;
}

#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: 0px 10px 0 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;
}



.sp-replacer{
	border: 1px solid #040404 !important;
}

/* The main masonry grid wrapper */
.gallery-container {
	column-width: 250px;
	column-gap: 20px;
	width: 95%;
	margin: 10px auto;
}

/* Individual pin styling */
.pin-card {
	break-inside: avoid;
	background-color: #ffffff;
	border-radius: 16px;
	padding: 6px;
	margin-bottom: 15px;
	box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
	display: inline-block;
	width: 100%;
	border: 1px solid #cbcccd;
}

/* Ensure images scale flawlessly without distorting */
.pin-card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

/* Style formatting for descriptions */
.pin-card p {
  font-family: sans-serif;
  font-size: 14px;
  color: #333;
  margin: 8px 4px 0 4px;
}

.pagination {
	text-align: center;
	margin: 20px 0;
}
.pagination a, .pagination span {
	display: inline-block;
	padding: 8px 16px;
	margin: 0 4px;
	border: 1px solid #ddd;
	text-decoration: none;
	color: #333;
	border-radius: 4px;
}
.pagination span.current {
	background-color: #007BFF;
	color: white;
	border-color: #007BFF;
}
.pagination a:hover {
	background-color: #f5f5f5;
}