/**
 * Re-Prompts Frontend Styles
 *
 * Table of Contents:
 * 1. Base Layout
 * 2. Tab Navigation
 * 3. Upload Section
 * 4. Style Selection
 * 5. Category Filters
 * 6. Style Grid & Items
 * 7. Selection Tags
 * 8. Aspect Ratio Section
 * 9. Generate Section
 * 10. Results Section
 * 11. Messages & Loading
 * 12. Responsive Design
 * 13. Dark Theme Support
 
 Red: 		#EE4035;
 Orange: 	#FF9122;
 Border: 	#d7dee3;
 */


/* ===================================================================
   1. BASE LAYOUT
   =================================================================== */
#header div .ct-sticky-container > div{  z-index: 1 !important;}
#main{ z-index:0 !important;}

.re-prompts-generator { max-width: 100% !important; margin: 0 auto;}

/* Two Column Layout */
.re-prompts-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Left Column (Fixed) */
.re-prompts-left-column {
    width: 35%;
    position: sticky;
    top: 95px;
    padding: 25px 0 25px 25px;
    /* 
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
    border: 1px solid #ebecef; 
    */
}

/* Right Column */
.re-prompts-right-column {
    width: 65%;
    padding: 25px;
    /* 
	background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
     */
    border-left: 1px solid #d7dee3;
    min-height: 100vh;
    box-sizing: border-box;
}

/* ===================================================================
   2. TAB NAVIGATION
   =================================================================== */

.re-prompts-tabs {
    width: 100%;
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid #d7dee3 !important;
    margin-bottom: 25px;
}

.tab-button {
    background: transparent !important;
    border: none;
    border-radius: 0 !important;
    padding: 10px 20px !important;
    color: #000 !important;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    color: #0073aa;
    background-color: #f8f9fa;
}

.tab-button.active {
    color: #0073aa;
    border-bottom: 2px solid #000 !important;
    background-color: #f8f9fa;
}

.tab-counter {
    margin-left: 8px;
    font-size: 13px;
    opacity: 0.8;
    font-weight: normal;
}

.tab-button.active .tab-counter {
    opacity: 0.9;
}

.tab-content {
    min-height: 400px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ===================================================================
   3. UPLOAD SECTION
   =================================================================== */

.re-prompts-upload-section {
    margin-bottom: 25px;
}

.re-prompts-upload-section h3 {
    margin-bottom: 15px;
}

.re-prompts-upload-area {
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.re-prompts-upload-area:hover {
    border-color: #e0e4eb;
    background: #e0e4eb;
}

.re-prompts-upload-area.dragover {
    border-color: #e0e4eb;
    background: #e0e4eb;
    transform: scale(1.02);
}

/* Upload Placeholder */
.upload-placeholder {
    display: flex;
    flex-direction: column !important;
    align-items: center !important;
}

.upload-placeholder .dashicons {
    width: 100%;
    height: 30px;
    font-size: 64px;
    color: #ccc;
    margin-bottom: 30px;
    text-align: center;
    display: block;
}

.upload-placeholder p {
    margin: 15px 0;
    color: #666;
}

/* Upload Preview */
.upload-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.upload-preview img {
    max-width: 100%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Remove Image Button */
#re-prompts-remove-image {
    position: absolute;
    top: -15px;
    right: -15px;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    background: rgba(214, 54, 56, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.8);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#re-prompts-remove-image:hover {
    color: #fff;
    background: rgba(214, 54, 56, 1);
    text-decoration: none;
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#re-prompts-remove-image i {
    font-size: 14px;
}

/* Upload Progress */
.re-prompts-upload-progress {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #005a87);
    width: 0%;
    transition: width 0.3s ease;
    animation: progress-animation 2s infinite;
}

@keyframes progress-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: #666;
}


/* ===================================================================
   4. STYLE SELECTION
   =================================================================== */

.re-prompts-styles-section,
.re-prompts-sref-section {
    margin-bottom: 30px;
}

.re-prompts-styles-section h3,
.re-prompts-sref-section h3 {
    margin-bottom: 15px;
}

/* ===================================================================
   5. CATEGORY FILTERS
   =================================================================== */

.style-categories {
    margin-bottom: 40px;
}

.style-categories label {
    display: block;
    margin-bottom: 20px;
}

.style-categories select {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #d7dee3;
    border-radius: 5px;
}

.category-radio-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.category-item {
    padding: 3px 15px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.category-item:hover {
    background-color: #dee2ea;
}

.category-item.selected {
    background-color: #000000;
    color: white;
}

.category-item span {
    font-size: 13px;
    font-weight: 500;
}

/* ===================================================================
   6. STYLE GRID & ITEMS
   =================================================================== */

/* Grid Layout */
.prompt-styles-grid, .sref-v6-styles-grid,
.sref-styles-grid {
    display: grid;
    grid-template-columns: repeat(8, 2fr);
    gap: 30px;
    align-items: stretch;
}



/* Style Items */
.style-item {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
}

.style-item h5 {
    margin: 0 0 10px 0;
}

.style-item p {
    margin: 0 0 10px 0;
    color: #666;
    line-height: 1.4;
}

/* Style Selection Indicators - Removed tick icons for better performance */

/* Thumbnails */
.style-thumbnail {
    margin-bottom: 6px;
    overflow: hidden;
    border-radius: 10px;
    position: relative;
    width: 100%;
    aspect-ratio: 1;
}

.style-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: all 0.3s ease;
}

/* Fallback for browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 1) {
    .style-thumbnail {
        padding-bottom: 100%;
        height: 0;
    }
}

/* Ensure consistent thumbnail sizing for all style types */
.style-item .style-thumbnail {
    width: 100% !important;
    aspect-ratio: 1 !important;
    overflow: hidden !important;
    position: relative !important;
    min-height: 0 !important;
    max-height: none !important;
}

.style-item .style-thumbnail img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
}

/* Force consistent grid item sizing */
.prompt-styles-grid .style-item,
.sref-styles-grid .style-item,
.sref-v6-styles-grid .style-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.prompt-styles-grid .style-item .style-thumbnail,
.sref-styles-grid .style-item .style-thumbnail,
.sref-v6-styles-grid .style-item .style-thumbnail {
    width: 100% !important;
    aspect-ratio: 1 !important;
    flex-shrink: 0 !important;
}

/* Very specific rules to override any theme or plugin interference */
div.sref-v6-styles-grid div.style-item div.style-thumbnail {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
    position: relative !important;
    border-radius: 10px !important;
    margin-bottom: 12px !important;
    min-height: 0 !important;
    max-height: none !important;
    flex-shrink: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* Even more specific - use the ID selector */
#sref-v6-styles-grid div.style-item div.style-thumbnail {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
    position: relative !important;
    border-radius: 10px !important;
    margin-bottom: 12px !important;
    min-height: 0 !important;
    max-height: none !important;
    flex-shrink: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* Ultimate specificity - target the exact container with multiple selectors */
div#sref-v6-styles-grid.sref-v6-styles-grid div.style-item div.style-thumbnail {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
    position: relative !important;
    border-radius: 10px !important;
    margin-bottom: 12px !important;
    min-height: 0 !important;
    max-height: none !important;
    flex-shrink: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
}

div.sref-v6-styles-grid div.style-item div.style-thumbnail img,
#sref-v6-styles-grid div.style-item div.style-thumbnail img,
div#sref-v6-styles-grid.sref-v6-styles-grid div.style-item div.style-thumbnail img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 10px !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
}

/* Force SREF v6 grid items to behave exactly like other grids */
.sref-v6-styles-grid .style-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure SREF v6 thumbnails match other grids exactly */
.sref-v6-styles-grid .style-item .style-thumbnail {
    width: 100% !important;
    aspect-ratio: 1 !important;
    overflow: hidden !important;
    position: relative !important;
    border-radius: 10px !important;
    margin-bottom: 12px !important;
    flex-shrink: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
}

.sref-v6-styles-grid .style-item .style-thumbnail img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 10px !important;
}





.style-item:hover .style-thumbnail img {
    transform: scale(1.05);
}

.style-item.selected .style-thumbnail img {
}

/* Style Content */
.style-content {
    text-align: center;
}

.style-content h5 {
    margin: 0 0 10px 0;
}

.style-content p {
    margin: 0;
    color: #666;
}

/* Style Meta */
.style-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.category-tag {
    background: #f0f0f0;
    color: #666;
    padding: 3px 8px;
    border-radius: 10px;
}

/* SREF Specific Styles */
.sref-details {
    margin: 5px 0 0 0;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.sref-code {
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 12px;
}

.sref-version {
    font-size: 12px;
}

/* SREF Style Items - Multiple Selection */
.style-item[data-type="sref"],
.style-item[data-type="sref-v6"] {
    position: relative;
}

/* SREF Overlay for Favorite Button */
.sref-overlay {
    position: absolute; bottom: 5px; right: 5px; z-index: 10;
}

.favorite-btn {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease; color: #fff;
    background-color: transparent !important;
    padding: 0 !important;
}

.favorite-btn:hover {color: #fff; background-color: #000 !important;}
.favorite-btn.favorited {color: #FF9122; background-color: transparent !important; }
.favorite-btn:hover.favorited {color: #ffffff; background-color: #000 !important; }


.favorite-btn.favorited i {color:#FF9122 !important;}
.favorite-btn:hover i, .favorite-btn:hover.favorited i {color: #fff !important;  }


/* Favorites Tab Styles */
.favorites-subtabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.subtab-button {
    background: none;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #666;
}

.subtab-button:hover {
    color: #333;
    border-bottom-color: #ccc;
}

.subtab-button.active {
    color: #007cba;
    border-bottom-color: #007cba;
    font-weight: 600;
}

.subtab-counter {
    color: #999;
    font-weight: normal;
}

.favorites-content {
    position: relative;
}

.subtab-panel {
    display: none;
}

.subtab-panel.active {
    display: block;
}

.no-favorites-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.no-favorites-message p {
    margin: 0;
    font-size: 16px;
}

/* Favorites Grid Styles */
.sref-v7-favorites-grid,
.sref-v6-favorites-grid,
.prompt-favorites-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.sref-style-item {
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.sref-style-item:hover {
    border-color: #007cba;
}

.sref-style-item.selected {
    border-color: #007cba;
}

.sref-thumbnail-container {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.sref-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sref-info {
    padding: 10px;
}

.sref-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px 0;
    text-align: center;
    line-height: 1.3;
}

.sref-code {
	background: rgba(255, 255, 255, 0.7);
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 12px;
    text-align: center;
    display: block;
}

/* Smooth animations for favorites removal */
.style-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.style-item.removing {
    opacity: 0;
    transform: scale(0.8);
    margin: 0;
    padding: 0;
    height: 0;
    overflow: hidden;
}

/* Grid auto-reflow for smooth removal */
.styles-grid,
.sref-styles-grid,
.sref-v6-styles-grid,
.prompt-styles-grid {
    display: grid;
    gap: 15px;
    transition: all 0.3s ease;
}

/* Ensure grid items maintain their flow */
.styles-grid .style-item,
.sref-styles-grid .style-item,
.sref-v6-styles-grid .style-item,
.prompt-styles-grid .style-item {
    transition: all 0.3s ease;
}

/* Favorite notification styles */
.favorite-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    color: #000;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.favorite-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.favorite-notification i {
    color: #EE4035;
    font-size: 16px;
}

.favorite-notification-success {
    background: #fff;
    color: #000;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .favorite-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        transform: translateY(100%);
    }

    .favorite-notification.show {
        transform: translateY(0);
    }
}

/* Right panel tick icons - show on all style types in their respective containers */
.re-prompts-styles-section .style-item[data-type="prompt"].selected::after,
.re-prompts-sref-section .style-item[data-type="sref"].selected::after,
.re-prompts-sref-v6-section .style-item[data-type="sref-v6"].selected::after {
  	content: "\f00c" !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
    position: absolute;
    top: -10px;
    right: -10px;
    background: #EE4035;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.style-item[data-type="sref"] .style-thumbnail,
.style-item[data-type="sref-v6"] .style-thumbnail {
    margin-bottom: 10px;
}

.style-item[data-type="sref"] h5,
.style-item[data-type="sref-v6"] h5 {
    margin-bottom: 0px;
}

/* ===================================================================
   7. SELECTION TAGS
   =================================================================== */

.re-prompts-selection-tags {
    padding-top: 20px;
}

.selection-tags-group {
    margin-bottom: 30px;
}

.selection-tags-group:last-child {
    margin-bottom: 30px;
}

.selection-tags-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.tags-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.tags-container button {
    font-size: 12px !important;
    background-color: #e6e5ea!important;
    color: #333;
    padding: 5px 15px !important;
}

.selection-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0073aa;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.selection-tag:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.selection-tag .remove-icon {
    font-size: 16px;
    line-height: 1;
    margin-left: 0;
    opacity: 0.8;
}

.selection-tag:hover .remove-icon {
    opacity: 1;
}

/* Selected Style Items in Tags Container */
.tags-container .style-item {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tags-container .style-item:hover {
    transform: translateY(-2px);
}

.tags-container .style-item.selected-style-item {
}

.tags-container .style-item h5 {
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.2;
}

.tags-container .style-item .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #666;
    font-size: 12px;
}

/* SREF Limit Warning */
.sref-limit-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #856404;
    font-size: 14px;
    line-height: 1.4;
}

.sref-limit-warning i {
    color: #ffc107;
    font-size: 16px;
    flex-shrink: 0;
}

/* SREF Version Conflict Warning */
.sref-version-warning {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #721c24;
    font-size: 14px;
    line-height: 1.4;
}

.sref-version-warning i {
    color: #dc3545;
    font-size: 16px;
    flex-shrink: 0;
}

/* Loading States */
.no-styles, .error-styles {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.error-styles {
    color: #dc3545;
}

/* ===================================================================
   8. ASPECT RATIO SECTION
   =================================================================== */

.re-prompts-aspect-ratio-section {
    margin-bottom: 10px;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background-color: #fff !important;
}



.re-prompts-aspect-ratio-section h5 {
    margin: 0 0 18px 0;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 5px;
}


.aspect-ratio-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
}

.aspect-ratio-item {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 90px;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 5px;
}




@keyframes selectedPulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
    }
    50% {
        box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
    }
}

.aspect-ratio-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.aspect-ratio-item.loading .ratio-preview {
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Aspect ratio tick icons removed for better performance */

.ratio-preview {
    width: 36px;
    height: 36px;
    border-radius: 5px;
    margin-bottom: 5px;
    border: 1px solid #d7dee3;
    transition: all 0.3s ease;
}

.aspect-ratio-item.selected .ratio-preview {
    border: 1px solid #000000;
}


.ratio-1-1 {
    width: 36px;
    height: 36px;
}

.ratio-3-4 {
    width: 27px;
    height: 36px;
}

.ratio-4-3 {
    width: 36px;
    height: 27px;
}

.ratio-9-16 {
    width: 20px;
    height: 36px;
}

.ratio-16-9 {
    width: 36px;
    height: 20px;
}

.ratio-label {
    font-size: 13px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 3px;
    letter-spacing: 0.5px;
}

.ratio-description {
    font-size: 11px;
    color: #7f8c8d;
    line-height: 1.3;
    font-weight: 500; display: none !important;
}


.aspect-ratio-item.selected .ratio-description {
    color: #000;
}

/* Aspect Ratio Responsive Design */
@media (max-width: 1200px) {
    .aspect-ratio-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0;
    }

    .aspect-ratio-item {
        padding: 14px 10px;
    }

    .ratio-preview {
        width: 32px;
        height: 32px;
    }

    .ratio-1-1 {
        width: 32px;
        height: 32px;
    }

    .ratio-3-4 {
        width: 24px;
        height: 32px;
    }

    .ratio-4-3 {
        width: 32px;
        height: 24px;
    }

    .ratio-9-16 {
        width: 18px;
        height: 32px;
    }

    .ratio-16-9 {
        width: 32px;
        height: 18px;
    }
}

@media (max-width: 980px) {
    .aspect-ratio-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0;
    }
	.sref-code{ display: none;}
    .re-prompts-aspect-ratio-section {
        padding: 16px;
        margin-bottom: 20px;
    }

    .aspect-ratio-item {
        padding: 12px 8px;
    }

    .ratio-preview {
        width: 28px;
        height: 28px;
    }

    .ratio-1-1 {
        width: 28px;
        height: 28px;
    }

    .ratio-3-4 {
        width: 21px;
        height: 28px;
    }

    .ratio-4-3 {
        width: 28px;
        height: 21px;
    }

    .ratio-9-16 {
        width: 16px;
        height: 28px;
    }

    .ratio-16-9 {
        width: 28px;
        height: 16px;
    }

    .ratio-label {
        font-size: 12px;
    }

    .ratio-description {
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    .aspect-ratio-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 0;
    }
    
    .re-prompts-right-column{ border: none !important; }

    .re-prompts-aspect-ratio-section {
        padding: 14px;
        margin-bottom: 18px;
    }

    .re-prompts-aspect-ratio-section h5 {
        margin-bottom: 10px;
    }

    .aspect-ratio-item {
        padding: 10px 6px;
    }

    .ratio-preview {
        width: 24px;
        height: 24px;
    }

    .ratio-1-1 {
        width: 24px;
        height: 24px;
    }

    .ratio-3-4 {
        width: 18px;
        height: 24px;
    }

    .ratio-4-3 {
        width: 24px;
        height: 18px;
    }

    .ratio-9-16 {
        width: 14px;
        height: 24px;
    }

    .ratio-16-9 {
        width: 24px;
        height: 14px;
    }

    .ratio-label {
        font-size: 11px;
    }

    .ratio-description {
        font-size: 9px;
    }
}

@media (max-width: 400px) {
    .aspect-ratio-grid {
        grid-template-columns: 5fr;
        gap: 0;
    }

    .aspect-ratio-item {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        padding: 12px;
        gap: 12px;
    }

    .ratio-preview {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    /* Responsive aspect ratio tick icons removed */
}

/* ===================================================================
   9. GENERATE SECTION
   =================================================================== */

.re-prompts-generate-section {
    text-align: center;
    margin-top: 15px;
    margin-bottom: 20px;
}

.button {
    padding: 10px 30px !important;
}

.re-prompts-generate-section .button {
    border-radius: 50px;
    width: 100% !important;
    border: none;
    background-color: #EE4035;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.re-prompts-generate-section .button:hover {
    background-color: #FF9122 !important;
}

.re-prompts-generate-section .button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===================================================================
   10. RESULTS SECTION
   =================================================================== */

.re-prompts-results-section {
    margin-bottom: 30px;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e1e5e9;
}

.re-prompts-results-section h3 {
    margin-bottom: 15px;
}

.prompt-result {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
}

#re-prompts-result-text {
    padding-bottom: 5px !important;
    text-align: left !important;
}

.prompt-result .prompt-text {
    width: 100%;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Copy Messages */
.copy-message {
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.copy-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.copy-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Keep SREF styles interactive after generation */
.re-prompts-results-section ~ .re-prompts-sref-section {
    opacity: 1;
    pointer-events: auto;
}

.re-prompts-results-section ~ .re-prompts-sref-section h3::after {
    content: " (Click to modify)";
    color: #666;
}

/* Updating indicator */
.updating-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.updating-indicator .spinner {
    width: 16px;
    height: 16px;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.result-actions .button {
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-actions .button:hover {
    background: #f0f0f0;
    border-color: #0073aa;
}

.result-actions .button-primary {
    background: #000000;
    color: #fff;
    border-radius: 50px;
    border: none !important;
    font-weight: 400 !important;
    font-size: 15px !important;
}

.result-actions .button-primary:hover {
    background: #FF9122;
}

.result-actions .button-secondary {
    background: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

.result-actions .button-secondary:hover {
    background: #545b62;
}

.result-actions .button-link {
    background: none;
    border: none;
    color: #0073aa;
    text-decoration: underline;
    padding: 5px;
}

.result-actions .button-link:hover {
    color: #005a87;
}

/* Image Description */
.image-description {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.image-description h5 {
    margin: 0 0 10px 0;
}

.image-description p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

/* ===================================================================
   11. MESSAGES & LOADING
   =================================================================== */

/* Messages */
.re-prompts-messages {
    margin-top: 20px;
}

.re-prompts-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.re-prompts-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.re-prompts-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.re-prompts-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.re-prompts-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Upload Error Popup */
.upload-error-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.upload-error-popup.show {
    opacity: 1;
    visibility: visible;
}

.upload-error-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.upload-error-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.upload-error-popup.show .upload-error-popup-content {
    transform: translate(-50%, -50%) scale(1);
}

.upload-error-popup-header {
    background: #dc3545;
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.upload-error-popup-header i {
    font-size: 24px;
}

.upload-error-popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    flex: 1;
}

.upload-error-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.upload-error-popup-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.upload-error-popup-body {
    padding: 30px;
    text-align: center;
}

.upload-error-popup-body p {
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #333;
}

.upload-error-popup-body p:last-child {
    margin-bottom: 0;
}

.upload-error-popup-body .error-details {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
}

.upload-error-popup-body .error-details strong {
    color: #dc3545;
}

.upload-error-popup-footer {
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid #eee;
}

.upload-error-popup-ok {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.upload-error-popup-ok:hover {
    background: #005a87;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .upload-error-popup-content {
        width: 95%;
        margin: 20px;
    }

    .upload-error-popup-header {
        padding: 15px;
    }

    .upload-error-popup-header h3 {
        font-size: 18px;
    }

    .upload-error-popup-body {
        padding: 20px;
    }

    .upload-error-popup-footer {
        padding: 15px 20px;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===================================================================
   12. RESPONSIVE DESIGN
   =================================================================== */

/* Selection Tags Container Responsive */
@media (max-width: 768px) {
    .tags-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .tags-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .tags-container .style-item h5 {
        font-size: 11px;
    }
}

/* Large Desktop: 10 columns (1900px+) */
@media (max-width: 3200px) and (min-width: 1900px) {
    .prompt-styles-grid, .sref-v6-styles-grid, .sref-styles-grid { 
	    grid-template-columns: repeat(10, 2fr) !important;
	    gap:20px;
	}
	
	.tags-container {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px;
}
    
    .re-prompts-left-column { width: 25%;}
    .re-prompts-right-column { width: 75%;}  
}


/* Desktop: 7 columns (1280px - 1899px) */
@media (max-width: 1899px) and (min-width: 1280px) {
    .prompt-styles-grid, .sref-v6-styles-grid, .sref-styles-grid {
	    grid-template-columns: repeat(8, 1fr);
	    gap:20px;
	}
    
    
    .re-prompts-left-column {width: 25%;}
    .re-prompts-right-column { width: 75%;}
}


/* Small Desktop/Large Tablet: 5 columns (980px - 1279px) */
@media (max-width: 1279px) and (min-width: 980px) {
	
    .prompt-styles-grid, .sref-v6-styles-grid, .sref-styles-grid {
	    grid-template-columns: repeat(5, 1fr);
	    gap:20px;
	}
    
    
    .re-prompts-left-column {width: 30%;}
    .re-prompts-right-column {width: 70%;}
    
    .tab-nav .tab-button span,
    .category-radio-list .category-item span{ font-size: 12px !important;}
    
    
}

/* Tablet: 2 columns (780px - 979px) */
@media (max-width: 979px) and (min-width: 780px) {
    .prompt-styles-grid, .sref-v6-styles-grid, .sref-styles-grid {
	    grid-template-columns: repeat(4, 1fr);
	    gap:20px;   
    }
    
    .tags-container {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px;
}
    
    
}

/* Mobile: 1 column (below 780px) */
@media (max-width: 779px) {
    .prompt-styles-grid, .sref-v6-styles-grid,.sref-styles-grid { 
	    grid-template-columns: repeat(3, 1fr); 
	    gap:20px;
	}
	
	.tags-container {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px;
}
	
}

/* Mobile Layout Adjustments */
@media (max-width: 768px) {
    /* Stack columns on mobile */
    .re-prompts-layout { flex-direction: column; gap: 20px;}
    .re-prompts-left-column, .re-prompts-right-column { width: 100%; position: static; padding: 20px;}  
    .re-prompts-left-column{ padding-bottom: 0 !important;}
    .re-prompts-right-column{ padding-top: 0 !important;}

    /* Tab navigation on mobile */
    .tab-nav { flex-wrap: wrap;}

    .tab-button {
        flex: 1;
        min-width: 120px;
        padding: 12px 15px;
    }

    /* Aspect ratio grid on mobile */
    .aspect-ratio-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0;
    }

    .aspect-ratio-item {
        padding: 10px 6px;
    }

    .ratio-preview {
        width: 28px;
        height: 28px;
    }

    .ratio-1-1 {
        width: 28px;
        height: 28px;
    }

    .ratio-3-4 {
        width: 21px;
        height: 28px;
    }

    .ratio-4-3 {
        width: 28px;
        height: 21px;
    }

    .ratio-9-16 {
        width: 16px;
        height: 28px;
    }

    .ratio-16-9 {
        width: 28px;
        height: 16px;
    }

    .upload-preview img {
        max-width: 150px;
        max-height: 150px;
    }

    .result-actions {
        flex-direction: column;
        gap: 10px;
    }

    .result-actions .button {
        justify-content: center;
        width: 100%;
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    .aspect-ratio-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0;
    }

    .aspect-ratio-item {
        padding: 8px 4px;
    }

    .ratio-label {
        font-size: 11px;
    }

    .ratio-description {
        font-size: 9px;
    }
}

/* ===================================================================
   12. DARK THEME SUPPORT
   =================================================================== */

@media (prefers-color-scheme: dark) {
    .re-prompts-generator[data-theme="auto"] {
        color: #e0e0e0;
    }

    .re-prompts-generator[data-theme="auto"] .re-prompts-upload-area {
        background: #f3f2f8;
        border-color: #555;
    }

    .re-prompts-generator[data-theme="auto"] .style-item {
        background: #2a2a2a;
        color: #e0e0e0;
    }

    .re-prompts-generator[data-theme="auto"] .style-thumbnail img {
        border-color: #555;
    }

    .re-prompts-generator[data-theme="auto"] .re-prompts-selection-tags {
        background: #2a2a2a;
        border-color: #555;
    }

    .re-prompts-generator[data-theme="auto"] .selection-tags-group label {
        color: #e0e0e0;
    }

    .re-prompts-generator[data-theme="auto"] #re-prompts-remove-image {
        background: rgba(214, 54, 56, 0.9);
        border-color: rgba(255, 255, 255, 0.9);
    }

    .re-prompts-generator[data-theme="auto"] .sref-limit-warning {
        background: rgba(255, 193, 7, 0.15);
        border-color: rgba(255, 193, 7, 0.4);
        color: #ffc107;
    }

    .re-prompts-generator[data-theme="auto"] .sref-version-warning {
        background: rgba(220, 53, 69, 0.15);
        border-color: rgba(220, 53, 69, 0.4);
        color: #ff6b7a;
    }

    .re-prompts-generator[data-theme="auto"] .tab-counter {
        opacity: 0.7;
    }

    .re-prompts-generator[data-theme="auto"] .tab-button.active .tab-counter {
        opacity: 0.8;
    }

    .re-prompts-generator[data-theme="auto"] .style-item.selected {
        background: rgba(0, 115, 170, 0.15);
        border-color: #0073aa;
    }

    /* Theme-specific tick icons - for all right panel style types */
    .re-prompts-generator[data-theme="auto"] .re-prompts-styles-section .style-item[data-type="prompt"].selected::after,
    .re-prompts-generator[data-theme="auto"] .re-prompts-sref-section .style-item[data-type="sref"].selected::after,
    .re-prompts-generator[data-theme="auto"] .re-prompts-sref-v6-section .style-item[data-type="sref-v6"].selected::after {
        background: #0073aa;
    }

    .re-prompts-generator[data-theme="auto"] .re-prompts-results-section {
        background: #2c3338;
        border-color: #3c434a;
    }

    .re-prompts-generator[data-theme="auto"] .prompt-result {
        background: #2a2a2a;
    }

    .re-prompts-generator[data-theme="auto"] .prompt-result .prompt-text {
        background: #333;
        color: #e0e0e0;
    }

    .re-prompts-generator[data-theme="auto"] .copy-message.success {
        background-color: #1e3a2e;
        color: #4ade80;
        border-color: #2d5a3d;
    }

    .re-prompts-generator[data-theme="auto"] .copy-message.error {
        background-color: #3a1e1e;
        color: #f87171;
        border-color: #5a2d2d;
    }

    /* Upload Error Popup Dark Theme */
    .re-prompts-generator[data-theme="auto"] .upload-error-popup-content {
        background: #2d3748;
        color: #e2e8f0;
    }

    .re-prompts-generator[data-theme="auto"] .upload-error-popup-header {
        background: #e53e3e;
    }

    .re-prompts-generator[data-theme="auto"] .upload-error-popup-body p {
        color: #e2e8f0;
    }

    .re-prompts-generator[data-theme="auto"] .upload-error-popup-body .error-details {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }

    .re-prompts-generator[data-theme="auto"] .upload-error-popup-footer {
        border-top-color: #4a5568;
    }

    .re-prompts-generator[data-theme="auto"] .upload-error-popup-ok {
        background: #3182ce;
    }

    .re-prompts-generator[data-theme="auto"] .upload-error-popup-ok:hover {
        background: #2c5282;
    }
}
