@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

/* WebGL Canvas */
#glCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* UI Overlay */
.ui-overlay {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    padding: 24px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(2px);
    background-color: #000000de;
}

/* Header */
.header-elegant {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px);
    border-radius: 60px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-glow {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}

.title-gradient {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #e0d4ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.title-gradient span {
    background: linear-gradient(135deg, #f472b6, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-left: auto;
    margin-right: 24px;
}

.fullscreen-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(8px);
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Upload Panel */
.upload-panel {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 48px;
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.4);
    margin-top: 20px;
}

.dropzone-elegant {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 60px 40px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.02);
}

.dropzone-elegant:hover {
    border-color: #a78bfa;
    background: rgba(139, 92, 246, 0.05);
}

.dropzone-inner {
    text-align: center;
}

.upload-visual {
    margin-bottom: 24px;
}

.upload-emoji {
    font-size: 4rem;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.dropzone-elegant h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.hint-text {
    opacity: 0.7;
    margin-bottom: 32px;
}

.btn-elegant {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-elegant:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
}

.btn-elegant .arrow {
    transition: transform 0.2s;
}

.btn-elegant:hover .arrow {
    transform: translateX(6px);
}

/* Processing Panel */
.processing-panel {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 32px;
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.4);
    margin-top: 20px;
}

.gallery-header-elegant {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
}

.queue-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 500;
}

.queue-icon {
    font-size: 1.8rem;
}

.btn-primary-elegant {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border: none;
    padding: 14px 32px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary-elegant:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(236, 72, 153, 0.4);
    background: linear-gradient(135deg, #db2777, #7c3aed);
}

/* Preview Comparison */
.preview-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.preview-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 16px;
}

.preview-image-wrapper {
    width: 100%;
    height: 280px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.checkerboard {
    background-image: 
        linear-gradient(45deg, rgba(255,255,255,0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.05) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.placeholder-text {
    opacity: 0.5;
    font-size: 1rem;
}

/* Gallery Grid */
.gallery-grid-elegant {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
}

.gallery-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.gallery-item:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: #a78bfa;
}

.gallery-item.active {
    border: 2px solid #a78bfa;
    background: rgba(139, 92, 246, 0.2);
}

.gallery-thumb {
    width: 100%;
    height: 120px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    position: relative;
}

.gallery-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-status {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6b7280;
}

.gallery-status.processing { background: #3b82f6; animation: pulse 1.5s infinite; }
.gallery-status.done { background: #10b981; }
.gallery-status.error { background: #ef4444; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.gallery-name {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}

/* Bottom Actions */
.bottom-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-success-elegant {
    background: rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 14px 32px;
    border-radius: 40px;
    color: #34d399;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-success-elegant:hover {
    background: rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.btn-outline-elegant {
    background: transparent;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 14px 32px;
    border-radius: 40px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-outline-elegant:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Toast */
.toast-elegant {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 14px 24px;
    color: white;
    display: none;
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .ui-overlay { padding: 16px; }
    .header-elegant { flex-wrap: wrap; }
    .tagline { display: none; }
    .preview-comparison { grid-template-columns: 1fr; }
    .preview-image-wrapper { height: 220px; }
    .upload-panel { padding: 24px; }
}