/* ================================================
   Dashboard-Specific Styles
   ================================================ */

/* Prevent horizontal scroll */
.flex.min-h-screen {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Mode Switcher Tabs */
.mode-tab {
    background: transparent;
    color: #6b7280;
    border: none;
    cursor: pointer;
}

.mode-tab:hover {
    background: rgba(255, 255, 255, 0.03);
    color: white;
}

.mode-tab.active {
    background: linear-gradient(135deg, var(--cloy-neon), var(--cloy-neon-cyan));
    color: var(--cloy-dark);
    font-weight: 600;
}

/* Model Gender Tabs */
.model-gender-tab {
    background: transparent;
    color: #6b7280;
    border: 1px solid var(--cloy-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.model-gender-tab:hover {
    border-color: rgba(167, 243, 0, 0.3);
    color: white;
}

.model-gender-tab.active {
    background: var(--cloy-neon);
    color: var(--cloy-dark);
    border-color: var(--cloy-neon);
    font-weight: 600;
}

/* Model Cards */
.model-card {
    position: relative;
    transition: all 0.3s ease;
}

.model-card.selected {
    border-color: var(--cloy-neon) !important;
    box-shadow: 0 0 20px rgba(167, 243, 0, 0.3);
}

.model-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--cloy-neon);
    color: var(--cloy-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Radio Card Selection */
.radio-card input:checked+.radio-card-content {
    border-color: var(--cloy-neon);
    background: rgba(167, 243, 0, 0.05);
}

.radio-card input:checked+.radio-card-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(167, 243, 0, 0.1), transparent);
    border-radius: 0.75rem;
}

.radio-card-content {
    position: relative;
}

/* Clothing Type Cards */
.clothing-type-card input:checked+.clothing-card-content {
    border-color: var(--cloy-neon);
    background: rgba(167, 243, 0, 0.05);
}

.clothing-type-card input:checked+.clothing-card-content::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--cloy-neon);
    color: var(--cloy-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.clothing-card-content {
    position: relative;
}

/* Upload Area Drag States */
.upload-area-dragging {
    border-color: var(--cloy-neon) !important;
    background: rgba(167, 243, 0, 0.05);
}

/* Results Grid */
.result-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--cloy-card);
    border: 1px solid var(--cloy-border);
    transition: all 0.3s ease;
}

.result-card:hover {
    border-color: rgba(167, 243, 0, 0.3);
    transform: scale(1.02);
}

.result-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.result-card:hover .result-card-overlay {
    opacity: 1;
}

.result-card-actions {
    display: flex;
    gap: 0.5rem;
}

.result-card-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-card-btn:hover {
    background: var(--cloy-neon);
    border-color: var(--cloy-neon);
    color: var(--cloy-dark);
}

/* Wizard Steps for Catalog Mode */
.wizard-step {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.8), rgba(18, 18, 26, 0.4));
    border: 1px solid var(--cloy-border);
    border-radius: 1.5rem;
    margin-bottom: 1.5rem;
}

.wizard-step-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.wizard-step-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cloy-neon);
    color: var(--cloy-dark);
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border-radius: 50%;
    flex-shrink: 0;
}

.wizard-step-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
}

.wizard-step-info p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Sticky Footer for Wizard Steps */
.wizard-sticky-footer {
    position: sticky;
    bottom: 0;
    padding: 1.5rem 0;
    background: linear-gradient(to top, var(--cloy-dark), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

/* Batch Type Selector */
.batch-type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.batch-type-card {
    padding: 1.5rem;
    background: var(--cloy-dark);
    border: 2px solid var(--cloy-border);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.batch-type-card:hover {
    border-color: rgba(167, 243, 0, 0.3);
}

.batch-type-card.active {
    border-color: var(--cloy-neon);
    background: rgba(167, 243, 0, 0.05);
}

/* Summary Box */
.summary-box {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(167, 243, 0, 0.1), rgba(0, 212, 255, 0.1));
    border: 1px solid rgba(167, 243, 0, 0.2);
    border-radius: 1rem;
    margin-top: 1.5rem;
}

.summary-box h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--cloy-neon);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    color: #9ca3af;
}

.summary-value {
    color: white;
    font-weight: 600;
}

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 8, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.processing-content {
    text-align: center;
    max-width: 400px;
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--cloy-border);
    border-top-color: var(--cloy-neon);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.processing-progress {
    width: 100%;
    height: 4px;
    background: var(--cloy-border);
    border-radius: 2px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.processing-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cloy-neon), var(--cloy-neon-cyan));
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--cloy-card);
    border: 1px solid var(--cloy-border);
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 200;
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-notification.success {
    border-color: var(--cloy-neon);
}

.toast-notification.success svg {
    color: var(--cloy-neon);
}

.toast-notification.error {
    border-color: #ef4444;
}

.toast-notification.error svg {
    color: #ef4444;
}

/* Model Card Enhancements */
.model-card .preview-btn {
    z-index: 10;
}

.model-card:hover .preview-btn {
    opacity: 1;
}

/* Modal Animations */
#modelPreviewModal,
#imagePreviewModal {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#modelPreviewModal>div:last-child>div,
#imagePreviewModal>div:last-child>div {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Improved Result Card */
.result-card {
    cursor: pointer;
}

.result-card:hover {
    box-shadow: 0 10px 40px rgba(167, 243, 0, 0.1);
}

/* Loading Animation for Credits */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Upload Area Active State */
.upload-area-dragging,
#clothingUploadArea:focus-within,
#secondClothingUploadArea:focus-within {
    border-color: var(--cloy-neon) !important;
    background: rgba(167, 243, 0, 0.02);
}

/* Preview Container Styles */
#clothingPreview .relative,
#secondClothingPreview .relative {
    max-height: 250px;
}

#clothingPreview img,
#secondClothingPreview img {
    max-height: 200px;
    object-fit: contain;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .model-card .preview-btn {
        opacity: 1;
        background: rgba(0, 0, 0, 0.7);
    }

    #modelPreviewModal>div:last-child>div {
        max-height: 100vh;
        border-radius: 0;
    }

    .result-card-overlay {
        opacity: 1;
    }
}

/* ================================================
   Catalog Mode Styles
   ================================================ */

/* Catalog Model Card */
.catalog-model-card {
    position: relative;
}

.catalog-model-card.border-cloy-neon {
    box-shadow: 0 0 20px rgba(167, 243, 0, 0.2);
}

/* Catalog checkbox styling */
.catalog-model-card label {
    transition: all 0.2s ease;
}

.catalog-model-card:hover label {
    transform: scale(1.1);
}

/* Wizard Step card */
.wizard-step {
    transition: all 0.3s ease;
}

/* Catalog Upload Area */
#catalogUploadArea {
    min-height: 200px;
}

#catalogUploadArea.border-cloy-neon {
    box-shadow: 0 0 30px rgba(167, 243, 0, 0.1);
}

/* Uploaded Files Grid */
#uploadedFilesGrid>div {
    transition: all 0.3s ease;
}

#uploadedFilesGrid>div:hover {
    border-color: rgba(167, 243, 0, 0.5);
    transform: translateY(-2px);
}

/* Matching Rows */
.matching-select {
    min-width: 150px;
}

/* Pagination Button Styling */
.pagination-btn {
    transition: all 0.2s ease;
}

.pagination-btn:not(:disabled):hover {
    border-color: var(--cloy-neon);
    color: white;
}

/* Catalog Processing Overlay */
#catalogProcessingOverlay {
    animation: fadeIn 0.3s ease-out;
}

/* Config Areas */
.config-area {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Summary Box Glow Effect */
#summaryBox {
    position: relative;
    overflow: hidden;
}

#summaryBox::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(167, 243, 0, 0.05) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

/* Sticky Footer for wizard steps */
.wizard-step .sticky {
    z-index: 10;
    margin: 0 -1.5rem -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-radius: 0 0 1rem 1rem;
}

/* ================================================
   Product Photography Mode Styles
   ================================================ */

/* Product Upload Area */
#productImageUploadArea {
    min-height: 180px;
}

#productImageUploadArea.border-cloy-neon {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.1);
}

/* Product Images Preview Grid */
#productImagesPreview>div {
    animation: fadeIn 0.3s ease-out;
}

#productImagesPreview img {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Product Preview Container */
#productPreviewContainer {
    min-height: 300px;
}

/* Product Processing Overlay */
#productProcessingOverlay {
    animation: fadeIn 0.3s ease-out;
}

#productProcessingOverlay .animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Reference Image Preview */
#referenceImagePreview img {
    max-height: 128px;
    object-fit: contain;
}

/* Custom Prompt Textarea */
#customPromptTextarea {
    min-height: 100px;
}

#customPromptTextarea:focus {
    border-color: var(--cloy-neon);
    outline: none;
    box-shadow: 0 0 0 2px rgba(167, 243, 0, 0.1);
}

/* Radio card selected state for product mode */
.radio-card input:checked+.radio-card-content {
    border-color: var(--cloy-neon);
    box-shadow: 0 0 20px rgba(167, 243, 0, 0.1);
}

/* Beta notice styling */
#productMode .bg-purple-500\/10 {
    animation: subtlePulse 3s ease-in-out infinite;
}

@keyframes subtlePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* ================================================
   Edit Page Styles
   ================================================ */

/* Edit Processing Overlay */
#editProcessingOverlay {
    animation: fadeIn 0.3s ease-out;
}

/* Gallery Picker Modal */
#galleryPickerModal {
    animation: fadeIn 0.3s ease-out;
}

#galleryPickerModal .grid>div {
    transition: all 0.2s ease;
}

#galleryPickerModal .grid>div:hover {
    transform: scale(1.02);
}

/* Result Modal */
#editResultModal {
    animation: fadeIn 0.3s ease-out;
}

/* Color Picker Grid */
.grid.grid-cols-6 button {
    transition: all 0.2s ease;
}

.grid.grid-cols-6 button:hover {
    transform: scale(1.1);
}

/* Slider Styling for Edit Page */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--cloy-neon);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(167, 243, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--cloy-neon);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Image Preview Area */
#imagePreviewArea img {
    transition: all 0.3s ease;
}

#imagePreviewArea:hover img {
    filter: brightness(0.95);
}

/* Change Image Button */
#changeImageBtn {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#imagePreviewArea:hover #changeImageBtn {
    opacity: 1;
}

/* Tool Tab Animation */
.tool-tab {
    transition: all 0.2s ease;
}

/* Position Grid Buttons */
.grid.grid-cols-3.gap-2 button {
    min-height: 40px;
}

/* ================================================
   Pose Gallery Styles (Model Preview Modal)
   ================================================ */

/* Pose thumbnail styling */
.pose-thumbnail {
    transition: all 0.2s ease;
    background: var(--cloy-dark);
}

.pose-thumbnail:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.pose-thumbnail.active,
.pose-thumbnail.border-cloy-neon {
    box-shadow: 0 0 15px rgba(167, 243, 0, 0.3);
}

/* Pose gallery grid responsive */
#poseGalleryGrid {
    max-height: 50vh;
}

@media (min-width: 768px) {
    #poseGalleryGrid {
        max-height: none;
    }
}

/* Pose gallery scrollbar styling */
#poseGallery::-webkit-scrollbar {
    width: 6px;
}

#poseGallery::-webkit-scrollbar-track {
    background: var(--cloy-dark);
    border-radius: 3px;
}

#poseGallery::-webkit-scrollbar-thumb {
    background: var(--cloy-border);
    border-radius: 3px;
}

#poseGallery::-webkit-scrollbar-thumb:hover {
    background: rgba(167, 243, 0, 0.5);
}

/* Mobile adjustments for pose gallery modal */
@media (max-width: 768px) {
    #modelPreviewModal>div:last-child>div {
        max-height: 95vh;
        display: flex;
        flex-direction: column;
    }

    #modelPreviewModal .flex-1.flex.flex-col.md\\:flex-row {
        flex-direction: column;
        overflow: hidden;
    }

    /* Reduce preview size on mobile for more pose space */
    #modelPreviewModal .flex-1.p-4 {
        flex: 0 0 auto;
        max-height: 40vh;
    }

    /* Show more poses on mobile in horizontal scroll */
    #poseGalleryGrid {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(70px, 1fr));
        gap: 8px;
        max-height: 25vh;
        overflow-y: auto;
    }
}