.ai-caption-form {
    max-width: 700px;
    margin: 30px auto;
    padding: 25px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: 'IRANSans', sans-serif;
}

.ai-caption-form textarea,
.ai-caption-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.genbtn {
    background-color: #0073aa;
    color: white;
    padding: 8px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.limit-reached-genbtn {
    background-color: gray;
    color: white;
    padding: 8px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}


.ai-caption-form button:hover {
    background-color: #005f8d;
}

#ai-caption-result {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
}

.instagram-preview {
    background: #fafafa;
    border: 1px solid #dbdbdb;
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.instagram-preview .username {
    font-weight: bold;
    margin-bottom: 8px;
    color: #262626;
}

.instagram-preview .caption {
    font-size: 14px;
    color: #262626;
    line-height: 1.6;
}

#share-buttons {
    margin-top: 15px;
}

#share-buttons a {
    margin: 4px 4px 4px 0;
    display: inline-block;
    background-color: #25D366;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
}

#share-buttons a.telegram {
    background-color: #0088cc;
}
#share-buttons a.facebook {
    background-color: #4267B2;
}
#share-buttons a.twitter {
    background-color: #1DA1F2;
}
#share-buttons a.linkedin {
    background-color: #0077b5;
}
#share-buttons a.generic {
    background-color: #3ec2a9;
}

#search-counter {
    margin-bottom: 10px;
    font-weight: bold;
    color: #444;
}

.toast {
    background-color: #28a745;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: none;
}

/* فاصله بین کپشن و هشتگ */
#generated-caption {
  margin-bottom: 16px;
  font-weight: 500;
}

/* شبیه‌سازی گوشی موبایل */
.instagram-preview {
  background: #fff;
  border: 8px solid #e6e6e6;
  border-radius: 30px;
  padding: 10px;
  max-width: 320px;
  margin: 20px auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.15);
}
.instagram-preview img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 10px;
}
.instagram-preview .username {
  font-weight: bold;
  color: #262626;
  margin-bottom: 8px;
}
.instagram-preview .caption {
  font-size: 14px;
  color: #262626;
  line-height: 1.6;
}



.caption-history-title {
  font-size: 18px;
  margin-top: 30px;
  padding: 10px 12px;
  background: #f2f2f2;
  border-left: 5px solid #0073aa;
  border-radius: 6px;
  color: #222;
  font-weight: bold;
}

#ai-caption-usage-banner {
    background-color: #e8f0fe;
    border: 1px solid #c6dafc;
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #27496d;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
#ai-caption-usage-banner.limit-reached {
    background-color: #fdecea;
    border-color: #f5c6cb;
    color: #721c24;
}

/* کانتینر لودینگ */
.loading-text {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
background-color: #e8f0fe;
border: 1px solid #c6dafc;
padding: 12px 20px;
border-radius: 6px;
margin-bottom: 15px;
font-size: 14px;
color: #27496d;
text-align: center;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

    
}

/* سه نقطهٔ متحرک */
.loading-text .dots::after {
  content: '';
  display: inline-flex;
  width: 1.2em;
  text-align: left;
  animation: dots 1s steps(4, end) infinite;
}

/* تعریف فریم‌های انیمیشن */
@keyframes dots {
  0%, 20%  { content: '';    }
  40%      { content: '.';   }
  60%      { content: '..';  }
  80%,100% { content: '...'; }
}

.ai-history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.ai-history-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.history-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.history-caption {
    margin-bottom: 8px;
    line-height: 1.5;
}

.history-hashtags {
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 12px;
}

.history-actions {
    display: block;
    gap: 8px;
}

.history-actions .copy-btn,
.history-actions .share-btn,.whatsapp-btn,.telegram-btn ,#copy-caption {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.copy-btn ,#copy-caption{
    background: #763ec2;
    color: #fff;
}

.share-btn {
    background: #e6fffa;
}

.copy-btn:hover {
    background: #dbeafe;
}



.whatsapp-btn {
    background: #25d366;
    color: #fff;
}

.telegram-btn {
    background: #0088cc;
    color: #fff;
}

.share-all-btn {
    background: #3ec2a9;
    color: #fff;
    padding: 3px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.share-all-btn:hover {
    background: #5a6268;
}


.ai-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 9999;
}

.ai-toast.visible {
    opacity: 1;
}


.ai-color-picker-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ai-color-picker-label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.ai-color-input-wrapper {
    position: relative;
}

/* مخفی کردن ظاهر پیش‌فرض */
.ai-color-input {
    position: absolute;
    width: 36px;
    height: 36px;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
}

/* نمایش swatch دایره‌ای به‌جای input */
.ai-color-swatch {
    display: inline-block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background-color: #ff4757;
    /* مقدار اولیه */
    cursor: pointer;
    transition: border-color .2s;
}

.ai-color-swatch:hover {
    border-color: #999;
}

/* پیش‌تنظیم‌های رنگ */
.ai-color-presets {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.ai-preset {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .2s;
}

.ai-preset:hover,
.ai-preset.selected {
    border-color: #333;
}
