:root {
    --primary-color: #8e44ad;
    --secondary-color: #3498db;
    --accent-color: #f39c12;
    --text-color: #333;
    --bg-color: #f5f5f5;
    --card-color: #fff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-color: #ddd;
}

.dark-mode {
    --primary-color: #9b59b6;
    --secondary-color: #2980b9;
    --accent-color: #e67e22;
    --text-color: #f5f5f5;
    --bg-color: #1a1a1a;
    --card-color: #2d2d2d;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --border-color: #444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: var(--card-color);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px var(--shadow-color);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
}

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

.logo {
    height: 50px;
    width: auto;
}

h1 {
    font-size: 2rem;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.header-controls {
    display: flex;
    gap: 10px;
}

.controls {
    margin-bottom: 30px;
}

.prompt-section {
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    min-height: 120px;
    font-size: 16px;
    margin-bottom: 15px;
    background-color: var(--card-color);
    color: var(--text-color);
}

.prompt-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.setting-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--primary-color);
}

select, input[type="number"], input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-color);
    color: var(--text-color);
    font-size: 16px;
}

input[type="range"] {
    width: calc(100% - 50px);
    margin-right: 10px;
    -webkit-appearance: none;
    height: 8px;
    background: var(--border-color);
    border-radius: 5px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.seed-controls {
    display: flex;
    gap: 10px;
}

.seed-controls input {
    flex: 1;
}

.seed-controls button {
    padding: 10px;
    width: 40px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.generate-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

button {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 6px var(--shadow-color);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px var(--shadow-color);
}

button:active {
    transform: translateY(0);
}

#ultraEnhanceBtn {
    background: linear-gradient(45deg, #f39c12, #e74c3c);
}

.result {
    text-align: center;
    margin-bottom: 30px;
}

.loading {
    margin: 30px 0;
}

.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    animation: pulse 1.5s infinite;
}

.loading-bar {
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    border-radius: 5px;
    animation: loading 2s infinite;
}

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

@keyframes loading {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.image-container {
    margin-top: 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    background-color: var(--card-color);
    box-shadow: 0 5px 15px var(--shadow-color);
}

#generatedImage {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: none;
}

.image-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.social-share {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.facebook { background-color: #3b5998; }
.whatsapp { background-color: #25D366; }
.twitter { background-color: #1DA1F2; }

.history-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.history-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

#historyList {
    list-style: none;
    margin-top: 15px;
}

#historyList li {
    padding: 10px 15px;
    margin-bottom: 10px;
    background-color: var(--bg-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

#historyList li:hover {
    background-color: var(--primary-color);
    color: white;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    font-size: 14px;
    color: var(--text-color);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-column:nth-child(n+2) {
        display: none;
    }
    
    .generate-controls {
        flex-direction: column;
    }
    
    .image-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .social-share {
        margin-top: 10px;
    }
    
    .prompt-controls {
        flex-direction: column;
    }
}
/* Tab styles */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn i {
    margin-right: 8px;
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Audio controls styles */
.audio-controls {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

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

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.input-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    min-height: 100px;
    resize: vertical;
}

.input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.voice-description {
    font-size: 14px;
    color: #7f8c8d;
    margin-top: 5px;
    font-style: italic;
}

#tts-generate-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 10px;
}

#tts-generate-btn:hover {
    background-color: #2980b9;
}

#tts-generate-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.audio-result {
    margin-top: 30px;
    display: none;
}

.audio-result h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

audio {
    width: 100%;
    margin-bottom: 15px;
}

.download-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s;
    width: 100%;
}

.download-btn:hover {
    background-color: #219653;
}

.loading .spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Chat Tab Styles */
.chat-container {
    flex: 1;
    min-width: 300px;
    background: rgba(26, 26, 46, 0.7);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    height: 70vh;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 10px;
}

.message {
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    background: var(--primary-color);
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.bot-message {
    background: rgba(255, 255, 255, 0.1);
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input:focus {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.send-button {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.send-button:active {
    transform: translateY(0);
}

.chat-settings-container {
    margin-top: 20px;
    background: rgba(26, 26, 46, 0.7);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.setting-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.setting-input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.setting-input:focus {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.select-input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

.select-input:focus {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.slider-input {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    appearance: none;
    margin-top: 10px;
}

.slider-input::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--secondary-color);
}

.slider-value {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.save-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.save-button:active {
    transform: translateY(0);
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 15px;
    width: fit-content;
    border-bottom-left-radius: 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    margin: 0 2px;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

.copy-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 10px;
    transition: color 0.2s ease;
}

.copy-button:hover {
    color: white;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-online {
    background-color: var(--success-color);
}

.status-offline {
    background-color: var(--danger-color);
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}