/* ==========================================================================
   EventVision - Split Editor UI
   Image Left / Controls Right - Clean Identity
   ========================================================================== */

.edit-mode-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002; /* Above gallery modal */
    padding: 40px;
    animation: fadeIn 0.3s ease;
}

.split-edit-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 98vw; /* Increased from 100% with max-width */
    max-width: 1800px; /* Increased from 1400px */
    height: 95vh; /* Fills screen */
    display: flex;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

/* Left Panel - Visual */
.split-visual-panel {
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-right: 1px solid var(--border);
    position: relative;
}

.split-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.split-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.split-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 2;
}

/* Right Panel - Controls */
.split-controls-panel {
    width: 400px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
}

.split-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.split-header h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.02em;
}

.split-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.split-close-btn:hover {
    color: var(--text-main);
    background: var(--bg-input);
    transform: rotate(90deg);
}

.split-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.control-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Refs Area (Drag & Drop) */
.split-refs-area {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 100px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    background: var(--bg-input);
    transition: all 0.2s;
}

.split-refs-area.drag-over {
    border-color: var(--primary);
    background: rgba(255, 230, 0, 0.05);
}

.split-add-ref {
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.split-add-ref:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.split-add-ref svg {
    width: 20px;
    height: 20px;
    margin-bottom: 4px;
}

.split-add-ref span {
    font-size: 0.7rem;
    font-weight: 600;
}

.ref-thumb-simple {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
    animation: fadeIn 0.2s;
}

.ref-thumb-simple img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ref-remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.ref-remove-btn:hover {
    background: var(--danger);
    transform: scale(1.1);
}

/* Prompt Area */
.prompt-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.split-textarea {
    width: 100%;
    flex: 1;
    min-height: 200px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    transition: all 0.2s;
}

.split-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(30, 30, 30, 1);
}

.split-textarea::placeholder {
    color: var(--text-muted);
}

/* Footer */
.split-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.split-generate-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 100px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.split-generate-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(255, 230, 0, 0.3);
}

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

/* View Mode (Floating Actions) - Restored for Gallery */
.view-mode-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.floating-action-bar {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 20;
    animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 40px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.fab-btn svg {
    width: 18px;
    height: 18px;
}

.fab-btn:hover {
    background: var(--bg-input);
    border-color: var(--text-main);
}

.fab-btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    box-shadow: 0 4px 16px rgba(255, 230, 0, 0.3);
}

.fab-btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 230, 0, 0.4);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Placeholder Styles */
.placeholder-item {
    background: var(--bg-input);
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s infinite ease-in-out;
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
    min-height: 150px;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.placeholder-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 230, 0, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .edit-mode-wrapper {
        padding: 0;
    }
    
    .split-edit-modal {
        flex-direction: column;
        height: 100%;
        border-radius: 0;
    }
    
    .split-visual-panel {
        height: 40%;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .split-controls-panel {
        width: 100%;
        flex: 1;
        border-left: none;
    }
    
    .split-content {
        padding: 20px;
        gap: 20px;
    }
    
    .split-textarea {
        min-height: 120px;
    }
    
    .split-footer {
        padding: 16px 20px;
    }
}
