/* Base styles and resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: #333;
  background-color: #f5f7fa;
  line-height: 1.6;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.2;
}

ul {
  list-style: none;
}

a {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #2563eb;
}

input, select, button {
  font-family: inherit;
  font-size: inherit;
}

/* Layout */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  flex: 1;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  position: relative;
}

@media (min-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
}

/* Header styling */
.site-header {
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: all 0.3s ease;
  height: 90px;
  padding: 0;
  display: flex;
  align-items: center;
}

.site-header.collapsed {
  height: 45px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  position: relative;
}

.logo {
  position: relative;
  display: flex;
  align-items: center;
  height: auto;
  padding-left: 20px;
  transition: all 0.3s ease;
}

.logo img {
  height: 60px;
  transition: height 0.3s ease;
  display: block;
}

.site-header.collapsed .logo img {
  height: 30px;
}

/* Banner and content spacing */
.ad-container.ad-banner:first-of-type {
  margin-top: 90px;
  margin-bottom: 0;
}

.main-content {
  margin-top: 0;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 1rem;
  flex: 1;
}

@media (min-width: 768px) {
  .main-content {
    flex-direction: row;
    gap: 1.5rem;
  }
}

/* Panel Styles */
.panel {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  margin-bottom: 0.5rem;
}

.left-panel {
  width: 100%;
  transition: transform 0.3s ease-in-out;
}

.right-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .left-panel {
    width: 35%;
    max-width: 350px;
    position: sticky;
    top: 5rem;
    height: calc(100vh - 10rem);
    overflow-y: auto;
  }
  
  .right-panel {
    width: 65%;
    flex: 1;
  }
}

/* Mobile Panel Toggle */
.mobile-menu-toggle {
  display: flex;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #64748b;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
}

/* On Mobile, hide left panel by default */
@media (max-width: 767px) {
  .left-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    height: 100vh;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  }
  
  .left-panel.active {
    transform: translateX(0);
  }
}

/* Canvas Section */
.text-input-section {
  margin-bottom: 1rem;
}

.card {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  margin-bottom: 1rem;
  margin-bottom: 8px !important;
  padding-bottom: 8px !important;
}

.input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.control-section {
  margin-bottom: 1.25rem;
}

.style-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.style-toggles-horizontal {
  display: flex;
  gap: 1.5rem;
  margin: 1rem 0;
}

.style-toggles-horizontal label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
}

.drag-active {
  opacity: 0.7;
  background-color: #e2e8f0;
}

.preset-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

/* Table styles */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

td {
  text-align: center;
  padding: 0.6rem;
  width: 20%;
  height: 50px;
  vertical-align: middle;
  position: relative;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  gap: 0.5rem;
}

.button.primary {
  background-color: #3b82f6;
  color: white;
}

.button.primary:hover {
  background-color: #2563eb;
}

.button.outline {
  background-color: transparent;
  border: 1px solid #cbd5e1;
  color: #64748b;
}

.button.outline:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

.button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button.active {
  background-color: #2563eb;
  color: white;
  border-color: #2563eb;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Form inputs */
input[type="text"], select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
  transition: border-color 0.2s;
}

input[type="text"]:focus, select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Range inputs */
input[type="range"] {
  /*width: 100%;*/
  height: 0.5rem;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 0.25rem;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: none;
}

/* File inputs */
 .custom-file-input::-webkit-file-upload-button {
  visibility: hidden;
}

.custom-file-input {
  max-width: 100%;
  content: 'Select some files';
  display: inline-block;
  background: -webkit-linear-gradient(top, #f9f9f9, #e3e3e3);
  border: 1px solid #999;
  border-radius: 3px;
  padding: 5px 8px;
  outline: none;
  white-space: nowrap;
  -webkit-user-select: none;
  cursor: pointer;
  text-shadow: 1px 1px #fff;
  font-weight: 700;
  font-size: 10pt;
}
.custom-file-input:hover::before {
  border-color: black;
}
.custom-file-input:active::before {
  background: -webkit-linear-gradient(top, #e3e3e3, #f9f9f9);
}
/* Ad containers */
.ad-container {
  width: 100%;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  padding: 1rem;
  font-size: 0.875rem;
}

.ad-banner {
  height: 90px;
}

.ad-sidebar {
  height: 250px;
  display: none;
  margin-top: 1rem;
}

@media (min-width: 1024px) {
  .ad-sidebar {
    display: block;
    height: 600px;
  }
}

/* Pagination */
#pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 1rem;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.25rem;
  background-color: #f1f5f9;
  color: #64748b;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.page-link:hover {
  background-color: #e2e8f0;
}

.page-link.active {
  background-color: #3b82f6;
  color: white;
}

/* Layer controls */
.layer-controls {
   margin-top: 8px !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Object Z-order title can have less space */
.layer-controls h3 {
  margin-bottom: 8px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Footer */
.site-footer {
  background-color: #1e293b;
  color: #f8fafc;
  padding: 3rem 0 1rem;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-column h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  color: white;
}

.footer-column p {
  color: #cbd5e1;
  font-size: 0.875rem;
}

.footer-column ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-column ul a {
  color: #cbd5e1;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-column ul a:hover {
  color: white;
}

.social-icons {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.25rem;
  transition: all 0.2s;
}

.social-icons a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.copyright {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Fixed Panel Heights for responsive layout */
@media (min-width: 768px) {
  .left-panel,
  .right-panel {
    height: auto !important;
    /*overflow: auto !important;*/
  }

  .left-panel {
    display: flex;
    flex-direction: column;
    position: relative;
    top: 0;
  }



  .right-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .left-panel .panel-header {
    margin-bottom: 1.5rem;
  }

  .panel-header h2 {
    margin-bottom: 0.5rem;
  }
}

/* Enhanced Font Selection Styling */
#fontFamily {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
  background-color: #fff;
  font-size: 0.875rem;
  cursor: pointer;
}

/* Add a visual preview in the dropdown (works in most modern browsers) */
#fontFamily option {
  padding: 8px;
}

#fontFamily optgroup {
  font-weight: bold;
  color: #64748b;
}

/* Add a font preview section below the dropdown (optional) */
.font-preview-section {
  margin-top: 0.75rem;
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
  background-color: #f8fafc;
  font-size: 0.875rem;
}

.font-preview-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.font-preview-item {
  text-align: center;
  padding: 0.5rem;
  border-radius: 0.25rem;
  background-color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  width: 48%;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.font-preview-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .font-preview-section {
    display: none; /* Hide preview on mobile to save space */
  }
}

.editor-header {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.editor-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
}

.toolbar-btn {
  background: none;
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  /*color: #64748b; */
  cursor: pointer;
  transition: all 0.2s;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.panel-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.close-btn:hover {
  background-color: #f1f5f9;
  color: #334155;
}

.panel-content {
  padding: 1rem;
}


.editor-header {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.editor-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
}

/* Add this to your styles.css file */
#shapeOpacity {
  width: 200px;
  margin: 0 auto;
  display: block;
  padding:none !important;
}

/* Container for the opacity slider */
.mb-2 {
  max-width: 200px;
  margin: 10px auto;
}

/* Custom styling for range inputs */
input[type="range"] {
  width: 100%;
  height: 0.5rem;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 0.25rem;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: none;
}

/* Custom styling for color inputs */
input[type="color"] {
  /*width: 100%;*/
  height: 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
  cursor: pointer;
  background: white;
  padding: 2px;
}

/* Make the color input look nicer */
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
}

/* Improve range input appearance */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 0.25rem;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: none;
}

.font-family{
 width:120px !important;   
}

#button:hover {
    background-color: blue;
}

        .customform-control{
            display: block;
            width:395px;
            padding-top:2px;
            padding-left:2px;
            height:22px;
            font-size: 14px;
            line-height: 1.42857143;
            color: #71706f;
            background-color: #fff;
            background-image: none;
            border: 1px solid #ccc;
            border-radius: 4px;
            -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
            box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
            -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
            -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
            transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
            border-radius: 0px !important;
        }

/* Ensure context menu appears above everything */
.object-context-menu {
  z-index: 9999 !important;
}

/* Text editing in context menu */
#contextTextContent {
  width: 100%;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  max-height: 150px;
}

#contextTextContent:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}


.flip-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.flip-btn {
  flex: 1;
  padding: 6px 10px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s;
}

.flip-btn:hover {
  background: #e0e0e0;
}

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