   /* Add animations for the saved notification */
   @keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}

/* Smooth hover effect for the saved notification link */
.saved-notification a:hover {
    text-decoration-color: rgba(255, 255, 255, 1) !important;
    transition: text-decoration-color 0.2s ease;
}

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

/* Force visibility for preview container */
.image-preview-container.force-visible {
    display: block !important;
}

/* AI Engine Selection Styles */
.ai-engine-selection {
    display: flex;
    flex-direction: row;
    gap: 4px;
    text-align: center;
}

.engine-option {
    position: relative;
    flex: 1;
}

 .engine-option input[type="radio"],
 .engine-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

 .engine-label {
     display: flex;
     flex-direction: column;
     padding: 6px;
     border: 1px solid #e2e8f0;
     border-radius: 8px;
     cursor: pointer;
     transition: all 0.2s ease;
     background: linear-gradient(45deg, #f6fdff, transparent);
     height: 100%;
     position: relative; /* Needed for the checkmark positioning */
 }

 /* Faded background checkmark for selected engines */
 .engine-label::before {
     content: "";
     position: absolute;
     inset: 0;
     background-image: url('https://s3.amazonaws.com/i.litcdn.com/checkcircle.png');
     background-position: bottom;
     background-repeat: no-repeat;
     background-size: 20% auto;
     opacity: 0;
     transition: opacity 0.55s ease;
     pointer-events: none;
 }

 .engine-option input:checked + .engine-label::before {
     opacity: 0.44; /* faded out, watermark-like */
 }

.engine-label:hover {
    border-color:#bbbbbb;
    background: #f8fafc;
}

 .engine-option input:checked + .engine-label {
    border-color: #4692da;
    background: linear-gradient(180deg, #5bb5d6, #ffffff);
    border-width: 1px;
}

.engine-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4px;
}

.engine-info .fa {
    color: #FFD700;
}

.engine-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95em;
}

.engine-badge {
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
}

.engine-badge.openai {
    background-color: #4299e1;
}

.engine-badge.gpt-image-2 {
    background-color: #2563eb;
}

.engine-badge.imagen {
    background-color: #f59e0b;
}
.engine-badge.ideogram {
    background-color:rgb(89, 12, 171);
}
.engine-badge.nano-pro { background-color:#111; }

.engine-badge.nano-banana {
    background-color: #010b0c;
}

.engine-badge.nano-2 {
    background-color: #0f766e;
}

.font-color-group {
    margin-top: -8px;
    margin-bottom: 8px;
  justify-content: space-between;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0 12px;
}

.font-color-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}

.font-color-header label {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1;
}

.font-color-enable {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.font-color-enable input {
    width: 12px;
    height: 12px;
    margin: 0;
    accent-color: #2563eb;
}

.font-color-enable span {
    font-size: 0.62rem;
    line-height: 1;
}

.font-color-reset {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 0.66rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.font-color-reset:hover {
    color: #1e293b;
}

.font-color-picker-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.font-color-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 6px;
    /* border: 1px solid #e2e8f0; */
    border-radius: 6px;
    /* background: #f8fafc; */
    color: #475569;
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1;
}
.font-color-picker span{display: block;font-size: 7px;text-transform: uppercase;}

.font-color-picker input[type="color"] {
    width: 36px;
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.font-color-group:not(.has-font-colors) .font-color-picker {
    opacity: 0.72;
}

.font-color-group .description {
    margin-top: 4px;
    font-size: 0.66rem;
    line-height: 1.1;
}

.brand-overlay-group {
    margin-top: -4px;
    margin-bottom: 8px;
}

.brand-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}

.brand-overlay-header label {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1;
}

.brand-overlay-header span {
    color: #64748b;
    font-size: 0.62rem;
    line-height: 1;
}

.brand-overlay-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 6px;
}

.brand-overlay-row select {
    min-width: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: 0.68rem;
    line-height: 1;
    padding: 5px 6px;
}

.logo-overlay-btn {
    display: none;
}

.logo-overlay-dropdown {
    margin: 0 10px 10px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.logo-overlay-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px auto auto;
    gap: 8px;
    align-items: center;
}

.logo-overlay-controls select {
    min-width: 0;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
    color: #334155;
    font-size: 0.74rem;
    padding: 6px 7px;
}

.logo-overlay-apply-btn,
.logo-overlay-cancel-btn {
    border: 1px solid #dbe3ec;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.72rem;
    line-height: 1;
    padding: 7px 9px;
    cursor: pointer;
}

.logo-overlay-apply-btn {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.logo-overlay-apply-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.logo-overlay-help {
    margin-top: 6px;
    color: #64748b;
    font-size: 0.66rem;
    line-height: 1.15;
}

.logo-brand-create-form {
    display: grid;
    gap: 8px;
}

.logo-brand-create-header {
    display: grid;
    gap: 2px;
}

.logo-brand-create-header strong {
    color: #111827;
    font-size: 0.82rem;
    line-height: 1;
}

.logo-brand-create-header span {
    color: #64748b;
    font-size: 0.68rem;
    line-height: 1.2;
}

.logo-brand-create-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 8px;
    align-items: center;
}

.logo-brand-create-grid input[type="text"],
.logo-brand-create-grid input[type="file"],
.logo-brand-create-grid select {
    min-width: 0;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
    color: #334155;
    font-size: 0.74rem;
    padding: 6px 7px;
}

.logo-brand-create-grid input[type="file"] {
    grid-column: 1 / -1;
}

.logo-brand-default-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #475569;
    font-size: 0.7rem;
}

.brand-preview-logo {
    position: absolute;
    z-index: 4;
    object-fit: contain;
    cursor: move;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    filter: drop-shadow(0 2px 7px rgba(15, 23, 42, 0.32));
}

.thumbnail-image img.brand-preview-logo {
    height: auto;
    object-fit: contain;
}

.brand-preview-resize-handle {
    position: absolute;
    z-index: 5;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
    cursor: nwse-resize;
    touch-action: none;
}

.engine-info div {font-size: 0.8em;}
.engine-description {
    font-size: 0.85em;
    color: #64748b;
    line-height: 1.3;
}

 .engine-option input:checked + .engine-label .engine-name {
    color: #1e40af;
}

 .engine-option input:checked + .engine-label .engine-description {
    color: #1e40af;
}

/* Auto-selected State */
.engine-option.auto-selected .engine-label {
    border-color: #22c55e;
    background: linear-gradient(180deg, #86efac, #ffffff);
    border-style: dashed;
    opacity: 0.9;
}

.engine-option.auto-selected .engine-name {
    color: #16a34a;
}

.engine-option.auto-selected .engine-description {
    color: #16a34a;
}

.engine-option.auto-selected .engine-label::after {
    content: "AUTO";
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.6em;
    font-weight: bold;
    color: #16a34a;
    opacity: 0.8;
}

/* Warning and Required States */
.engine-option.warning .engine-label {
    border-color: #f59e0b;
    background: #fef3c7;
}

.engine-option.required .engine-label {
    border-color: #ef4444;
    background: #fee2e2;
}

.engine-warning {
    font-size: 0.8em;
    color: #d97706;
    margin-top: 4px;
    font-weight: 500;
}

.engine-option.required .engine-warning {
    color: #dc2626;
}

.engine-description-display {
    margin-top: 5px;
    padding: 7px;
    color: #4a5568;
    font-size: 0.875rem;
    transition: opacity 0.3s ease;
}

/* Video Demo Styles */
 .video-demo-container {
     margin-bottom: 24px;
     position: relative;
     border-radius: 12px;
     overflow: hidden;
     box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
     background: #f8fafc;
     display: none; /* Initially hidden */
 }

 .video-placeholder {
     position: relative;
     cursor: pointer;
     display: block;
     width: 200px;
     float: left;
 }

 .video-placeholder img {
     width: 100%;
     display: block;
     border-radius: 12px;
     transition: transform 0.3s ease;
 }
 
 .video-placeholder:hover img {
     transform: scale(1.03);
 }

 .video-overlay {
     position: absolute;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.0) 100%);
     border-radius: 12px;
     pointer-events: none;
 }

 .play-button {
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     background: rgba(255, 255, 255, 0.95);
     color: #ef4444; /* red */
     border-radius: 50%;
     width: 64px;
     height: 64px;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: all 0.2s ease;
     box-shadow: 0 4px 12px rgba(0,0,0,0.2);
 }

 .play-button svg {
     width: 32px;
     height: 32px;
     margin-left: 4px;
 }

 .video-placeholder:hover .play-button {
     background: #ef4444;
     color: white;
     transform: translate(-50%, -50%) scale(1.1);
 }

 .hide-video-btn {
     position: absolute;
     top: 12px;
     right: 12px;
     background: rgba(0, 0, 0, 0.4);
     color: white;
     border: none;
     border-radius: 50%;
     width: 26px;
     height: 26px;
     font-size: 16px;
     line-height: 26px;
     text-align: center;
     cursor: pointer;
     transition: background 0.2s ease;
     z-index: 10;
 }
 .hide-video-btn:hover {
     background: rgba(0,0,0,0.7);
 }

 .video-iframe-container {
     position: relative;
     width: 100%;
     padding-top: 56.25%; /* 16:9 Aspect Ratio */
 }

 .video-iframe-container iframe {
     position: absolute;
     top: 0;
     left: 0;
     bottom: 0;
     right: 0;
     width: 100%;
     height: 100%;
     border: none;
 }

 /* Video Popout Modal */
 .video-popout-overlay {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, 0.75);
     display: none; /* Hidden by default */
     align-items: center;
     justify-content: center;
     z-index: 1050; /* Higher than other content */
     animation: fadeIn 0.3s ease;
 }

 @keyframes fadeIn {
     from { opacity: 0; }
     to { opacity: 1; }
 }

 .video-popout-content {
     position: relative;
     width: 85vw;
     max-width: 1280px;
     background: black;
     border-radius: 12px;
     box-shadow: 0 10px 30px rgba(0,0,0,0.5);
     animation: scaleIn 0.3s ease;
 }

 @keyframes scaleIn {
     from { transform: scale(0.9); opacity: 0; }
     to { transform: scale(1); opacity: 1; }
 }


 .video-popout-iframe-container {
     position: relative;
     width: 100%;
     padding-top: 56.25%; /* 16:9 Aspect Ratio */
     border-radius: 12px;
     overflow: hidden;
 }

 .video-popout-iframe-container iframe {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     border: none;
 }

 .video-popout-close {
     position: absolute;
     top: -40px;
     right: -10px;
     background: transparent;
     border: none;
     color: white;
     font-size: 40px;
     font-weight: 300;
     cursor: pointer;
     transition: transform 0.2s ease;
     line-height: 1;
 }

 .video-popout-close:hover {
     transform: scale(1.1);
     color: #ddd;
 }

 .marketing-section-prose {
     padding: 24px;
     background-color: #f8fafc;
     border-radius: 12px;
     margin-bottom: 24px;
     border: 1px solid #e2e8f0;
 }
 .marketing-section-prose h2 {
     font-size: 1.5em;
     font-weight: 600;
     color: #1e293b;
     margin-bottom: 16px;
 }
 .marketing-section-prose p {
     font-size: 1rem;
     color: #4a5568;
     line-height: 1.6;
     margin-bottom: 12px;
 }
 .marketing-section-prose strong,
 .faq-answer strong {
     font-weight: normal;
 }

/* Edit with AI Button and Dropdown Styles */
.edit-with-ai-btn {
 
}

.edit-with-ai-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.edit-with-ai-btn:active {
    transform: translateY(0);
}

/* AI Edit Dropdown */
.ai-edit-dropdown {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 8px;
    align-items: center;
    animation: slideDown 0.2s ease;
}

.ai-edit-prompt-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.ai-edit-prompt-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-edit-prompt-input::placeholder {
    color: #9ca3af;
}

.ai-edit-engine-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    color: #495057;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 100px;
    font-weight: 500;
}

.ai-edit-engine-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-edit-engine-select:hover {
    border-color: #cbd5e1;
}

.ai-edit-apply-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ai-edit-apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.ai-edit-apply-btn:active {
    transform: translateY(0);
}

.ai-edit-cancel-btn {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.ai-edit-cancel-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Slide down animation for dropdown */
@keyframes slideDownEdit {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Variations Preview Dots */
.variations-preview {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    z-index: 10;
}

.variation-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.variation-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.variation-dot.active {
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.6);
}

/* AI Edit Loading Overlay */
.ai-edit-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.loading-spinner-container {
    text-align: center;
    color: white;
}

.loading-spinner-container p {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.loading-spinner-container .loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* Emotion Picker */
.optional-prompt-group {
    margin-top: 10px;
    position: relative;
}

.optional-prompt-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border:none;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.7rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.optional-prompt-toggle:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.optional-prompt-group:not(.collapsed) .optional-prompt-toggle {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 28px;
    height: 28px;
    justify-content: center;
    padding: 0;
    border-color: transparent;
    background: transparent;
}

.optional-prompt-group:not(.collapsed) .optional-prompt-toggle-text {
    display: none;
}

.optional-prompt-toggle-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 1rem;
    line-height: 1;
}

.optional-prompt-content {
    margin-top: 10px;
}

.optional-prompt-group:not(.collapsed) .optional-prompt-content {
    margin-top: 0;
}

.optional-prompt-group.collapsed .optional-prompt-content {
    display: none;
}

.optional-prompt-group:not(.collapsed) .optional-prompt-toggle-icon {
    width: auto;
    height: auto;
    background: transparent;
    color: #334155;
}

#video-desc-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.emotion-picker-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 4px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    color: #ff7154;
    float: right;
}

.emotion-picker-btn .material-icons {
    font-size: 16px;
    color: #64748b;
}

.emotion-picker-btn:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e0;
}

.emotion-picker-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #fcfcf3;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    min-width: 340px;
}

.emotion-picker-popup.show {
    display: grid;
}

.emotion-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.emotion-option .material-symbols-outlined {
    font-size: 34px;
    color: #475569;
}
.emotion-option:hover {
    background-color: #f1f5f9;
}

.emotion-option .material-icons {
    font-size: 24px;
    color: #475569;
}

.emotion-option span:last-child {
    font-size: 0.65em;
    color: #64748b;
    margin-top: 2px;
}
