/* AI Image Editor Styles */

.ai-image-editor-container {
    background: rgba(31, 31, 37, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2rem auto;
    max-width: 1400px;
    min-height: 800px;
    overflow: hidden;
}

/* Main Header */
.editor-header {
    background: linear-gradient(135deg, #3F3EED, #33B89F);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(78, 78, 255, 0.2);
}

.editor-header h2 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.usage-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-clear {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Two Column Layout */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 700px;
}

/* Left Column: Chat & Controls */
.chat-column {
    background: rgba(31, 31, 37, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(78, 78, 255, 0.2);
    height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Right Column: Results Canvas */
.results-column {
    background: rgba(31, 31, 37, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(78, 78, 255, 0.2);
    padding: 25px;
    display: flex;
    flex-direction: column;
    height: 700px;
    position: relative;
}

/* Chat Messages Container - Scrollable */
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 25px 25px 10px 25px;
    scrollbar-width: thin;
    scrollbar-color: rgba(63, 62, 237, 0.6) rgba(255, 255, 255, 0.1);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.chat-messages {
    padding: 0;
    margin: 0;
}

.chat-messages-container::-webkit-scrollbar-track {
    background: transparent;
}

/* Usage Indicator */
.usage-indicator {
    margin: 20px 0;
    padding: 15px 25px;
    background: linear-gradient(135deg, rgba(63, 62, 237, 0.1), rgba(51, 184, 159, 0.1));
    border: 1px solid rgba(63, 62, 237, 0.3);
    border-radius: 12px;
    display: inline-block;
}

.usage-text {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Image Upload Section */
.image-upload-section h4 {
    color: #e2e2e2;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-slots {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.image-slot {
    width: 100px;
    height: 100px;
    border: 2px dashed rgba(63, 62, 237, 0.5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(63, 62, 237, 0.05);
    position: relative;
    overflow: hidden;
}

.image-slot:first-child {
    width: 120px;
}

.image-slot:hover {
    border-color: #3F3EED;
    background: rgba(63, 62, 237, 0.1);
    transform: translateY(-2px);
}

.image-slot.has-image {
    border: 2px solid #3F3EED;
    background: transparent;
}

.add-image-btn {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #3F3EED;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    gap: 5px;
}

.add-image-btn span {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.image-slot:hover .add-image-btn {
    color: #33B89F;
    transform: scale(1.05);
}

/* Input Toolbar */
.input-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(78, 78, 255, 0.2);
    position: relative;
    z-index: 1000;
}

.toolbar-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    pointer-events: auto;
    z-index: 2000;
    position: relative;
    user-select: none;
}

.toolbar-btn.upload-btn {
    background: linear-gradient(135deg, #3F3EED, #33B89F) !important;
    color: white !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.toolbar-btn.upload-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(63, 62, 237, 0.4);
}

.toolbar-btn.settings-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e2e2e2 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.toolbar-btn.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    pointer-events: auto;
}

.toolbar-btn.settings-btn.active {
    background: linear-gradient(135deg, #ff9f43, #ff6b6b);
    color: white;
}

/* Uploaded Images Preview */
.uploaded-images {
    padding: 15px 25px;
    border-bottom: 1px solid rgba(78, 78, 255, 0.2);
}

.images-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.image-preview {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #3F3EED;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Settings Panel */
.settings-panel {
    background: rgba(31, 31, 37, 0.8);
    border-bottom: 1px solid rgba(78, 78, 255, 0.2);
    animation: slideDown 0.3s ease;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    background: rgba(63, 62, 237, 0.1);
}

.settings-header h5 {
    color: #33B89F;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-settings {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: #e2e2e2;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-settings:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #33B89F;
}

.settings-content {
    padding: 15px 25px;
    display: grid;
    gap: 15px;
}

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

.setting-group label {
    font-size: 12px;
    font-weight: 600;
    color: #e2e2e2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-select {
    padding: 8px 12px;
    border: 1px solid rgba(78, 78, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: #e2e2e2;
    transition: border-color 0.2s ease;
}

.setting-select:focus {
    outline: none;
    border-color: #3F3EED;
}

.setting-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3F3EED;
    cursor: pointer;
}

.checkboxes {
    display: grid;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #e2e2e2;
    cursor: pointer;
    padding: 4px 0;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 300px;
        opacity: 1;
    }
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    background: transparent;
    padding: 0;
    margin: 0;
}

.chat-messages-container::-webkit-scrollbar {
    width: 4px;
}

.chat-messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages-container::-webkit-scrollbar-thumb {
    background: rgba(63, 62, 237, 0.3);
    border-radius: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.usage-counter {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

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

.chat-header h4 {
    color: white;
    margin: 0;
    font-weight: 600;
}

.chat-header button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.chat-header button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Nano Banana Controls */
.nano-controls {
    background: rgba(31, 31, 37, 0.7);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.control-group h5 {
    color: #33B89F;
    margin: 0 0 15px 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nano-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-row label {
    color: #e2e2e2;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nano-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(78, 78, 255, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    color: #e2e2e2;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nano-select:focus {
    outline: none;
    border-color: #3F3EED;
    box-shadow: 0 0 0 2px rgba(63, 62, 237, 0.2);
}

.nano-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

.nano-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3F3EED, #33B89F);
    cursor: pointer;
}

.range-display {
    background: rgba(63, 62, 237, 0.2);
    color: #3F3EED;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 25px;
    text-align: center;
    margin-left: 10px;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem !important;
    text-transform: none !important;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3F3EED;
}

.welcome-message {
    margin-bottom: 20px;
}

.ai-message, .user-message {
    display: flex;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 15px;
    font-size: 1.2rem;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #3F3EED, #33B89F);
    color: white;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    color: white;
}

.message-content {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 18px;
    color: #e2e2e2;
    line-height: 1.6;
}

.ai-message .message-content {
    background: rgba(63, 62, 237, 0.15);
    border: 1px solid rgba(63, 62, 237, 0.3);
    border-radius: 18px 18px 18px 4px;
}

.user-message .message-content {
    background: rgba(51, 184, 159, 0.15);
    border: 1px solid rgba(51, 184, 159, 0.3);
    border-radius: 18px 18px 4px 18px;
}

.message-image {
    max-width: 300px;
    border-radius: 12px;
    margin: 10px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.message-image:hover {
    transform: scale(1.05);
}

/* Chat Input Area */
.chat-input-area {
    padding: 25px;
    background: rgba(31, 31, 37, 0.9);
    border-top: 1px solid rgba(78, 78, 255, 0.2);
    border-radius: 0 0 16px 16px;
}

/* Image Upload Section */
.image-upload-section {
    margin-bottom: 20px;
}

.image-placeholders {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 15px;
}

.image-slot {
    width: 120px;
    height: 120px;
    border: 2px dashed rgba(63, 62, 237, 0.5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(63, 62, 237, 0.05);
    position: relative;
    overflow: hidden;
}

.image-slot:hover {
    border-color: #3F3EED;
    background: rgba(63, 62, 237, 0.1);
    transform: translateY(-2px);
}

.image-slot.has-image {
    border: 2px solid #3F3EED;
    background: transparent;
}

.add-image-btn {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3F3EED;
    font-size: 2rem;
    transition: all 0.3s ease;
}

.image-slot:hover .add-image-btn {
    color: #33B89F;
    transform: scale(1.1);
}

.slot-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 71, 87, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.remove-image:hover {
    background: #ff4757;
    transform: scale(1.1);
}

/* Prompt Input Area */
.prompt-input-area {
    padding: 15px 25px 25px;
    border-top: 1px solid rgba(78, 78, 255, 0.2);
}

.input-container {
    background: rgba(31, 31, 37, 0.8);
    border-radius: 16px;
    padding: 12px 16px;
    border: 1px solid rgba(78, 78, 255, 0.3);
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: #3F3EED;
    box-shadow: 0 0 0 3px rgba(63, 62, 237, 0.15);
}

.input-container textarea {
    width: 100%;
    border: none;
    background: transparent;
    resize: none;
    font-size: 14px;
    color: #e2e2e2;
    outline: none;
    font-family: inherit;
    line-height: 1.4;
    min-height: 36px;
}

.input-container textarea::placeholder {
    color: rgba(226, 226, 226, 0.5);
}

.input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(78, 78, 255, 0.2);
}

.char-count {
    font-size: 11px;
    color: rgba(226, 226, 226, 0.6);
}

.char-count.warning {
    color: #ff9f43;
    font-weight: 600;
}

.send-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #3F3EED, #33B89F);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(63, 62, 237, 0.4);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

#chatInput {
    width: 100%;
    background: transparent;
    border: none;
    color: #e2e2e2;
    font-size: 14px;
    line-height: 1.5;
    padding: 12px 0;
    min-height: 40px;
    max-height: 40px;
    font-family: 'Inter', sans-serif;
    outline: none;
    resize: none;
    overflow: hidden;
}

#chatInput::placeholder {
    color: rgba(226, 226, 226, 0.5);
    font-style: italic;
}

.prompt-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.char-counter {
    color: rgba(226, 226, 226, 0.6);
    font-size: 0.8rem;
}

.quick-prompts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.prompt-btn {
    background: rgba(63, 62, 237, 0.15);
    border: 1px solid rgba(63, 62, 237, 0.3);
    color: #3F3EED;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.prompt-btn:hover {
    background: rgba(63, 62, 237, 0.25);
    color: #33B89F;
    transform: translateY(-1px);
}

.generate-btn {
    background: linear-gradient(135deg, #3F3EED, #33B89F);
    border: none;
    border-radius: 10px;
    padding: 15px 25px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(63, 62, 237, 0.4);
}

.generate-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666, #555);
}

/* Input Features Bar */
.input-features {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(31, 31, 37, 0.5);
    border-top: 1px solid rgba(78, 78, 255, 0.2);
}

.character-count {
    font-size: 0.85rem;
    color: rgba(226, 226, 226, 0.6);
    font-weight: 500;
}

.character-count.warning {
    color: #ff9f43;
}

.character-count.danger {
    color: #ff4757;
}

/* Quick Action Buttons */
.quick-actions {
    display: flex;
    gap: 8px;
}

.quick-btn {
    background: rgba(63, 62, 237, 0.15);
    border: 1px solid rgba(63, 62, 237, 0.3);
    color: #3F3EED;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-btn:hover {
    background: rgba(63, 62, 237, 0.25);
    color: #33B89F;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(63, 62, 237, 0.2);
}

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

.send-btn {
    background: linear-gradient(135deg, #3F3EED, #33B89F);
    border: none;
    border-radius: 15px;
    min-width: 80px;
    height: 100px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(63, 62, 237, 0.3);
    align-self: flex-end;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.send-btn i {
    font-size: 1.2rem;
}

.send-btn span {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(63, 62, 237, 0.5);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(135deg, #666, #555);
}

.send-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

/* Canvas Header */
.canvas-header {
    background: rgba(31, 31, 37, 0.8);
    padding: 20px 25px;
    border-bottom: 1px solid rgba(78, 78, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.canvas-header h4 {
    color: #e2e2e2;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.canvas-actions {
    display: flex;
    gap: 10px;
}

.btn-download {
    background: linear-gradient(135deg, #33B89F, #3F3EED);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-download:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(51, 184, 159, 0.3);
}

.btn-download:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666, #555);
}

.btn-reset {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

/* Fixed Input Area at Bottom */
.input-area-fixed {
    padding: 15px 25px 25px 25px;
    background: rgba(31, 31, 37, 0.98);
    border-top: 1px solid rgba(78, 78, 255, 0.2);
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

/* Uploaded Images Preview Above Prompt */
.uploaded-images-preview {
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(78, 78, 255, 0.1);
}

.images-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.image-thumbnail {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(78, 78, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.image-thumbnail:hover {
    border-color: #3F3EED;
    transform: scale(1.05);
}

.image-thumbnail img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    display: block;
}

.image-thumbnail .delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 71, 87, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s ease;
    opacity: 0;
}

.image-thumbnail:hover .delete-btn {
    opacity: 1;
}

.image-thumbnail .delete-btn:hover {
    background: #ff4757;
    transform: scale(1.1);
}

/* Prompt Input Container */
.prompt-input-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 15px;
    position: relative;
    border: 1px solid rgba(78, 78, 255, 0.3);
    transition: all 0.3s ease;
    pointer-events: auto;
    z-index: 100;
}

.prompt-input-container:focus-within {
    border-color: #3F3EED;
    background: rgba(255, 255, 255, 0.1);
}

.prompt-input-container * {
    pointer-events: auto;
}

/* Results Canvas */
.results-canvas {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px dashed rgba(78, 78, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.canvas-placeholder {
    text-align: center;
    color: rgba(226, 226, 226, 0.6);
}

.canvas-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: rgba(78, 78, 255, 0.4);
}

.canvas-placeholder h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
    font-weight: 600;
}

.canvas-placeholder p {
    font-size: 0.9rem;
    margin: 0;
}

/* Canvas Loading Overlay */
.canvas-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(31, 31, 37, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.canvas-loading .loading-content {
    text-align: center;
    color: #e2e2e2;
}

.canvas-loading .loading-spinner {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.canvas-loading .spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(63, 62, 237, 0.3);
    border-top: 3px solid #3F3EED;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 5px;
}

.canvas-loading .spinner-ring:nth-child(2) {
    animation-delay: 0.1s;
    border-top-color: #33B89F;
}

.canvas-loading .spinner-ring:nth-child(3) {
    animation-delay: 0.2s;
    border-top-color: #ff9f43;
}

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

.canvas-loading h4 {
    color: #3F3EED;
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.canvas-loading p {
    color: rgba(226, 226, 226, 0.8);
    margin: 0 0 20px 0;
    font-size: 0.9rem;
}

.canvas-loading .loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.canvas-loading .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3F3EED, #33B89F);
    border-radius: 2px;
    animation: progressBar 2s ease-in-out infinite;
}

@keyframes progressBar {
    0% { width: 0%; }
    50% { width: 75%; }
    100% { width: 100%; }
}

/* Result Image Display */
.result-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.result-image:hover {
    transform: scale(1.02);
}

/* Result History */
.result-history {
    background: rgba(31, 31, 37, 0.6);
    padding: 20px;
    border-top: 1px solid rgba(78, 78, 255, 0.2);
    max-height: 200px;
    overflow-y: auto;
}

.result-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.result-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid rgba(63, 62, 237, 0.3);
}

.result-info {
    flex: 1;
    color: #e2e2e2;
}

.result-info h6 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.result-info p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(226, 226, 226, 0.6);
    line-height: 1.3;
}

.toggle-options {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(78, 78, 255, 0.3);
    border-radius: 10px;
    padding: 12px 20px;
    color: #e2e2e2;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
}

.toggle-options:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #3F3EED;
}

.toggle-options.active {
    background: rgba(63, 62, 237, 0.15);
    border-color: #3F3EED;
}

.toggle-options.active .fa-chevron-down {
    transform: rotate(180deg);
}

.options-panel {
    background: rgba(31, 31, 37, 0.8);
    border: 1px solid rgba(78, 78, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

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

.option-group label {
    color: #e2e2e2;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-select {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(78, 78, 255, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    color: #e2e2e2;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-select:focus {
    outline: none;
    border-color: #3F3EED;
    box-shadow: 0 0 0 3px rgba(63, 62, 237, 0.15);
}

.option-select option {
    background: rgba(31, 31, 37, 0.9);
    color: #e2e2e2;
    padding: 8px;
}

/* Slider Styles */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3F3EED, #33B89F);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(63, 62, 237, 0.3);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(63, 62, 237, 0.4);
}

.range-value {
    background: rgba(63, 62, 237, 0.2);
    color: #3F3EED;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
    margin-left: 10px;
}

/* Control Panel */
.control-panel {
    background: rgba(20, 20, 38, 0.8);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(78, 78, 255, 0.2);
    height: 600px;
    overflow-y: auto;
}

.panel-header {
    background: linear-gradient(135deg, #3F3EED, #33B89F);
    margin: -25px -25px 25px -25px;
    padding: 20px 25px;
    border-radius: 16px 16px 0 0;
}

.panel-header h4 {
    color: white;
    margin: 0;
    font-weight: 600;
}

/* Upload Section */
.upload-section h5,
.style-section h5 {
    color: #fff;
    margin-bottom: 15px;
    font-weight: 600;
}

.upload-area {
    border: 2px dashed rgba(63, 62, 237, 0.5);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(63, 62, 237, 0.05);
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #3F3EED;
    background: rgba(63, 62, 237, 0.1);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #33B89F;
    background: rgba(51, 184, 159, 0.1);
    transform: scale(1.02);
}

.upload-content i {
    font-size: 3rem;
    color: #3F3EED;
    margin-bottom: 15px;
    display: block;
}

.upload-content p {
    color: #e2e2e2;
    font-weight: 600;
    margin: 10px 0;
}

.upload-content small {
    color: #999;
    font-size: 0.85rem;
}

/* Current Image */
.current-image {
    background: rgba(31, 31, 37, 0.8);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(78, 78, 255, 0.2);
}

.current-image h6 {
    color: #fff;
    margin-bottom: 10px;
    font-weight: 600;
}

.current-image img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(63, 62, 237, 0.3);
}

/* Form Controls */
.style-section {
    margin: 25px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    color: #e2e2e2;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(78, 78, 255, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    color: #e2e2e2;
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3F3EED;
    box-shadow: 0 0 0 3px rgba(63, 62, 237, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

/* Action Buttons */
.action-buttons {
    margin: 25px 0;
}

.btn-block {
    width: 100%;
    margin-bottom: 15px;
    padding: 15px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: none;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3F3EED, #33B89F);
    color: white;
    box-shadow: 0 4px 15px rgba(63, 62, 237, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(63, 62, 237, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: linear-gradient(135deg, #33B89F, #28a745);
    color: white;
    box-shadow: 0 4px 15px rgba(51, 184, 159, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(51, 184, 159, 0.4);
}

/* Usage Info */
.usage-info {
    border-top: 1px solid rgba(78, 78, 255, 0.2);
    padding-top: 20px;
}

.info-card {
    background: rgba(63, 62, 237, 0.1);
    border: 1px solid rgba(63, 62, 237, 0.3);
    border-radius: 12px;
    padding: 20px;
}

.info-card h6 {
    color: #fff;
    margin-bottom: 15px;
    font-weight: 600;
}

.info-card ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.info-card li {
    color: #e2e2e2;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.info-card li:before {
    content: "•";
    color: #3F3EED;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 40px;
}

.loading-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: #3F3EED;
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    border-right-color: #33B89F;
    animation-delay: 0.3s;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
}

.spinner-ring:nth-child(3) {
    border-bottom-color: #FF6B6B;
    animation-delay: 0.6s;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
}

.loading-content h4 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #3F3EED, #33B89F);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-content p {
    color: #ccc;
    margin-bottom: 25px;
}

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

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #3F3EED, #33B89F);
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

/* Usage Limit Modal */
.modal-content {
    background: rgba(31, 31, 37, 0.95);
    border: 1px solid rgba(78, 78, 255, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(20px);
}

.modal-header {
    border-bottom: 1px solid rgba(78, 78, 255, 0.2);
    background: linear-gradient(135deg, rgba(63, 62, 237, 0.1), rgba(51, 184, 159, 0.1));
}

.modal-title {
    color: #fff;
    font-weight: 600;
}

.modal-body {
    color: #e2e2e2;
}

.modal-body h4 {
    color: #fff;
    margin-bottom: 20px;
}

.limit-icon {
    background: rgba(63, 62, 237, 0.1);
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.feature-list {
    background: rgba(20, 20, 38, 0.5);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.feature-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 350px 1fr;
    }
    
    .chat-column {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .ai-image-editor-container {
        margin: 1rem;
        min-height: auto;
    }
    
    .editor-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .chat-column {
        border-right: none;
        border-bottom: 1px solid rgba(78, 78, 255, 0.2);
    }
    
    .results-column {
        min-height: 400px;
    }
    
    .image-slots {
        justify-content: center;
    }
    
    .image-slot {
        width: 80px;
        height: 80px;
    }
    
    .image-slot:first-child {
        width: 100px;
    }
    
    .nano-options {
        grid-template-columns: 1fr;
    }
    
    .quick-prompts {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .editor-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .chat-column {
        padding: 15px;
    }
    
    .canvas-header {
        padding: 15px 20px;
    }
    
    .results-canvas {
        padding: 20px;
    }
    
    .image-slots {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .image-slot,
    .image-slot:first-child {
        width: 120px;
        height: 120px;
    }
    
    .quick-prompts {
        flex-direction: column;
        gap: 8px;
    }
    
    .prompt-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dark theme enhancements */
body.dark-version .ai-image-editor-container {
    background: rgba(15, 15, 25, 0.98);
    border-color: rgba(78, 78, 255, 0.2);
}

body.dark-version .chat-container,
body.dark-version .control-panel {
    background: rgba(10, 10, 20, 0.9);
}

body.dark-version .modal-content {
    background: rgba(15, 15, 25, 0.98);
}
