        :root {
            --bg-color: #121212;
            --primary-color: #1f1f1f;
            --secondary-color: #2a2a2a;
            --accent-color: #f0db4f;
            --text-color: #e0e0e0;
            --border-color: rgba(255, 255, 255, 0.15);
            --shadow-color: rgba(0, 0, 0, 0.5);
            --accent-glow: rgba(240, 219, 79, 0.15);
            --glass-bg: rgba(255, 255, 255, 0.05);
            --glass-border: rgba(255, 255, 255, 0.1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--bg-color);
            color: var(--text-color);
            min-height: 100vh;
            position: relative;
            overflow-x: hidden;
        }

        body::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: 
                radial-gradient(ellipse 40% 50% at 20% 20%, var(--accent-glow), transparent),
                radial-gradient(ellipse 40% 50% at 80% 90%, rgba(80, 120, 255, 0.15), transparent);
            animation: background-pan 20s infinite alternate;
            z-index: 0;
        }

        @keyframes background-pan {
            from { transform: translate(0%, 0%); }
            to { transform: translate(10%, -10%); }
        }

        .container {
            position: relative;
            z-index: 1;
            margin: 0 auto;
            display: flex;
            min-height: 100vh;
        }

        /* Left Panel */
        .left-panel {
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            padding: 24px;
            box-shadow: 0 8px 32px var(--shadow-color);
            width: 420px;
            flex-shrink: 0;
        }

        .panel-title {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 8px;
            text-align: center;
            background: linear-gradient(45deg, var(--accent-color), #fff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .panel-subtitle {
            text-align: center;
            color: rgba(255, 255, 255, 0.6);
            font-size: 14px;
            margin-bottom: 32px;
        }

        /* Prompt Section */
        .prompt-section {
            margin-bottom: 32px;
        }

        .section-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--text-color);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .section-title::before {
            content: '';
            width: 4px;
            height: 16px;
            background: var(--accent-color);
            border-radius: 2px;
        }

        .prompt-input {
            width: 100%;
            min-height: 172px;
            padding: 16px;
            background: var(--secondary-color);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            color: var(--text-color);
            font-size: 14px;
            font-family: inherit;
            resize: vertical;
            transition: all 0.3s ease;
        }

        .prompt-input:focus {
            outline: none;
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        .prompt-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        /* Mode Toggle */
        .mode-toggle {
            display: flex;
            background: var(--primary-color);
            border-radius: 12px;
            padding: 4px;
            margin-bottom: 24px;
            border: 1px solid var(--border-color);
        }

        .mode-btn {
            flex: 1;
            padding: 12px;
            background: transparent;
            border: none;
            color: var(--text-color);
            font-size: 14px;
            font-weight: 500;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .mode-btn.active {
            background: var(--accent-color);
            color: var(--bg-color);
        }

        /* Function Cards */
        .functions-grid {
            display: flex;
            justify-content: space-around;
            margin-bottom: 24px;
        }

        .function-card {
            background: var(--primary-color);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            position: relative;
            overflow: hidden;
            width: 75.65px;
            height: 70px;
        }

        .function-card:hover {
            transform: translateY(-2px);
            border-color: var(--accent-color);
            box-shadow: 0 4px 16px rgba(240, 219, 79, 0.2);
        }

        .function-card.active {
            border-color: var(--accent-color);
            background: rgba(240, 219, 79, 0.1);
        }

        .function-card::before {
            content: '';
            position: absolute;
            top: -2px;
            left: -2px;
            right: -2px;
            bottom: -2px;
            background: linear-gradient(45deg, var(--accent-color), transparent, var(--accent-color));
            border-radius: 12px;
            z-index: -1;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .function-card.active::before {
            opacity: 1;
        }

        .function-icon {
            font-size: 18px;
            margin-bottom: 4px;
            margin-top: 8px;
            display: block;
        }

        .function-name {
            font-size: 12px;
            font-weight: 500;
            color: var(--text-color);
            line-height: 1.3;
        }

        /* Dynamic Content Area */
        .dynamic-content {
            margin-bottom: 24px;
        }

        .upload-area {
            display: none;
            border: 2px dashed var(--border-color);
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            background: var(--primary-color);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .upload-area:hover {
            border-color: var(--accent-color);
            background: rgba(240, 219, 79, 0.05);
        }

        .upload-area.show {
            display: block;
        }

        .upload-text {
            color: rgba(255, 255, 255, 0.6);
            font-size: 14px;
            margin-top: 8px;
        }

        .upload-icon {
            font-size: 24px;
            color: var(--accent-color);
            margin-bottom: 8px;
        }

        .image-preview {
            width: 100%;
            max-height: 150px;
            object-fit: cover;
            border-radius: 8px;
            margin-top: 12px;
            display: none;
            border: 1px solid var(--border-color);
        }

        /* Two Images Section */
        .upload-area-dual {
            border: 2px dashed var(--border-color);
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            background: var(--primary-color);
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 16px;
        }

        .upload-area-dual:hover {
            border-color: var(--accent-color);
            background: rgba(240, 219, 79, 0.05);
        }

        .back-btn {
            width: 100%;
            padding: 12px;
            background: var(--secondary-color);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            color: var(--text-color);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 8px;
        }

        .back-btn:hover {
            background: var(--primary-color);
            border-color: var(--accent-color);
            transform: translateY(-1px);
        }

        /* Generate Button */
        .generate-btn {
            width: 100%;
            padding: 16px;
            background: linear-gradient(45deg, var(--accent-color), #f5d32c);
            border: none;
            border-radius: 12px;
            color: var(--bg-color);
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 16px rgba(240, 219, 79, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .generate-btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 6px 24px rgba(240, 219, 79, 0.4);
        }

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

        .generate-btn .spinner {
            width: 20px;
            height: 20px;
            border: 2px solid transparent;
            border-top: 2px solid currentColor;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            display: none;
        }

        .generate-btn.loading .spinner {
            display: block;
        }

        .generate-btn.loading .btn-text {
            display: none;
        }

        /* Right Panel */
        .right-panel {
            background: var(--glass-bg);
            backdrop-filter: blur(3px);
            padding: 24px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
        }

        .result-placeholder {
            text-align: center;
            color: rgba(255, 255, 255, 0.4);
            font-size: 18px;
        }

        .result-placeholder-icon {
            font-size: 64px;
            margin-bottom: 16px;
            opacity: 0.3;
        }

        /* Generated Image Container */
        .image-container {
            width: 100%;
            max-width: 100%;
            position: relative;
            display: none;
        }

        .generated-image {
            width: 100%;
            max-height: 60vh;
            object-fit: contain;
            border-radius: 12px;
            box-shadow: 0 8px 32px var(--shadow-color);
            border: 1px solid var(--border-color);
        }

        .image-actions {
            position: absolute;
            top: 12px;
            right: 12px;
            display: flex;
            gap: 8px;
        }

        .action-btn {
            width: 36px;
            height: 36px;
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            border-radius: 50%;
            color: var(--text-color);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            font-size: 14px;
        }

        .action-btn:hover {
            background: var(--secondary-color);
            transform: scale(1.1);
            box-shadow: 0 4px 12px var(--shadow-color);
        }

        /* Loading Animation */
        .loading-container {
            display: none;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        .loading-spinner {
            width: 60px;
            height: 60px;
            border: 4px solid var(--border-color);
            border-top: 4px solid var(--accent-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        .loading-text {
            color: rgba(255, 255, 255, 0.6);
            font-size: 16px;
        }

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

        /* Mobile Modal Styles */
        .mobile-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.95);
            backdrop-filter: blur(10px);
            z-index: 1000;
            display: none;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .mobile-modal.show {
            display: flex;
        }

        .modal-content {
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            border-radius: 16px;
            padding: 20px;
            width: 100%;
            max-width: 90vw;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            box-shadow: 0 8px 32px var(--shadow-color);
        }

        .modal-image {
            width: 100%;
            max-width: 100%;
            height: auto;
            max-height: 60vh;
            object-fit: contain;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            margin-bottom: 20px;
        }

        .modal-actions {
            display: flex;
            gap: 12px;
            width: 100%;
            flex-wrap: wrap;
        }

        .modal-btn {
            flex: 1;
            min-width: 120px;
            padding: 14px 20px;
            border: none;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .modal-btn.edit {
            background: var(--secondary-color);
            color: var(--text-color);
            border: 1px solid var(--border-color);
        }

        .modal-btn.edit:hover {
            background: var(--primary-color);
            border-color: var(--accent-color);
        }

        .modal-btn.download {
            background: linear-gradient(45deg, #2ed573, #20bf6b);
            color: white;
        }

        .modal-btn.download:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 16px rgba(46, 213, 115, 0.3);
        }

        .modal-btn.new {
            background: linear-gradient(45deg, var(--accent-color), #f5d32c);
            color: var(--bg-color);
        }

        .modal-btn.new:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 16px rgba(240, 219, 79, 0.3);
        }

        .modal-content, .toast {
            max-width: calc(100vw - 40px); /* Garante margem nas laterais */
            overflow-wrap: break-word;
            word-break: break-word;
        }

        /* Mobile Responsive */
        @media (max-width: 768px) {
            .container {
                flex-direction: column;
                padding: 0;
                gap: 0;
                min-height: 100vh;
            }

            .left-panel {
                width: 100%;
                height: 100vh;
                padding: 20px;
                border-radius: 0;
                overflow-y: auto;
            }

            .right-panel {
                display: none !important;
            }

            .functions-grid {
                grid-template-columns: repeat(3, 1fr);
            }

            .function-card {
                padding: 12px 8px;
            }

            .function-icon {
                font-size: 24px;
                margin-bottom: 6px;
            }

            .function-name {
                font-size: 11px;
            }

            .panel-title {
                font-size: 24px;
            }

            .modal-actions {
                flex-direction: column;
            }

            .modal-btn {
                min-width: auto;
                width: 100%;
            }
        }

        @media (max-width: 768px) {
            html, body {
                overflow-x: hidden;
                width: 100%;
                max-width: 100vw;
            }
            
            .container {
                width: 100%;
                max-width: 100vw;
            }
            
            .left-panel {
                width: 100%;
                max-width: 100vw;
                padding: 16px; /* Reduzir um pouco o padding */
            }
        }

        @media (max-width: 480px) {

            .functions-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 8px;
            }

            .function-card {
                padding: 10px 6px;
            }

            .function-icon {
                font-size: 20px;
            }

            .function-name {
                font-size: 10px;
            }

            .left-panel, .right-panel {
                padding: 16px;
            }
        }