@import url('asset_forge_new.css');
@import url('studio_auto.css');

/* Category Badge Styles */
.category-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 12px;
    background: var(--accent-primary);
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge.categorizing {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.asset-category {
    margin-top: 4px;
}

.asset-category-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 0.6rem;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    pointer-events: none;
}

/* Generation Quantity Selector */
.generation-quantity-selector {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.quantity-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 90px;
    position: relative;
    overflow: hidden;
}

.quantity-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.quantity-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
}

.quantity-option:hover::before {
    opacity: 0.1;
}

.quantity-option.active {
    background: #D0BB95;
    border-color: #D0BB95;
    box-shadow: 0 8px 25px rgba(208, 187, 149, 0.4);
    transform: translateY(-2px);
}

.quantity-option.active .quantity-number,
.quantity-option.active .quantity-label {
    color: #1d1a15;
    font-weight: 700;
}

.quantity-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    color: var(--text-main);
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.quantity-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.generation-quantity-section {
    animation: fade-in-up 0.5s ease-out;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Studio Layout */
#canvas-mode-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.studio-layout {
    display: flex;
    flex-direction: column;
    order: 1;
}

/* Vertical layout for 9:16 and 1:1 - sidebar next to canvas */
.studio-layout.layout-vertical #canvas-mode-container {
    flex-direction: row;
}

.studio-layout.layout-vertical .studio-sidebar {
    width: 300px;
    flex-direction: column;
    flex-shrink: 0;
}

.studio-layout.layout-vertical .canvas-area {
    flex: 1;
}

/* Make Available Elements take full height in vertical layout */
.studio-layout.layout-vertical .studio-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.studio-layout.layout-vertical .studio-sidebar .asset-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.studio-layout.layout-vertical #available-assets-list {
    max-height: none !important;
    flex: 1;
    overflow-y: auto;
}

.studio-sidebar {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: var(--spacing-md);
    flex-shrink: 0;

    /* Inherit the Asset Forge color scheme */
    --forge-bg: #1d1a15;
    --forge-panel: #2D2A32;
    --forge-primary: #D0BB95;
    --forge-primary-hover: #D6683F;
    --forge-text: #ffffff;
    --forge-text-muted: #a0a0a0;
    --forge-border: rgba(255, 255, 255, 0.05);
}

/* Style forge panels within studio sidebar */
.studio-sidebar .forge-elements-panel {
    background: var(--forge-panel);
    border: 1px solid var(--forge-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.studio-sidebar .elements-panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--forge-border);
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.studio-sidebar .elements-panel-header h3 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--forge-text-muted);
    display: flex;
    align-items: center;
}

/* Form field styling for studio */
.studio-sidebar .form-field label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--forge-text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: block;
}

.studio-sidebar .form-field select {
    width: 100%;
    background: var(--forge-bg);
    border: 1px solid var(--forge-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--forge-text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.studio-sidebar .form-field select:focus {
    outline: none;
    border-color: var(--forge-primary);
    box-shadow: 0 0 0 2px rgba(208, 187, 149, 0.2);
}

/* Select wrapper with custom arrow */
.studio-sidebar .select-wrapper {
    position: relative;
    display: block;
}

.studio-sidebar .select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
    cursor: pointer;
}

.studio-sidebar .select-wrapper .select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--forge-text-muted);
    pointer-events: none;
    font-size: 20px;
}

/* Category filter dropdown in header - compact version */
.studio-sidebar .elements-panel-header .form-field {
    margin: 0;
}

.studio-sidebar .elements-panel-header .form-field select {
    padding: 8px 36px 8px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.studio-sidebar .elements-panel-header .select-arrow {
    font-size: 18px;
    right: 10px;
}

/* Studio assets grid - limited to 2 rows */
.studio-assets-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: flex-start;
}

.studio-assets-grid .asset-thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: var(--forge-bg);
}

.studio-assets-grid .asset-thumb:hover {
    border-color: var(--forge-primary);
    transform: scale(1.05);
}

.studio-assets-grid .asset-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-panel {
    background-color: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ai-message {
    background-color: rgba(255, 255, 255, 0.05);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    border-left: 3px solid var(--accent-secondary);
}

.prompt-input {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    width: 100%;
    box-sizing: border-box;
    resize: none;
    font-family: inherit;
}

.prompt-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.canvas-area {
    background-color: #121418;
    /* Slightly darker for contrast */
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    margin: 0 auto;
    width: 900px !important;
    height: 506px !important;
    min-height: 506px !important;
    max-height: none !important;
    flex-shrink: 0;
    /* Default 16:9 (900 * 9/16) */
    transition: all 0.3s ease;
}

/* Aspect ratio variations */
.canvas-area.aspect-1-1 {
    width: auto !important;
    height: auto !important;
    min-height: auto !important;
    max-height: 85vh !important;
    max-width: 85vh !important;
    aspect-ratio: 1 / 1 !important;
}

.canvas-area.aspect-9-16 {
    width: auto !important;
    height: auto !important;
    min-height: auto !important;
    max-height: 85vh !important;
    max-width: calc(110vh * 9 / 16) !important;
    aspect-ratio: 9 / 16 !important;
}

.canvas-area.aspect-16-9 {
    width: 900px !important;
    height: 506px !important;
    min-height: 506px !important;
}

/* Full width for 16:9 in horizontal layout */
.studio-layout.layout-horizontal .canvas-area.aspect-16-9 {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    aspect-ratio: 16 / 9 !important;
}

.canvas-element {
    position: absolute;
    cursor: grab;
    user-select: none;
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.canvas-element:hover {
    border-color: var(--accent-secondary);
    z-index: 10;
}

.canvas-element:active {
    cursor: grabbing;
}

.element-content {
    width: 100%;
    height: 100%;
}

.canvas-element img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    /* Prevent image drag default */
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Canvas Interactivity Styles */
.canvas-element.selected {
    z-index: 1000 !important;
    /* Bring to front when selected */
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent-primary);
    border: 1px solid #fff;
    border-radius: 50%;
    pointer-events: auto;
    /* Enable interaction */
}

.resize-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.btn-options {
    position: absolute;
    top: -30px;
    right: 0;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    pointer-events: auto;
    font-weight: bold;
    box-shadow: var(--shadow-soft);
}

.btn-options:hover {
    background: var(--bg-panel);
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 4px 0;
    z-index: 2000;
    min-width: 150px;
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.context-menu-item.delete {
    color: #ff4757;
}

.context-menu-item.delete:hover {
    background-color: rgba(255, 71, 87, 0.1);
}

/* Re-invent Feature Styles */
.custom-context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 4px 0;
    z-index: 2000;
    min-width: 150px;
}

.highlight-fancy {
    box-shadow: 0 0 15px var(--accent-primary), 0 0 30px var(--accent-secondary);
    border-color: var(--accent-primary) !important;
    transition: all 0.3s ease;
    z-index: 1000 !important;
}

.reinvent-prompt-box {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-soft);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 250px;
}

.reinvent-header {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--accent-secondary);
}

.reinvent-input {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.reinvent-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.reinvent-buttons button {
    padding: 4px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
}

.reinvent-buttons .btn-submit {
    background: var(--accent-primary);
    color: white;
}

.reinvent-buttons .btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.element-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: var(--radius-sm);
}

.element-loader .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
}

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

.reinvent-actions {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2002;
    background: var(--bg-card);
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.reinvent-actions button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.reinvent-actions button:hover {
    transform: scale(1.2);
}

.sub-assets-indicator {
    position: absolute;
    top: 0px;
    right: 0px;
    background: var(--accent-primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* Cool & Fancy Dropdown */
.fancy-dropdown {
    position: fixed;
    background: rgba(30, 30, 40, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    min-width: 180px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    z-index: 9999;
    animation: dropdown-fade-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: top right;
}

@keyframes dropdown-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

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

.fancy-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.fancy-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(2px);
}

.fancy-dropdown-item.reinvent {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), rgba(255, 100, 200, 0.1));
    background: linear-gradient(135deg, #FFD700, #FF64C8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fancy-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* Reinvent Modal Styles */
.reinvent-content {
    max-width: 800px;
    width: 90%;
    background: #1e1e24;
    /* Darker background */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.reinvent-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.reinvent-image-preview {
    flex: 1;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 200px;
}

.reinvent-image-preview img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.reinvent-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.fancy-textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-main);
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
}

.fancy-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2);
}

.reinvent-btn-container {
    position: static;
    transform: none;
    width: auto;
    align-self: flex-end;
    margin-top: auto;
    padding: 8px 24px;
    font-size: 0.9rem;
}

.reinvent-btn-container:hover {
    transform: none;
    box-shadow: 0 15px 30px rgba(108, 92, 231, 0.4);
}

/* Reinvent Error Message */
.reinvent-error-message {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.95), rgba(30, 30, 40, 0.98));
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 100, 100, 0.1) inset;
    animation: error-slide-up 0.3s ease-out, error-fade-out 0.5s ease-in 7.5s forwards;
    z-index: 100;
}

.reinvent-error-message .error-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.reinvent-error-message .error-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reinvent-error-message .error-text strong {
    color: #ff8a8a;
    font-size: 0.95rem;
    font-weight: 600;
}

.reinvent-error-message .error-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

@keyframes error-slide-up {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes error-fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@media (max-width: 600px) {
    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    .reinvent-actions {
        position: absolute;
        bottom: -40px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 10px;
        z-index: 2002;
        background: var(--bg-card);
        padding: 5px 10px;
        border-radius: 20px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        border: 1px solid var(--border-color);
    }

    .reinvent-actions button {
        background: none;
        border: none;
        font-size: 1.2rem;
        cursor: pointer;
        transition: transform 0.2s;
    }

    .reinvent-actions button:hover {
        transform: scale(1.2);
    }

    .sub-assets-indicator {
        position: absolute;
        top: 0px;
        right: 0px;
        background: var(--accent-primary);
        color: white;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        font-size: 0.7rem;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 5;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        pointer-events: none;
    }

    /* Cool & Fancy Dropdown */
    .fancy-dropdown {
        position: fixed;
        background: rgba(30, 30, 40, 0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        padding: 8px;
        min-width: 180px;
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(255, 255, 255, 0.05) inset;
        z-index: 9999;
        animation: dropdown-fade-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
        transform-origin: top right;
    }

    @keyframes dropdown-fade-in {
        from {
            opacity: 0;
            transform: scale(0.95) translateY(-10px);
        }

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

    .fancy-dropdown-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 8px;
        color: #e0e0e0;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
        overflow: hidden;
    }

    .fancy-dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        transform: translateX(2px);
    }

    .fancy-dropdown-item.reinvent {
        background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), rgba(255, 100, 200, 0.1));
        background: linear-gradient(135deg, #FFD700, #FF64C8);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .fancy-dropdown-divider {
        height: 1px;
        background: rgba(255, 255, 255, 0.1);
        margin: 4px 0;
    }

    /* Reinvent Modal Styles */
    .reinvent-content {
        max-width: 800px;
        width: 90%;
        background: #1e1e24;
        /* Darker background */
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .reinvent-layout {
        display: flex;
        gap: 20px;
        margin-top: 20px;
    }

    .reinvent-image-preview {
        flex: 1;
        background: #000;
        border-radius: 8px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.1);
        min-height: 200px;
    }

    .reinvent-image-preview img {
        max-width: 100%;
        max-height: 300px;
        object-fit: contain;
    }

    .reinvent-form {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .input-label {
        color: var(--text-muted);
        font-size: 0.9rem;
        font-weight: 500;
    }

    .fancy-textarea {
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 12px;
        color: var(--text-main);
        font-family: inherit;
        resize: vertical;
        transition: all 0.2s;
    }

    .fancy-textarea:focus {
        outline: none;
        border-color: var(--accent-primary);
        background: rgba(0, 0, 0, 0.5);
        box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2);
    }

    .reinvent-btn-container {
        position: static;
        transform: none;
        width: auto;
        align-self: flex-end;
        margin-top: auto;
        padding: 8px 24px;
        font-size: 0.9rem;
    }

    .reinvent-btn-container:hover {
        transform: none;
        box-shadow: 0 15px 30px rgba(108, 92, 231, 0.4);
    }

    @media (max-width: 600px) {
        .reinvent-layout {
            flex-direction: column;
        }
    }
}

.reinvent-actions {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2002;
    background: var(--bg-card);
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.reinvent-actions button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.reinvent-actions button:hover {
    transform: scale(1.2);
}

.sub-assets-indicator {
    position: absolute;
    top: 0px;
    right: 0px;
    background: var(--accent-primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* Cool & Fancy Dropdown */
.fancy-dropdown {
    position: fixed;
    background: rgba(30, 30, 40, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    min-width: 180px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    z-index: 9999;
    animation: dropdown-fade-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: top right;
}

@keyframes dropdown-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

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

.fancy-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.fancy-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(2px);
}

.fancy-dropdown-item.reinvent {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), rgba(255, 100, 200, 0.1));
    background: linear-gradient(135deg, #FFD700, #FF64C8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fancy-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* Reinvent Modal Styles */
.reinvent-content {
    max-width: 800px;
    width: 90%;
    background: #1e1e24;
    /* Darker background */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.reinvent-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.reinvent-image-preview {
    flex: 1;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 200px;
}

.reinvent-image-preview img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.reinvent-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.fancy-textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-main);
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
}

.fancy-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2);
}

.reinvent-btn-container {
    position: static;
    transform: none;
    width: auto;
    align-self: flex-end;
    margin-top: auto;
    padding: 8px 24px;
    font-size: 0.9rem;
}

.reinvent-btn-container:hover {
    transform: none;
    box-shadow: 0 15px 30px rgba(108, 92, 231, 0.4);
}

@media (max-width: 600px) {
    .reinvent-layout {
        flex-direction: column;
    }
}

.reinvent-actions {
    bottom: 20px !important;
}

/* Modal Button Styles */
.btn-close-modal {
    padding: 8px 20px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 20px;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.btn-insert-canvas {
    width: 100%;
    margin-top: 10px;
    font-size: 0.6rem;
    padding: 10px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

.btn-insert-canvas:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.5);
    filter: brightness(1.1);
}

.btn-insert-canvas:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(108, 92, 231, 0.3);
}

/* ========================================
   TEXT FEATURE STYLES
   ======================================== */

/* Add Text Button */
.add-text-btn {
    position: absolute;
    bottom: 100px;
    right: 20px;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.4);
    transition: all 0.3s ease;
    z-index: 100;
}

.add-text-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 210, 255, 0.6);
    filter: brightness(1.1);
}

.add-text-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
}

.add-text-btn span {
    font-size: 1.2rem;
}

/* Text Element on Canvas */
.text-element .element-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.text-content {
    color: #ffffff;
    font-size: 24px;
    font-weight: normal;
    font-style: normal;
    text-align: center;
    user-select: none;
    word-wrap: break-word;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
}

.canvas-element.text-element {
    background: transparent;
    min-width: 100px;
    min-height: 50px;
}

.canvas-element.text-element:hover {
    border-color: rgba(0, 210, 255, 0.6);
    background: rgba(0, 210, 255, 0.05);
}

/* Text Editor Modal */
.text-editor-content {
    max-width: 600px;
    width: 90%;
    background: #1e1e24;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.text-editor-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.text-input-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Formatting Controls */
.text-formatting-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 80px;
}

.format-select {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.format-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2);
}

.format-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Color Picker */
.color-picker-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input {
    width: 50px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    transition: all 0.2s;
}

.color-input:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.color-value {
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Style Buttons */
.style-buttons {
    flex: 1;
    display: flex;
    gap: 10px;
}

.style-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-dark);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.style-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.style-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.5);
}

.style-btn strong,
.style-btn em {
    font-style: normal;
    font-weight: normal;
}

.style-btn#text-bold-btn strong {
    font-weight: bold;
}

.style-btn#text-italic-btn em {
    font-style: italic;
}

/* Text Editor Actions */
.text-editor-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 10px;
}

.text-editor-actions .btn-primary,
.text-editor-actions .btn-secondary {
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.text-editor-actions .btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.text-editor-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(108, 92, 231, 0.5);
}

.text-editor-actions .btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.text-editor-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

/* Responsive Text Editor */
@media (max-width: 600px) {
    .text-editor-content {
        width: 95%;
        max-width: none;
    }

    .control-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .control-label {
        min-width: auto;
    }

    .format-select,
    .color-picker-wrapper,
    .style-buttons {
        width: 100%;
    }
}

/* Add Text Icon - Top Right Corner */
.add-text-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    color: #6b7280;
    border: none;
    padding: 8px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    font-weight: 700;
    font-family: monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.2s ease;
    z-index: 100;
    border-radius: 4px;
}

.add-text-icon:hover {
    opacity: 1;
    background: rgba(107, 114, 128, 0.1);
    color: #9ca3af;
}

.add-text-icon:active {
    transform: scale(0.95);
}

.add-text-icon .material-symbols-outlined {
    font-size: 20px;
}

/* Theme Toggle Icon - Top Right Corner */
.theme-toggle-icon {
    position: absolute;
    top: 60px;
    right: 10px;
    background: transparent;
    color: #6b7280;
    border: none;
    padding: 8px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.2s ease;
    z-index: 100;
    border-radius: 4px;
}

.theme-toggle-icon:hover {
    opacity: 1;
    background: rgba(107, 114, 128, 0.1);
    transform: scale(1.1);
}

.theme-toggle-icon:active {
    transform: scale(0.95);
}

.theme-toggle-icon .material-symbols-outlined {
    font-size: 20px;
}

/* Canvas Action Icons (Undo/Redo) */
.canvas-action-icon {
    position: absolute;
    right: 10px;
    background: transparent;
    color: #6b7280;
    border: none;
    padding: 8px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.2s ease;
    z-index: 100;
    border-radius: 4px;
}

.canvas-action-icon:hover {
    opacity: 1;
    background: rgba(107, 114, 128, 0.1);
    color: #9ca3af;
}

.canvas-action-icon:active {
    transform: scale(0.95);
}

.canvas-action-icon:disabled {
    opacity: 0.15;
    cursor: not-allowed;
}

.canvas-action-icon:disabled:hover {
    background: transparent;
    color: #6b7280;
}

#btn-undo {
    top: 110px;
}

#btn-redo {
    top: 160px;
}

.canvas-action-icon .material-icons,
.canvas-action-icon .material-symbols-outlined {
    font-size: 20px;
}

/* Canvas theme states */
.canvas-area.dark-mode {
    background-color: #1a1a1a;
}

.canvas-area.light-mode {
    background-color: #f5f5f5;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

/* Vertical scrolling for available assets */
#available-assets-list {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) rgba(255, 255, 255, 0.1);
}

#available-assets-list::-webkit-scrollbar {
    width: 8px;
}

#available-assets-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

#available-assets-list::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

#available-assets-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Ensure asset previews don't shrink in layout */
#available-assets-list .asset-preview {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}


/* ========================================
   CROP MODAL STYLES
   ======================================== */

.crop-modal-content {
    max-width: 800px;
    width: 90%;
    background: #1e1e24;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.crop-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.crop-preview-container {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 400px;
    max-height: 500px;
}

.crop-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
}

.crop-image-wrapper img {
    display: block;
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
    user-select: none;
}

.crop-box {
    position: absolute;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    min-width: 50px;
    min-height: 50px;
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 10;
}

.crop-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.crop-handle.ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.crop-handle.sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.crop-handle.se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.crop-dimensions {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.crop-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Asset Selection Styles */
.asset-preview.selected {
    border: 3px solid var(--accent-primary) !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5) !important;
}

.selection-checkmark {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Auto Mode Specific Button Styles */
.auto-mode-btn {
    position: static !important;
    bottom: auto !important;
    right: auto !important;
    display: inline-flex;
    background: #D0BB95;
    color: #1d1a15;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(208, 187, 149, 0.3);
    transition: all 0.2s ease;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.auto-mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(208, 187, 149, 0.4);
    background: #D6683F;
    color: #fff;
}

.auto-mode-btn:active {
    transform: translateY(0);
}

.auto-mode-btn .material-symbols-outlined {
    font-size: 20px;
}

.auto-mode-btn-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 20px 0;
}

/* ========================================
   ASSET FORGE STYLES
   ======================================== */

.asset-forge-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 30px;
}

.forge-header {
    text-align: center;
    margin-bottom: 40px;
}

.forge-title-row {
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 15px;
    margin-bottom: 10px;
}

.forge-icon {
    font-size: 2.5rem;
    animation: forge-glow 2s ease-in-out infinite;
}

@keyframes forge-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(108, 92, 231, 0.6));
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(108, 92, 231, 0.9));
    }
}

.forge-header h2 {
    margin: 0;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.forge-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

/* Identified Panel - Glassmorphism */
.identified-panel {
    background: rgba(24, 27, 33, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.identified-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(108, 92, 231, 0.5), transparent);
}

.identified-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}

.identified-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-main);
}

.sparkle-icon {
    font-size: 1.5rem;
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.2) rotate(15deg);
    }
}

.badge-doc {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(0, 206, 201, 0.2));
    border: 1px solid rgba(108, 92, 231, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--accent-secondary);
    margin-left: auto;
}

.identified-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.identified-column {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 20px;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    color: var(--text-main);
}

.column-icon {
    font-size: 1.2rem;
}

.forge-elements-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Element Cards with Glow */
.forge-element-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(34, 38, 46, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 20px 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.forge-element-card:hover {
    transform: translateX(5px);
    border-color: var(--accent-primary);
    background: rgba(108, 92, 231, 0.1);
}

.forge-element-card:hover .element-glow {
    opacity: 1;
}

.element-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.element-icon {
    font-size: 1.1rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    flex-shrink: 0;
}

.element-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.element-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.2;
}

.element-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.forge-element-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.8);
}

.forge-element-card:hover .forge-element-btn {
    opacity: 1;
    transform: scale(1);
}

.forge-element-btn:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.5);
}

/* Empty State */
.identified-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.identified-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Divider */
.forge-divider {
    display: flex;
    align-items: center;
    margin: 40px 0;
}

.forge-divider::before,
.forge-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.divider-text {
    padding: 0 25px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Action Cards Grid */
.forge-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    max-width: 800px;
    margin: 0 auto;
}

.forge-action-card {
    position: relative;
    border-radius: 20px;
    padding: 40px 30px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.forge-action-card.character-card {
    background: linear-gradient(145deg, rgba(108, 92, 231, 0.15), rgba(108, 92, 231, 0.05));
    border-color: rgba(108, 92, 231, 0.3);
}

.forge-action-card.item-card {
    background: linear-gradient(145deg, rgba(0, 206, 201, 0.15), rgba(0, 206, 201, 0.05));
    border-color: rgba(0, 206, 201, 0.3);
}

.action-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.character-card .action-card-bg {
    background: linear-gradient(145deg, rgba(108, 92, 231, 0.3), rgba(108, 92, 231, 0.1));
}

.item-card .action-card-bg {
    background: linear-gradient(145deg, rgba(0, 206, 201, 0.3), rgba(0, 206, 201, 0.1));
}

.forge-action-card:hover .action-card-bg {
    opacity: 1;
}

.forge-action-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.character-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(108, 92, 231, 0.3);
}

.item-card:hover {
    border-color: var(--accent-secondary);
    box-shadow: 0 20px 40px rgba(0, 206, 201, 0.3);
}

.action-card-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.action-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.character-card .action-icon-wrapper {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.3), rgba(108, 92, 231, 0.1));
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.2);
}

.item-card .action-icon-wrapper {
    background: linear-gradient(135deg, rgba(0, 206, 201, 0.3), rgba(0, 206, 201, 0.1));
    box-shadow: 0 8px 20px rgba(0, 206, 201, 0.2);
}

.forge-action-card:hover .action-icon-wrapper {
    transform: scale(1.1);
}

.action-icon {
    font-size: 2.5rem;
}

.action-card-content h3 {
    margin: 0 0 10px;
    font-size: 1.3rem;
    color: var(--text-main);
}

.action-card-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.action-arrow {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 1.5rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.character-card .action-arrow {
    color: var(--accent-primary);
}

.item-card .action-arrow {
    color: var(--accent-secondary);
}

.forge-action-card:hover .action-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Card Shimmer Effect */
.card-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.forge-action-card:hover .card-shimmer {
    left: 100%;
}

/* Forge Studio Panel */
.forge-studio-panel {
    background: rgba(24, 27, 33, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin-top: 40px;
    overflow: hidden;
    animation: slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.studio-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(90deg, rgba(108, 92, 231, 0.1), transparent);
}

.studio-panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-main);
}

.studio-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.studio-close-btn:hover {
    background: rgba(255, 71, 87, 0.2);
    border-color: rgba(255, 71, 87, 0.5);
    color: #ff4757;
}

.studio-panel-content {
    padding: 30px;
}

.studio-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.type-toggle {
    display: flex;
    gap: 10px;
}

.type-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

.type-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.type-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    color: #000;
    font-weight: 600;
}

.studio-form input,
.studio-form textarea,
.studio-form select {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.studio-form input:focus,
.studio-form textarea:focus,
.studio-form select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.studio-form textarea {
    resize: vertical;
    min-height: 100px;
}

.studio-form select {
    cursor: pointer;
}

/* Forge Generate Button */
.forge-generate-btn {
    position: relative;
    padding: 18px 40px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    font-family: inherit;
    margin-top: 10px;
}

.forge-generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(108, 92, 231, 0.4);
}

.forge-generate-btn:active {
    transform: translateY(-1px);
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.forge-generate-btn:hover .btn-glow {
    width: 300px;
    height: 300px;
}

.btn-text {
    position: relative;
    z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .identified-grid {
        grid-template-columns: 1fr;
    }

    .forge-actions-grid {
        grid-template-columns: 1fr;
    }

    .asset-forge-container {
        padding: 20px 15px;
    }
}

/* ========================================
   ASSET FORGE DOCUMENT ANALYSIS STYLES
   ======================================== */

/* Document Selection State */
.document-selection-state {
    padding: 10px 0;
}

.document-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.document-item {
    background: rgba(34, 38, 46, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.document-item:hover {
    border-color: var(--accent-primary);
    background: rgba(108, 92, 231, 0.1);
}

.document-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    width: 100%;
}

.document-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.document-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.document-name {
    color: var(--text-main);
    font-size: 0.95rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Analyze Button */
.forge-analyze-btn {
    position: relative;
    width: 100%;
    padding: 16px 30px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    font-family: inherit;
}

.forge-analyze-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.forge-analyze-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(108, 92, 231, 0.4);
}

/* Analyzing State */
.analyzing-state {
    padding: 60px 20px;
}

.analyzing-spinner {
    text-align: center;
}

.analyzing-spinner .spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(108, 92, 231, 0.3);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

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

.analyzing-spinner p {
    margin: 0;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
}

.analyzing-hint {
    color: var(--text-muted) !important;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
    margin-top: 8px !important;
}

/* Count Badge */
.count-badge {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: auto;
}

/* No Elements Message */
.no-elements {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* Re-analyze Section */
.reanalyze-section {
    margin-top: 25px;
    text-align: center;
}

.forge-reanalyze-btn {
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.forge-reanalyze-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-main);
    background: rgba(108, 92, 231, 0.1);
}

/* Empty State - Enhanced */
.identified-empty h4 {
    margin: 0 0 10px;
    color: var(--text-main);
    font-size: 1.1rem;
}

.identified-empty p {
    margin: 0 0 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.forge-upload-link-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.forge-upload-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(108, 92, 231, 0.4);
}

/* Results Grid Display */
#identified-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Scrollable element lists */
.forge-elements-list {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.forge-elements-list::-webkit-scrollbar {
    width: 6px;
}

.forge-elements-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.forge-elements-list::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}



/* =========================================
   STYLE EVOLUTION UI (Strict Mockup Match)
   ========================================= */

/* Specific Variables for this view to match "New UI" exactly */
.studio-container {
    /* Mockup Palette */
    --studio-bg: #1d1a15;
    --studio-panel: #2D2A32;
    --studio-primary: #D0BB95;
    --studio-primary-hover: #D6683F;
    --studio-text: #ffffff;
    --studio-text-muted: #a0a0a0;
    --studio-border: rgba(255, 255, 255, 0.05);

    /* Gradients & Glows */
    --gradient-glow: linear-gradient(135deg, rgba(208, 187, 149, 0.1) 0%, rgba(214, 104, 63, 0.1) 100%);

    display: flex;
    flex-direction: column;
    gap: 30px;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 50px;
    background-color: var(--studio-bg);
    /* Force background */
    color: var(--studio-text);
}

.studio-header h2 {
    font-size: 3rem;
    /* 4xl/5xl in Tailwind */
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--studio-text);
    letter-spacing: -0.02em;
}

.studio-header p {
    color: var(--studio-text-muted);
    font-size: 1.125rem;
    /* text-lg */
    margin: 0;
    font-weight: 400;
}

/* Workspace Layout */
.studio-workspace {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    min-height: 600px;
}

@media (max-width: 1200px) {
    .studio-workspace {
        grid-template-columns: 1fr;
    }
}

/* Left Column: Setup */
.setup-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.setup-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.studio-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--studio-text-muted);
    /* #a0a0a0 */
    display: flex;
    align-items: center;
    gap: 8px;
}

.studio-label .material-symbols-outlined {
    font-size: 0.875rem;
    /* text-sm */
    vertical-align: middle;
}

.studio-input {
    background: rgba(0, 0, 0, 0.2);
    /* bg-black/20 */
    border: 1px solid var(--studio-border);
    border-radius: 0.75rem;
    /* rounded-xl */
    padding: 12px 16px;
    color: var(--studio-text);
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s;
}

.studio-input::placeholder {
    color: var(--studio-text-muted);
    /* #a0a0a0 */
}

.studio-input:focus {
    border-color: var(--studio-primary);
    /* #D0BB95 */
    outline: none;
    box-shadow: 0 0 0 2px rgba(208, 187, 149, 0.2);
}

/* Source Selection Cards */
.source-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.source-card {
    position: relative;
    background: transparent;
    border: 1px solid var(--studio-border);
    border-radius: 0.75rem;
    /* rounded-xl */
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.source-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--studio-primary);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.source-card.active {
    border: 2px solid var(--studio-primary);
    /* #D0BB95 */
    background: rgba(208, 187, 149, 0.05);
    /* primary/5 */
    box-shadow: 0 10px 15px -3px rgba(208, 187, 149, 0.05);
}

.source-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    /* rounded-xl */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s;
}

.source-card:hover .source-icon-box {
    transform: scale(1.05);
}

.source-icon-box.gradient-bg {
    background: linear-gradient(135deg, var(--studio-primary), #fb923c);
    /* primary to orange-400 */
    box-shadow: 0 10px 15px -3px rgba(208, 187, 149, 0.3);
    /* shadow-primary/30 */
    color: white;
}

.source-icon-box.gray-bg {
    background: rgba(255, 255, 255, 0.1);
    /* white/10 */
    color: var(--studio-text-muted);
}

.source-card:hover .source-icon-box.gray-bg {
    color: var(--studio-primary);
}

.source-details {
    display: flex;
    flex-direction: column;
}

.source-title {
    font-weight: 700;
    font-size: 1.125rem;
    /* text-lg */
    color: var(--studio-text);
}

.source-desc {
    font-size: 0.75rem;
    /* text-xs */
    color: var(--studio-text-muted);
}

.check-mark {
    position: absolute;
    top: 16px;
    right: 16px;
    color: var(--studio-primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.source-card.active .check-mark {
    opacity: 1;
}

/* Upload Status */
.upload-status {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.status-pill.blue {
    background: rgba(52, 152, 219, 0.1);
    border-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.remove-file-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 4px;
    opacity: 0.7;
}

.remove-file-btn:hover {
    opacity: 1;
}

.small-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    color: inherit;
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: 8px;
}

.start-action-area {
    margin-top: 10px;
}

.full-width {
    width: 100%;
}

.asset-grid-overlay {
    background: var(--bg-dark);
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}

/* Right Column: Evolution Interface */
.evolution-column {
    background: #f8fafc;
    /* slate-50 */
    border-radius: 1rem;
    /* rounded-2xl */
    padding: 24px;
    border: 1px solid var(--studio-border);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 500px;
}

body.dark .evolution-column {
    background: rgba(0, 0, 0, 0.2);
    /* bg-black/20 */
}

.evolution-column.disabled-state {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(1);
}

.evolution-bg-glow {
    position: absolute;
    top: 0;
    right: 0;
    width: 256px;
    height: 256px;
    background: rgba(208, 187, 149, 0.1);
    border-radius: 9999px;
    filter: blur(64px);
    transform: translate(50%, -50%);
    pointer-events: none;
    z-index: 0;
}

/* Top Bar */
.evolution-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    position: relative;
    z-index: 2;
}

.progress-info {
    display: flex;
    flex-direction: column;
}

.sub-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--studio-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.progress-info h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--studio-text);
}

.progress-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--studio-primary);
    background: rgba(208, 187, 149, 0.1);
    padding: 4px 8px;
    border-radius: 0.375rem;
}

.progress-track-container {
    width: 100%;
    height: 0.75rem;
    /* h-3 */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    margin-bottom: 25px;
    overflow: hidden;
    position: relative;
    z-index: 2;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-track-fill {
    height: 100%;
    background: linear-gradient(to right, var(--studio-primary), #fb923c);
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(208, 187, 149, 0.3);
}

.progress-track-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255, 255, 255, 0.3);
}

/* Evolution Controls & Content */
.evolution-content {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.evolution-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
}

.header-text h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    /* text-xl/2xl */
    font-weight: 700;
    color: var(--studio-text);
}

.header-text p {
    margin: 0;
    color: var(--studio-text-muted);
    font-size: 0.875rem;
    /* text-sm */
}

.highlight {
    color: var(--studio-primary);
    font-weight: 700;
}

.controls-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    background: rgba(0, 0, 0, 0.4);
    /* bg-black/40 */
    border: 1px solid var(--studio-border);
    border-radius: 0.5rem;
    /* rounded-lg */
    padding: 8px 12px;
    padding-right: 40px;
    color: var(--studio-text);
    font-size: 0.75rem;
    /* text-xs */
    width: 200px;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    width: 240px;
    border-color: var(--studio-primary);
    outline: none;
    box-shadow: 0 0 0 1px var(--studio-primary);
}

.input-wrapper .icon-btn {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    color: var(--studio-text-muted);
    cursor: pointer;
    padding: 5px;
    display: flex;
}

.input-wrapper .icon-btn:hover {
    color: var(--studio-primary);
}

.secondary-btn.small {
    padding: 8px 12px;
    font-size: 0.75rem;
    /* text-xs */
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    /* white/10 */
    color: #e2e8f0;
    /* slate-200 */
    border-radius: 0.5rem;
    /* rounded-lg */
    border: none;
    cursor: pointer;
}

.secondary-btn.small:hover {
    background: rgba(255, 255, 255, 0.2);
}

.primary-btn.small {
    padding: 8px 16px;
    font-size: 0.75rem;
    /* text-xs */
    font-weight: 700;
    background: var(--studio-primary);
    /* #D0BB95 */
    color: white;
    /* or text-slate-900 based on mockup contrast? Mockup uses text-slate-700 for secondary, primary usually contrast text */
    /* Wait, mockup code says: bg-primary text-white for Select button. For buttons generally? 
       Mockup regenerate button: text-slate-200. Next Round button not explicitly shown but likely primary app button.
       Let's stick to standard primary button styles but updated colors. */
    border-radius: 0.5rem;
    /* rounded-lg */
    border: none;
    cursor: pointer;
}

.primary-btn.small:hover {
    background: var(--studio-primary-hover);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--studio-panel);
}

/* Variants Grid */
.variants-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    flex: 1;
    min-height: 350px;
}

.variant-card {
    position: relative;
    border-radius: 0.75rem;
    /* rounded-xl */
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: #1e293b;
    /* slate-800 */
    aspect-ratio: 3 / 4;
}

.variant-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s;
}

.variant-card:hover {
    box-shadow: 0 20px 25px -5px rgba(208, 187, 149, 0.2);
    /* shadow-primary/20 */
    transform: scale(1.02);
    border-color: var(--studio-primary);
}

.variant-card:hover img {
    transform: scale(1.1);
}

.variant-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 40%, transparent 100%);
    pointer-events: none;
}

.variant-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.variant-title {
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    /* text-sm */
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Variant Stats Bar */
.stat-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.bar-bg {
    flex: 1;
    height: 6px;
    /* h-1.5 */
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--studio-primary), #f97316);
    /* primary to orange-500 */
}

.stat-value {
    font-size: 0.625rem;
    /* 10px */
    font-family: monospace;
    color: white;
}

.variant-desc {
    font-size: 0.625rem;
    /* 10px */
    color: #cbd5e1;
    /* slate-300 */
}

/* Hover Select Button Overlay */
.select-overlay-btn {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s;
    z-index: 3;
}

.variant-card:hover .select-overlay-btn {
    opacity: 1;
}

.select-btn-inner {
    background: var(--studio-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 0.75rem;
    /* rounded-xl */
    font-weight: 700;
    font-size: 0.875rem;
    /* text-sm */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(16px);
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.variant-card:hover .select-btn-inner {
    transform: translateY(0);
}

/* Active/Selected State (Border managed by :hover logic mostly, but persistent selection needs logic) */
.variant-card.selected {
    border-color: var(--studio-primary);
    box-shadow: 0 0 0 4px rgba(208, 187, 149, 0.5);
    /* ring-primary/50 */
    transform: scale(1.02);
}

.variant-card.selected .select-overlay-btn {
    /* Maybe hide the button if already selected or show "Selected"? 
      Mockup implies just a selection state visual. */
    opacity: 0;
    /* Let normal view show through? Or show Checkmark? */
}

/* Add a checkmark for selected state */
.variant-card.selected::before {
    content: 'check_circle';
    font-family: 'Material Symbols Outlined';
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--studio-primary);
    font-size: 24px;
    z-index: 10;
    background: white;
    border-radius: 50%;
}

/* Divider */
.divider-line {
    height: 1px;
    background: var(--border-color);
    width: 100%;
    margin: 20px 0;
}

/* Gallery Section */
.gallery-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.gallery-header h3 {
    margin: 0;
    font-size: 1.5rem;
    /* text-2xl */
    font-weight: 700;
    color: var(--studio-text);
    line-height: 1.25;
    letter-spacing: -0.025em;
}

.text-btn {
    background: none;
    border: none;
    color: var(--studio-text-muted);
    /* text-slate-500 */
    font-weight: 700;
    font-size: 0.875rem;
    /* text-sm */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.text-btn:hover {
    color: var(--studio-primary);
}

.styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    /* gap-6 */
}

/* Gallery Card Style (matches mockup .group) */
.gallery-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* gap-3 */
    padding: 12px;
    /* p-3 */
    border-radius: 1rem;
    /* rounded-2xl */
    background: var(--studio-panel);
    /* bg-surface-dark */
    border: 1px solid var(--studio-border);
    transition: all 0.3s;
    cursor: pointer;
}

.gallery-card:hover {
    border-color: rgba(208, 187, 149, 0.3);
    /* border-primary/30 */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    /* shadow-xl */
}

/* New Style Card (Placeholder) matches mockup .group at end */
.new-style-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* gap-2 */
    padding: 12px;
    /* p-3 */
    border-radius: 1rem;
    /* rounded-2xl */
    background: transparent;
    border: 2px dashed var(--studio-border);
    min-height: 200px;
    /* arbitrary height to match others */
    cursor: pointer;
    transition: all 0.3s;
    color: var(--studio-text-muted);
}

.new-style-card:hover {
    background: rgba(255, 255, 255, 0.05);
    /* hover:bg-white/5 */
    border-color: rgba(208, 187, 149, 0.5);
    /* hover:border-primary/50 */
}

.icon-circle {
    width: 3.5rem;
    /* size-14 */
    height: 3.5rem;
    border-radius: 9999px;
    /* rounded-full */
    background: rgba(255, 255, 255, 0.05);
    /* bg-white/5 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--studio-text-muted);
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.new-style-card:hover .icon-circle {
    color: var(--studio-primary);
    transform: scale(1.1);
}

.new-style-card span {
    font-size: 0.875rem;
    /* text-sm */
    font-weight: 700;
    margin-top: 4px;
    /* mt-1 */
    color: var(--studio-text-muted);
}

.new-style-card:hover span {
    color: var(--studio-primary);
}

/* =========================================
   STYLE STUDIO UTILITIES (Tailwind Bridge)
   ========================================= */

/* Generic Disabled State for Evolution Panel */
.disabled-state {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.8);
}

/* Source Card Active State Logic */
.source-card {
    transition: all 0.2s ease;
}

/* When not active, force these styles (overriding inline tailwind partials if needed) */
.source-card:not(.active) {
    border-color: rgba(255, 255, 255, 0.1);
    background-color: transparent;
    border-width: 1px;
}

/* When active */
.source-card.active {
    border-color: var(--studio-primary, #D0BB95) !important;
    background-color: rgba(208, 187, 149, 0.05) !important;
    border-width: 2px !important;
    opacity: 1 !important;
    box-shadow: 0 10px 15px -3px rgba(208, 187, 149, 0.1);
}

/* Checkmark visibility */
.source-card .check-mark {
    opacity: 0;
    transition: opacity 0.2s;
}

.source-card.active .check-mark {
    opacity: 1;
}

/* Shimmer Animation for Skeletons */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.shimmer-animate {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
    width: 200%;
    /* Ensure it spans across */
}

/* Fix for Variant Selection Visibility */
.variant-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.variant-card.selected {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 4px rgba(208, 187, 149, 0.2);
}

.variant-card .select-overlay-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 20;
}

.variant-card.selected .select-overlay-btn {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.variant-card.selected .select-overlay-btn::after {
    content: 'check';
    font-family: 'Material Symbols Outlined';
    font-size: 20px;
    font-weight: bold;
}

.variant-card:not(.selected) .select-overlay-btn::after {
    content: '';
}

.variant-card .select-btn-inner {
    display: none;
    /* Hide the text, use icon instead for top-right style */
}


/* Fixed Selection Indicator */
.select-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 50;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.variant-card.selected .select-indicator {
    opacity: 1;
    transform: scale(1);
}

.select-indicator .material-symbols-outlined {
    font-size: 20px;
    font-weight: bold;
}

/* Hide the old button when selected to cleaner look */
.variant-card.selected .select-overlay-btn {
    opacity: 0;
    pointer-events: none;
}