/* style.css */
/* Base Styles */
.remove-image-btn {
    position: absolute;
    right: -10px;
    top: -10px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.upload-group {
    position: relative;
    margin: 15px 0;
}

.remove-image-btn:hover {
    background: #cc0000;
}

.upload-group input[type="file"] {
    display: block;
    width: 100%;
    padding: 12px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f8f8f8;
    cursor: pointer;
}

.upload-group input[type="file"]:hover {
    border-color: #4CAF50;
}

.ai-pet-cartoon-container {
    text-align: center;
    max-width: 1200px;
}

h2 {
    font-family: 'Chonky';
    color: #f87736;
}

/* Form Elements */
#ai-pet-cartoon-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Image upload section */
#image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0 auto;
    max-width: 500px;
}

.upload-group input[type="file"] {
    padding: 15px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    width: 100%;
    margin: 0 auto;
}

.add-image-btn {
    background: #f87736;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    margin: 15px auto;
    display: block;
    transition: background 0.3s ease;
    font-size: 16px;
}

.add-image-btn:hover {
    background: #57948C;
    color: white;
}

/* Carousel */
.style-carousel {
    margin: 25px 0;
}

.splide__slide {
    transition: all 0.3s ease;
    opacity: 0.6;
    transform: scale(0.9);
}

.splide__slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.splide__slide img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.splide__slide.is-active img {
    width: 250px;
    height: 250px;
}

.style-title {
    margin-top: 10px;
    font-weight: bold;
    font-size: 1.1em;
}

/* Product Cards */
.product-card-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.product-card {
    position: relative;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
}

.product-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.card-content {
    padding: 5px;
    text-align: center;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.product-card input:checked + .card-content {
    border-color: #4CAF50;
    box-shadow: 0 4px 15px rgba(76,175,80,0.2);
}

.product-card img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin: 0 auto;
}

.product-title {
    margin: 15px 0;
    font-weight: bold;
    font-size: 1.1em;
}

/* Product Options */
.product-options {
    margin-top: 15px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 6px;
}

.product-options label {
    display: block;
    margin: 12px 0;
    font-size: 14px;
    text-align: left;
}

.product-options select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

/* Response Messages */
#ai-cartoon-response {
    margin-top: 25px;
    min-height: 50px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error-message {
    color: #dc3545;
    text-align: center;
    padding: 15px;
    background: #ffe6e6;
    border-radius: 5px;
    margin: 15px 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toggle Styles */
.product-toggle {
    margin: 25px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.toggle-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    background: #57948C;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: #f87736;
    color: white;
    transform: scale(1.05);
}

.toggle-btn:hover:not(.active) {
    background: #57948C;
}

/* Product Categories */
.product-category {
    display: none;
}

.product-category.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-pet-cartoon-container {
        padding: 20px;
    }
    
    .product-card-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0px;
    }
    
    .product-card img {
        width: 100%;
        height: auto;
        max-width: 200px;
    }
}

/* === Grid-style style picker (cards, same images) === */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 24px auto 12px;
  padding: 0 10px;
}
.style-grid .style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.style-grid .style-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0,0,0,.12); }
.style-grid .style-card.is-selected { border-color: #f87736; box-shadow: 0 14px 30px rgba(248,119,54,.22); }
.style-grid .style-card img {
  width: 100%; max-width: 240px; height: 170px; object-fit: cover;
  border-radius: 14px; border: none; box-shadow: none;
}
.style-grid .style-name {
  font-weight: 700; font-size: 1rem; color: #333;
  background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 999px;
  padding: 6px 12px;
}
.loading-spinner{
  width:28px; height:28px; border:3px solid #ddd; border-top-color:#111827;
  border-radius:50%; animation: spin 1s linear infinite; margin:10px auto;
}
@keyframes spin{ 0%{transform:rotate(0)} 100%{transform:rotate(360deg)} }

/* === Responsive generated image preview === */
#ai-generated-preview {
  margin: 12px auto 0;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 900px;
  padding: 8px 0;
}
#ai-generated-preview img {
  width: 100%;
  max-width: 640px;
  max-height: 70vh;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
@media (max-width: 768px) {
  #ai-generated-preview img {
    max-width: 100%;
    max-height: 55vh;
    border-radius: 12px;
  }
}

/* === Grid-style style picker (cards, same images) === */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 24px auto 12px;
  padding: 0 10px;
}
.style-grid .style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.style-grid .style-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0,0,0,.12); }
.style-grid .style-card.is-selected { border-color: #f87736; box-shadow: 0 14px 30px rgba(248,119,54,.22); }
.style-grid .style-card img {
  width: 100%; max-width: 240px; height: 170px; object-fit: cover;
  border-radius: 14px; border: none; box-shadow: none;
}
.style-grid .style-name {
  font-weight: 700; font-size: 1rem; color: #333;
  background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 999px;
  padding: 6px 12px;
}
.loading-spinner{
  width:28px; height:28px; border:3px solid #ddd; border-top-color:#111827;
  border-radius:50%; animation: spin 1s linear infinite; margin:10px auto;
}
@keyframes spin{ 0%{transform:rotate(0)} 100%{transform:rotate(360deg)} }

