/* Container & Text Styles */
.ai-image-generator-container {
    /* margin: 20px auto; */
    /* padding: 20px; */
    background: transparent;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}

.ai-image-generator-container h2,
.ai-image-generator-container h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #fff;
    font-size: 22px;
}

/* Form Styles */
#ai-image-generator-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 30px;
    flex-direction:column;
}

#ai-image-generator-form label {
    flex-basis: 100%;
    color: #fff;
}

#ai-image-generator-form input,
#ai-image-generator-form select,
#ai-image-generator-form textarea {
    flex: 1;
    padding: 8px;
    border: 3px solid #584d5f;
    border-radius: 5px;
    background: #2d2631;
    color: #fff;
    font-size:18px;
}

/* Button Styling */
#ai-image-generator-form button,
.ai-image-actions button,
.ai-image-actions a {
  padding: 14px 24px;
  background: #ff556c;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
}

#ai-image-generator-form button:hover {
  background: #149799;
}

#ai-generate-btn {
  background: #ff556c!important;
}
#ai-generate-btn:hover {
  background:#ff6e82!important;
}

/* Generated Image Result */
#ai-image-result img {
    max-width: 100%;
    display: block;
    margin: 20px auto;
}

/* result grid container */
.ai-image-result-grid {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

/* 1) Make every .ai-image-item a positioning context */
.ai-image-library-grid .ai-image-item,
.ai-image-result-grid .ai-image-item {
  position: relative;
}

/* 2) Icon base styles (download / delete / post) */
.ai-image-library-grid .ai-image-item .icon-upscale,
.ai-image-library-grid .ai-image-item .icon-download,
.ai-image-library-grid .ai-image-item .icon-delete,
.ai-image-library-grid .ai-image-item .icon-upscale,
.ai-image-result-grid .ai-image-item .icon-download,
.ai-image-result-grid .ai-image-item .icon-delete,
.ai-image-result-grid .ai-image-item .icon-post {
  position: absolute;
  bottom: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
  color: #fff;
  z-index: 10;
  cursor: pointer;
}


.modal-actions .icon-upscale,
.modal-actions .icon-download,
.modal-actions .icon-delete,
.modal-actions .icon-post {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
  color: #fff;
  z-index: 10;
  cursor: pointer;
}




/* 1‑column: each item takes full width */
.ai-image-result-grid.columns-1 .ai-image-item {
  flex: 1 1 100%;
}

/* 2‑column: each item half width */
.ai-image-result-grid.columns-2 .ai-image-item {
  flex: 1 1 49%;
}

/* 4‑column: each item quarter width */
.ai-image-result-grid.columns-4 .ai-image-item {
  flex: 1 1 24%;
}




/* Image Library Styles */
.ai-image-library-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
    justify-content: center;
}

.ai-image-item {
    position: relative;
    width: 145px; /* Adjust size as needed */
    overflow: hidden;
    border-radius: 8px;
}

.ai-image-item img {
    width: 100%;
    height: auto;
    display: block;
}

.ai-image-item .elementor-icon {
  color: #ffffff;
  font-size: 18px;
}

.ai-image-item .elementor-icon:hover {
    color: #59e9f1;
}

/* base styles for all three icons */
.ai-image-item .icon-upscale,
.ai-image-item .icon-download,
.ai-image-item .icon-delete,
.ai-image-item .icon-post {
  position: absolute;
  bottom: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  transition: opacity .3s ease, transform .3s ease;
}



/* Overlay appears on hover */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.ai-image-item:hover .overlay {
    opacity: 1;
}

/* Icon styling for download and delete */
.overlay button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.ai-image-actions {
    text-align: center;
    margin-top: 5px;
}


.icon-upscale {
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 24px;
  color: #fff;
  opacity: 0;
  
}
.ai-image-item:hover .icon-upscale {
  opacity: 1;
  transform: scale(1.1);
}

.icon-post {
  position: absolute;
  bottom: 5px;
  left: 5px;
  font-size: 24px;
  color: #fff;
  opacity: 0;
  
}

/* Icon overlays for download and delete */
.icon-download, .icon-delete {
  position: absolute;
  color: #fff;
  opacity: 0;
  /* transition: opacity 0.3s ease, transform 0.3s ease; */
  cursor: pointer;
  display: flex;
}

/* Position download icon at top right */
.icon-download {
  top: 6px;
  right: 5px;
}

/* Position delete icon at bottom right */
.icon-delete {
  bottom: 8px;
  right: 5px;
}

/* Hover effects for icons */
.ai-image-item:hover .icon-download,
.ai-image-item:hover .icon-delete {
  opacity: 1;
  transform: scale(1.1);
}

/* Ensure icons are the same size */
.icon-download-svg, .icon-delete-svg {
  font-size: 24px;
  line-height: 1;
}


.ai-image-item:hover .icon-post {
  opacity: 1;
  transform: scale(1.1);
}



.button-upscale,
.button-download,
.button-delete,
.button-post {
  font-size: 13px !important;
  color: #fff;
  position: relative;
  padding: 10px;
  border: none;
  border-radius: 5px;
  font-weight: bold;

}

/* Extra Padding between Generation Form and Library */
#ai-image-library {
    margin-top: 30px;
}

/* Loading Indicator Styling with Spinner */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    color: #fff;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 85, 108, 0.3);
    border-top-color: #FF556C;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}




/* Override lightbox animation */
.lightbox, .lightboxOverlay {
    transition: none !important;
}

/* Override the overlay background, data container, and outer container */
.lb-overlay {
    background-color: rgba(0, 0, 0, 0.9) !important;  /* Dark overlay */
}

.lb-outerContainer,
.lb-dataContainer,
.lb-data {
    background-color: #000 !important;   /* Black background for the lightbox container */
    border: none !important;
}

/* If a white border is still visible around the image, force the image container to have no border */
.lb-image {
    border: none !important;
}


#ai-image-result img{
  border-radius:10px;
}


/* New Mode Selector Tabs */
.ai-generator-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.tab-button {
    background-color: #3b2d49;
    border: none;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    padding: 20px 10px 0px 10px;
    width: 33%;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.tab-button h2 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.tab-button h3 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

.tab-button p {
    margin: 5px 0 0;
    font-size: 14px;
}

.tab-button:hover {
    background-color: #281e31;
    transform: scale(1.05);
}

.tab-button.active {
    background-color: #FF556C;
}

/* Tab Content Sections */
.tab-content {
    width:100%;
    display: none;
}

/* Standard, Upload, and Random sections should be styled as desired.
   For example: */
#section-standard,
#section-upload,
#section-random {
    /* margin-bottom: 20px; */
    display: flex;
}


/* Drag-and-Drop Upload Zone */
.drop-zone {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border: 3px dashed #468083;
    border-radius: 12px;
    text-align: center;
    color: #fff;
    background-color: #2d2631;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.drop-zone:hover {
    background-color: #413747;
}

.drop-zone.dragover {
    background-color: rgba(255, 85, 108, 0.2);
}

.drop-zone-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* Upload Preview */
#upload-preview {
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
}

#upload-preview img {
    width: 100%;
    border-radius: 10px;
    display: block;
}

#remove-upload {
    margin-top: 10px;
    padding: 5px 10px;
    background: #FF556C;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}



/* Pagination Styles */
.pagination {
    text-align: center;
    margin: 20px 0;
}

.pagination .pagination-link {
    display: inline-block;
    margin: 0 5px;
    padding: 8px 12px;
    background-color: #FF556C;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s;
}

.pagination .pagination-link:hover {
    background-color: #e04b62;
    transform: scale(1.05);
}

.pagination .pagination-link.current {
    background-color: #c43e55;
    cursor: default;
}

.pagination-info {
    font-size: 16px;
    color: #fff;
    margin-top: 10px;
}


.pagination-jump-container select.pagination-jump {
    padding: 8px 12px;
    border: 2px solid #FF556C;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.pagination-jump-container select.pagination-jump:hover {
    border-color: #e04b62;
}


/* full-screen dim backdrop */
.awg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* modal box */
.awg-modal {
  background: #1e1e1e;
  color: #eee;
  border-radius: 8px;
  max-width: 900px;
  width: 100%;
  position: relative;
  z-index: 9999;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* modal header */
.awg-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #444;
  position: relative;
}

.awg-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.awg-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* modal content */
.awg-modal-content {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  max-height: calc(90vh - 120px);
}

.awg-modal-left {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.awg-modal-right {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  min-width: 0;
}

/* headings, labels, text */
.awg-modal h2,
.awg-modal p,
.awg-modal label,
.awg-gallery-title,
.awg-final-prompt,
.awg-raw-prompt {
  color: #fff;
  margin-bottom: 0.5rem;
}

.awg-modal h2 {
  margin-top: 0;
  font-size: 1.5rem;
}

/* selects & buttons */
.awg-modal select {
  background: #2a2a2a;
  color: #eee;
  border: 1px solid #444;
  width: 100%;
  padding: 0.5rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.awg-modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 1.5rem;
}

.awg-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  flex: 1;
}

.awg-cancel {
  background: #444;
  color: #fff;
}

.awg-cancel:hover {
  background: #555;
}

.awg-publish {
  background: #7d45a0;
  color: #fff;
}

.awg-publish:hover {
  background: #7d45a0;
}

.awg-publish:disabled {
  background: #2a2a2a;
  color: #888;
  cursor: not-allowed;
}

/* image preview */
.awg-modal-image {
  max-width: 100%;
  max-height: 100%;
  border: 1px solid #444;
  border-radius: 4px;
  object-fit: contain;
}

/* spinner/loader */
.awg-spinner {
  color: #ccc;
  text-align: center;
  margin-top: 1rem;
}

/* Responsive styles */
@media (max-width: 768px) {
  .awg-modal-content {
    flex-direction: column;
    max-height: none;
  }
  
  .awg-modal-left,
  .awg-modal-right {
    flex: none;
    width: 100%;
    padding: 1rem;
  }
  
  .awg-modal-left {
    padding-bottom: 0;
  }
  
  .awg-modal-image {
    max-height: 300px;
  }
  
  .awg-modal {
    max-height: 90vh;
    overflow-y: auto;
  }
}

#awg-category-select {
  height: 220px;
  display: flex;
}

#ai-credits-tooltip {
  display:none;
  color: #FFFFFF; 
  margin: 0 auto; 
  width:100%;
  text-align:center;
  background:rgb(96 30 178); 
  border: 2px dashed rgb(186 157 255); 
  padding: 8px 14px; 
  border-radius: 8px; 
  z-index: 1001;
  font-size: 22px; 
}

#ai-credits-tooltip a {
  color: rgb(0 255 171);
  text-decoration: underline;
}

#ai-credits-tooltip a:hover {
  color: rgb(125 255 212); 
}



/* Hide the default checkbox */
input[type="checkbox"].ai-large-checkbox {
  width: 28px;
  height: 28px;
  accent-color: #14b8b6; /* Modern browsers: teal */
  cursor: pointer;
  /* fallback for browsers that don't support accent-color: */
  border: 2px solid #14b8b6;
  border-radius: 6px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  background: #fff;
  position: relative;
}

input[type="checkbox"].ai-large-checkbox:checked {
  background-color: #14b8b6;
  border-color: #14b8b6;
}

input[type="checkbox"].ai-large-checkbox:checked:after {
  content: '';
  display: block;
  position: absolute;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}


/* Make label a flex container for vertical alignment */
label[for="enhance_prompt"],
label[for="remove_watermark"] {
  display: inline-flex;
  align-items: center;
  gap: 12px; /* space between checkbox and text */
  font-size: 16px; /* optional: make text a bit larger */
}

/* Optional: Remove extra margin if present */
label[for="enhance_prompt"] input,
label[for="remove_watermark"] input {
  margin: 0;
}



/*== Tablet Portrait
 *====================================================================================================================================*/
 @media only screen and (min-width:640px) and (max-width:959px) {
  .credits-panel {
    position:relative!important;
    margin-bottom: 20px!important;
    top: 0px!important;
    right: 0px!important;
  }
}

/*== Mobile Landscape
 *====================================================================================================================================*/
@media only screen and (min-width:480px) and (max-width:639px) {
  .credits-panel {
    position:relative!important;
    margin-bottom: 20px!important;
    top: 0px!important;
    right: 0px!important;
  }
}

/*== Mobile Portrait
 *====================================================================================================================================*/
 @media only screen and (max-width:479px) {

  .credits-panel {
    position:relative!important;
    margin-bottom: 20px!important;
    top: 0px!important;
    right: 0px!important;
  }
}




.ai-modal-link {
  touch-action: manipulation;
}
