/* 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: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: var(--accent-primary);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
    transform: translateY(-2px);
}

.quantity-option.active .quantity-number,
.quantity-option.active .quantity-label {
    color: #000;
    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;
}

.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);
}

@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);
}

/* 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);
}

/* 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 {
    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: var(--accent-primary);
    color: white;
    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(108, 92, 231, 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(108, 92, 231, 0.4);
}

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

.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: center;
    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;
}