/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header Styles */
header {
  background: linear-gradient(to right, #1a3a8f, #2c5aa0);
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  max-height: 50px;
  border-radius: 5px;
}

.logo-text {
  margin-left: 10px;
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-menu {
  display: flex;
  list-style: none;
}

.nav-menu li {
  margin-left: 20px;
}

.nav-menu a {
  text-decoration: none;
  color: white;
  font-weight: 500;
  transition: color 0.3s;
  padding: 5px 10px;
  border-radius: 4px;
}

.nav-menu a:hover {
  background-color: rgba(255,255,255,0.1);
}

/* Main Content Styles */
.main-content {
  padding: 30px 0;
}

.page-header {
  text-align: center;
  margin-bottom: 30px;
}

.page-header h1 {
  font-size: 2.2rem;
  color: #1a3a8f;
  margin-bottom: 10px;
}

.page-header p {
  font-size: 1.1rem;
  color: #555;
  max-width: 800px;
  margin: 0 auto;
}

/* Content Wrapper */
.content-wrapper {
  display: flex;
  gap: 30px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

/* Tool Container */
.tool-container {
  flex: 1;
  min-width: 300px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  padding: 30px;
  border: 1px solid #e1e8ed;
}

/* Sample Image Container */
.sample-container {
  flex: 0 0 300px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  padding: 25px;
  border: 1px solid #e1e8ed;
  position: sticky;
  top: 20px;
  height: fit-content;
}

.sample-title {
  text-align: center;
  color: #1a3a8f;
  margin-bottom: 20px;
  font-size: 1.3rem;
  border-bottom: 2px solid #1a3a8f;
  padding-bottom: 10px;
}

.sample-image {
  width: 100%;
  border: 2px solid #1a3a8f;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.sample-description {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #1a3a8f;
}

.sample-description h3 {
  color: #1a3a8f;
  margin-bottom: 10px;
}

.sample-description ul {
  margin-left: 20px;
  color: #555;
}

.sample-description li {
  margin-bottom: 8px;
}

/* Tool Elements */
.canvas-wrapper {
  width: 320px;
  height: 420px;
  margin: 20px auto;
  border: 2px solid #1a3a8f;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

canvas {
  width: 100%;
  height: 100%;
  background: white;
}

.button {
  padding: 12px 20px;
  background: #1a3a8f;
  color: #fff;
  cursor: pointer;
  border-radius: 5px;
  margin: 5px;
  border: none;
  font-weight: 600;
  transition: background-color 0.3s;
}

.button:hover {
  background: #152b6e;
}

.button-success {
  background: #28a745;
}

.button-success:hover {
  background: #218838;
}

.button-info {
  background: #17a2b8;
}

.button-info:hover {
  background: #138496;
}

.button-warning {
  background: #ffc107;
  color: #212529;
}

.button-warning:hover {
  background: #e0a800;
}

.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border: 1px solid #ccc;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  border-radius: 8px;
  z-index: 1000;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
}

.modal-content {
  max-width: 350px;
  max-height: 450px;
  overflow: hidden;
  margin: auto;
}

.modal img {
  width: 100%;
  height: auto;
  display: block;
}

.controls {
  margin: 15px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

input[type=range] {
  width: 120px;
}

.control-group {
  margin: 10px;
  text-align: center;
}

.control-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #2c3e50;
}

/* Layout Controls */
.layout-controls {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  border: 1px solid #e1e8ed;
}

.layout-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  margin-bottom: 10px;
}

.layout-control {
  display: flex;
  flex-direction: column;
  min-width: 150px;
  flex: 1;
}

.layout-control label {
  margin-bottom: 5px;
  font-weight: 600;
  color: #1a3a8f;
}

.layout-control input[type="number"] {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.layout-control select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.preview-info {
  background: #e9f7fe;
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
  font-size: 0.9rem;
  color: #0c5460;
}

/* Upload Button */
.image-upload {
  display: none;
}

.custom-file-upload {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to right, #1a3a8f, #2c5aa0);
  color: white;
  padding: 12px 24px;
  font-size: 1.1rem;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(26, 58, 143, 0.3);
  transition: all 0.3s ease;
  font-weight: 600;
  border: none;
  margin: 10px 0;
}

.custom-file-upload:hover {
  background: linear-gradient(to right, #152b6e, #1a3a8f);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 58, 143, 0.4);
}

.upload-icon {
  width: 24px;
  height: 24px;
  stroke: white;
}

/* Marquee */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  background: linear-gradient(to right, #1a3a8f, #2c5aa0);
  padding: 10px 0;
  position: relative;
  border-radius: 5px;
  margin: 15px 0;
}

.marquee-text {
  display: inline-block;
  padding-left: 100%;
  animation: scroll-left 20s linear infinite;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1rem;
  color: white;
  font-weight: 500;
}

@keyframes scroll-left {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-100%); }
}

/* Features Section */
.features-section {
  margin-top: 40px;
}

.section-title {
  font-size: 1.8rem;
  color: #1a3a8f;
  margin-bottom: 20px;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.feature-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  text-align: center;
  border-top: 4px solid #1a3a8f;
}

.feature-icon {
  font-size: 2.5rem;
  color: #1a3a8f;
  margin-bottom: 15px;
}

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: #2c3e50;
}

/* Print Preview Modal */
.print-preview-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  overflow: auto;
}

.print-preview-content {
  background: white;
  margin: 20px auto;
  padding: 20px;
  border-radius: 10px;
  max-width: 90%;
  position: relative;
}

.print-preview-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border: 1px solid #ddd;
}

.close-preview {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #333;
  background: white;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  text-align: center;
  line-height: 30px;
}

/* Print Only Styles - Hidden from screen */
@media print {
  body * {
    visibility: hidden;
  }
  .print-only, .print-only * {
    visibility: visible;
  }
  .print-only {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .logo {
    margin-bottom: 10px;
  }
  
  .nav-menu {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .nav-menu li {
    margin: 5px 10px;
  }
  
  .controls {
    flex-direction: column;
    align-items: center;
  }
  
  .button {
    width: 100%;
    max-width: 300px;
    margin: 5px 0;
  }
  
  .content-wrapper {
    flex-direction: column;
  }
  
  .sample-container {
    position: static;
    order: -1;
  }
  
  .canvas-wrapper {
    width: 280px;
    height: 370px;
  }
  
  .layout-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .layout-control {
    width: 100%;
  }
  
  .modal {
    width: 95%;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 1.8rem;
  }
  
  .canvas-wrapper {
    width: 240px;
    height: 320px;
  }
  
  .button {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
}

/* Instructions */
.instructions {
  background: #f8f9fa;
  border-left: 4px solid #1a3a8f;
  padding: 15px;
  margin: 20px 0;
  border-radius: 0 5px 5px 0;
}

.instructions h3 {
  color: #1a3a8f;
  margin-bottom: 10px;
}

/* Reviews Section */
.reviews-section {
  margin-top: 40px;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.review-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 3px 15px rgba(0,0,0,0.1);
  border-left: 4px solid #1a3a8f;
}

.review-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.reviewer-avatar {
  width: 50px;
  height: 50px;
  background: #1a3a8f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  margin-right: 15px;
}

.reviewer-info h4 {
  margin: 0;
  color: #2c3e50;
}

.rating {
  color: #ffc107;
  margin-top: 5px;
}

.review-date {
  color: #888;
  font-size: 0.9rem;
  margin-top: 10px;
}

/* Footer Styles */
footer {
  background: linear-gradient(to right, #1a3a8f, #2c5aa0);
  color: #ecf0f1;
  padding: 40px 0 20px;
  margin-top: 40px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-column h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: #fff;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #fff;
}

.contact-info {
  color: #bdc3c7;
}

.contact-info p {
  margin-bottom: 8px;
}

.copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #bdc3c7;
  font-size: 0.9rem;
}

.bgremove-btn{
  padding:10px 15px;
  background:#0b5ed7;
  color:#fff;
  border:none;
  border-radius:6px;
  cursor:pointer;
  font-size:14px;
}

.popup-overlay{
  display:none;
  position:fixed;
  top:0;left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.7);
  z-index:9999;
}

.popup-box{
  position:relative;
  width:95%;
  height:95%;
  margin:2%;
  background:#fff;
  border-radius:10px;
  overflow:hidden;
}

.popup-box iframe{
  width:100%;
  height:100%;
}

.close-btn{
  position:absolute;
  top:10px;
  right:15px;
  font-size:26px;
  cursor:pointer;
  background:#fff;
  padding:2px 10px;
  border-radius:50%;
  z-index:10000;
}

/* Layout Controls Styles */
.layout-controls {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border: 2px dashed #1a3a8f;
}

.layout-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
  justify-content: center;
}

.layout-control {
  flex: 1;
  min-width: 150px;
}

.layout-control label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.9rem;
}

.layout-control select,
.layout-control input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.preview-info {
  text-align: center;
  padding: 10px;
  background: #e9f7fe;
  border-radius: 4px;
  margin: 10px 0;
  font-weight: 600;
  color: #1a3a8f;
}

.button-warning {
  background: #ffc107;
  color: #212529;
}

.button-warning:hover {
  background: #e0a800;
}

/* Print Preview Modal */
.print-preview-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  overflow: auto;
}

.print-preview-content {
  background: white;
  margin: 50px auto;
  padding: 20px;
  border-radius: 10px;
  max-width: 90%;
  position: relative;
}

.print-preview-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border: 1px solid #ddd;
}

.close-preview {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  cursor: pointer;
  color: #666;
}

.close-preview:hover {
  color: #000;
}
/* Ensure white background for preview canvas */
.canvas-wrapper {
  background: white !important;
}

.generated-image {
  background: white !important;
}

/* Ensure crop modal has white background */
#crop-image {
  background: white !important;
  max-width: 100%;
  max-height: 400px;
}

/* Cropper customization */
.cropper-view-box,
.cropper-face {
  background-color: white !important;
}

/* Print preview styles */
.print-preview-modal {
  background: rgba(0, 0, 0, 0.9) !important;
}

.print-preview-content {
  background: white !important;
}

.print-preview-image {
  background: white !important;
  max-width: 100%;
}



/* Photo Background Controls */
.photo-bg-controls {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  border: 2px solid #dee2e6;
}

.photo-bg-preset {
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.photo-bg-preset:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

/* Ensure container remains white */
.canvas-wrapper {
  background: white !important;
  border: 2px solid #1a3a8f;
}

.generated-image {
  background: white !important;
}

/* Print preview background */
.print-preview-content {
  background: white !important;
}

.print-preview-image {
  background: white !important;
}


/* Size Selection Styles */
.size-selection-container {
  background: #fff;
  border: 2px solid #1a3a8f;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.size-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.size-preset-btn {
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 12px 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.size-preset-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.size-preset-btn.active {
  background: #1a3a8f;
  border-color: #1a3a8f;
  color: white;
}

.size-preset-btn.active .size-label,
.size-preset-btn.active .size-dimensions,
.size-preset-btn.active .size-desc {
  color: white;
}

.size-label {
  font-weight: bold;
  font-size: 0.95rem;
  color: #1a3a8f;
  margin-bottom: 5px;
}

.size-dimensions {
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 3px;
}

.size-desc {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
}

.custom-size-input {
  border-top: 1px solid #dee2e6;
}

.custom-size-field {
  display: inline-block;
}