/* Nano-Banana AI Studio - Modern Glassmorphism Design */

:root {
    --primary-purple: #8b5cf6;
    --secondary-purple: #a78bfa;
    --dark-purple: #6d28d9;
    --accent-pink: #ec4899;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --text-light: #f1f5f9;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background: #020617;
    min-height: 100vh;
    position: relative;
}

/* Animations */
@keyframes gradient {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(1deg); }
    66% { transform: translateY(10px) rotate(-1deg); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 0 30px rgba(139, 92, 246, 0.8); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2.4); opacity: 0; }
}

@keyframes loading-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Glass morphism cards */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.glass-card-enhanced {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.glass-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.5s;
}

.glass-card-enhanced:hover::before {
    left: 100%;
}

/* Input styles */
.input-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 20px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.input-glass:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 
        0 0 0 1px rgba(139, 92, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 8px 25px rgba(139, 92, 246, 0.15);
    background: rgba(139, 92, 246, 0.05);
}

.input-glass::placeholder {
    color: rgba(203, 213, 225, 0.5);
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 50%, #c084fc 100%);
    border: none;
    border-radius: 16px;
    padding: 14px 24px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

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

.btn-generate {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #3b82f6 100%);
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
    border: none;
    border-radius: 20px;
    padding: 18px 32px;
    color: white;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 30px rgba(139, 92, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-generate:disabled {
    background: rgba(107, 114, 128, 0.3);
    cursor: not-allowed;
    animation: none;
}

.btn-generate:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 40px rgba(139, 92, 246, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Template buttons */
.template-btn {
    background: rgba(139, 92, 246, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    color: rgba(203, 213, 225, 0.9);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.template-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.template-btn:active {
    transform: translateY(0) scale(0.98);
}

.template-btn i {
    color: rgba(139, 92, 246, 0.7);
    font-size: 10px;
    width: 16px;
}

/* Upload area */
.upload-area-modern {
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    padding: 48px 24px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.02) 0%, rgba(236, 72, 153, 0.02) 100%);
    position: relative;
    overflow: hidden;
}

.upload-area-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area-modern:hover {
    border-color: rgba(139, 92, 246, 0.5);
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
    transform: translateY(-2px);
}

.upload-area-modern:hover::before {
    opacity: 1;
}

.upload-area-modern.drag-over {
    border-color: rgba(236, 72, 153, 0.6);
    background: linear-gradient(145deg, rgba(236, 72, 153, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    transform: scale(1.02);
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    animation: float 6s ease-in-out infinite;
}

.format-tag {
    display: inline-block;
    background: rgba(139, 92, 246, 0.2);
    color: rgba(139, 92, 246, 1);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    margin: 0 2px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Range sliders */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    width: 100%;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transition: all 0.2s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.range-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Result container */
.result-container {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-placeholder {
    text-align: center;
    color: rgba(203, 213, 225, 0.5);
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: rgba(139, 92, 246, 0.5);
    border: 2px dashed rgba(139, 92, 246, 0.2);
}

/* Status badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-ready {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-processing {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
    animation: pulse 2s infinite;
}

.status-failed {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* API Status */
.api-status.connected {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.1);
}

.api-status.connected i {
    color: #22c55e;
}

.api-status.connected span {
    color: #22c55e;
}

/* Loading Modal */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-modal {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 48px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3);
}

.loading-animation {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.loading-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    animation: loading-rotate 1.4s ease-in-out infinite both;
}

.loading-circle:nth-child(1) { animation-delay: -0.32s; }
.loading-circle:nth-child(2) { animation-delay: -0.16s; }
.loading-circle:nth-child(3) { animation-delay: 0s; }

.progress-container {
    margin-top: 24px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #ec4899, #3b82f6);
    background-size: 200% 100%;
    animation: gradient 2s ease infinite;
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #a855f7, #f472b6);
}

/* Responsive Design */
@media (max-width: 1280px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .glass-card-enhanced {
        padding: 1.5rem;
    }
    
    .template-btn {
        padding: 10px 12px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .upload-area-modern {
        padding: 32px 16px;
    }
    
    .upload-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .glass-card-enhanced {
        padding: 1rem;
        border-radius: 20px;
    }
    
    .template-btn {
        padding: 8px 10px;
        font-size: 10px;
    }
    
    .btn-generate {
        padding: 16px 24px;
        font-size: 14px;
    }
    
    .loading-modal {
        padding: 32px;
        margin: 1rem;
    }
}

/* Character count */
#charCount {
    transition: color 0.3s ease;
}

#charCount.warning {
    color: #f59e0b;
}

#charCount.danger {
    color: #ef4444;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    color: white;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(21, 128, 61, 0.9));
}

.notification.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(185, 28, 28, 0.9));
}

.notification.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(180, 83, 9, 0.9));
}

.notification.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(29, 78, 216, 0.9));
}