:root {
    --bg-dark: #0f0c29;
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-gemini: #b06ab3;
    --accent-banana: #f1c40f;
    --accent-gradient: linear-gradient(45deg, #b06ab3, #4568dc);
    --banana-gradient: linear-gradient(45deg, #f1c40f, #f39c12);
    --story-gradient: linear-gradient(45deg, #8B5CF6, #D946EF);
    --success: #2ecc71;
    --error: #e74c3c;
    --font-main: 'Outfit', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    background-image: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4568dc;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #b06ab3;
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #f1c40f;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
    opacity: 0.2;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -50px) rotate(10deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }
}

.app-container {
    width: 95%;
    max-width: 1400px;
    height: 92vh;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 35px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: var(--font-display);
}

.logo-container i {
    font-size: 1.8rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-container h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-container .accent {
    color: var(--accent-banana);
    font-weight: 300;
}

.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 16px;
    border-radius: 50px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--error);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--error);
    transition: all 0.3s ease;
}

.status-dot.active {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.main-content {
    flex: 1;
    display: flex;
    gap: 30px;
    overflow: hidden;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 30px;
}

.settings-panel {
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 12px 15px;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-gemini);
    box-shadow: 0 0 15px rgba(176, 106, 179, 0.2);
}

.input-group textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 12px 15px;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    max-height: 150px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--accent-gemini);
    box-shadow: 0 0 15px rgba(176, 106, 179, 0.2);
}

.input-group textarea::-webkit-scrollbar {
    width: 4px;
}

.input-group textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.helper-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: -5px;
}

label .optional {
    font-size: 0.75rem;
    opacity: 0.6;
    font-weight: 400;
}

.model-selector {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.model-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.model-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.model-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.model-option.active {
    background: rgba(176, 106, 179, 0.15);
    border-color: var(--accent-gemini);
}

.model-option:nth-child(2).active {
    background: rgba(241, 196, 15, 0.15);
    border-color: var(--accent-banana);
}

.model-option.story-option .model-icon i {
    color: #D946EF;
}

.model-option.story-option.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: #D946EF;
    box-shadow: 0 0 20px rgba(217, 70, 239, 0.2);
}

.model-option.story-option.active .model-name {
    background: linear-gradient(45deg, #8B5CF6, #D946EF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.model-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-info {
    flex: 1;
}

.model-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.model-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.chat-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-history::-webkit-scrollbar {
    width: 6px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.welcome-message {
    text-align: center;
    margin-top: 80px;
    padding: 40px;
    opacity: 0.8;
}

.welcome-message h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.welcome-message p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.message {
    display: flex;
    gap: 15px;
    animation: fadeIn 0.3s ease;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--glass-border);
}

.message.ai .message-avatar {
    background: var(--accent-gradient);
}

.message.ai.banana .message-avatar {
    background: var(--banana-gradient);
}

.message.ai.story .message-avatar {
    background: linear-gradient(45deg, #8B5CF6, #D946EF);
}

.message-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.6;
    font-size: 0.95rem;
}

.message.user .message-content {
    background: rgba(69, 104, 220, 0.2);
    border-bottom-right-radius: 4px;
}

.message.ai .message-content {
    border-top-left-radius: 4px;
}

.message.ai.story .message-content {
    background: rgba(139, 92, 246, 0.15);
    border-left: 3px solid #D946EF;
}

.message-content img {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 10px;
}

/* Chat image thumbnail - SMALL */
.message .message-content .chat-image-thumbnail {
    max-width: 50px;
    max-height: 50px;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    margin-top: 8px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-content.image-content {
    background: transparent;
    padding: 0;
    max-width: 600px;
}

.generated-image-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.generated-image-container:hover {
    transform: scale(1.02);
}

.generated-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.generated-image:hover {
    transform: scale(1.02);
}

.download-image-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: 500;
}

.generated-image-container:hover .download-image-btn {
    opacity: 1;
}

.download-image-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.input-area {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--glass-border);
}

.input-wrapper {
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    align-items: flex-end;
    min-height: 60px;
}

.input-wrapper:focus-within {
    border-color: var(--accent-gemini);
    box-shadow: 0 0 15px rgba(176, 106, 179, 0.1);
}

textarea#promptInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    resize: none;
    padding: 8px 0;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
}

textarea#promptInput::-webkit-scrollbar {
    width: 4px;
}

textarea#promptInput::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

textarea#promptInput:focus {
    outline: none;
}

button#sendBtn {
    background: var(--accent-gradient);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

button#sendBtn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(176, 106, 179, 0.4);
}

button#sendBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #444;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.upload-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: scale(1.05);
}

.upload-btn i {
    font-size: 1.1rem;
}

body.story-mode-active .upload-btn {
    background: linear-gradient(45deg, rgba(139, 92, 246, 0.3), rgba(217, 70, 239, 0.3));
    color: #D946EF;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(217, 70, 239, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(217, 70, 239, 0.5);
    }
}

.image-preview-container {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.image-preview {
    max-width: 100px;
    max-height: 80px;
    border-radius: 8px;
    display: block;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--error);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

.remove-image-btn:hover {
    transform: scale(1.1);
    background: #c0392b;
}

body.story-mode-active .input-wrapper {
    border-color: rgba(217, 70, 239, 0.5);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

body.story-mode-active .chat-interface {
    border-color: rgba(217, 70, 239, 0.3);
}

@media (max-width: 900px) {
    .app-container {
        min-height: 95vh;
        margin: 20px auto;
    }

    .main-content {
        flex-direction: column;
        overflow: visible;
    }

    .settings-panel {
        width: 100%;
    }

    .chat-interface {
        height: 600px;
    }

    .welcome-message h2 {
        font-size: 2rem;
    }
}
/* Veo 3 Video Model Styles */
.model-option.veo-option .model-icon i {
    color: #ff6b6b;
}

.model-option.veo-option.active {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 154, 87, 0.15));
    border-color: #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.2);
}

.model-option.veo-option.active .model-name {
    background: linear-gradient(45deg, #ff6b6b, #ff9a57);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.message.ai.veo .message-avatar {
    background: linear-gradient(45deg, #ff6b6b, #ff9a57);
}

.message.ai.veo .message-content {
    background: rgba(255, 107, 107, 0.1);
    border-left: 3px solid #ff6b6b;
}

body.veo-mode-active .input-wrapper {
    border-color: rgba(255, 107, 107, 0.5);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.2);
}

body.veo-mode-active .upload-btn {
    background: linear-gradient(45deg, rgba(255, 107, 107, 0.3), rgba(255, 154, 87, 0.3));
    color: #ff6b6b;
}

.generated-video-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
}

.generated-video-container video {
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    display: block;
}

.download-video-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: linear-gradient(45deg, #ff6b6b, #ff9a57);
    color: white;
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: 500;
}

.generated-video-container:hover .download-video-btn {
    opacity: 1;
}

.vertex-config {
    background: rgba(255, 107, 107, 0.05);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 12px;
    padding: 15px;
}

.vertex-config select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    width: 100%;
    cursor: pointer;
}

.vertex-config select:focus {
    outline: none;
    border-color: #ff6b6b;
}

.vertex-config select option {
    background: #1a1a2e;
    color: var(--text-primary);
}

/* Veo 3 Frame Controls */
.veo-frame-controls {
    background: rgba(255, 107, 107, 0.05);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
}

.frame-upload-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.frame-upload {
    flex: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(255, 107, 107, 0.3);
    border-radius: 12px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.frame-upload:hover {
    border-color: rgba(255, 107, 107, 0.6);
    background: rgba(255, 107, 107, 0.1);
}

.frame-upload.has-image {
    border-style: solid;
    border-color: #ff6b6b;
}

.frame-upload label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 20px;
    text-align: center;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.frame-upload label i {
    font-size: 1.5rem;
    color: #ff6b6b;
}

.frame-upload label span {
    font-size: 0.85rem;
}

.frame-upload img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.frame-upload .remove-frame-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    z-index: 10;
    transition: all 0.2s ease;
}

.frame-upload .remove-frame-btn:hover {
    background: #ff0000;
    transform: scale(1.1);
}

.frame-hint {
    display: block;
    text-align: center;
    color: var(--text-secondary);
    opacity: 0.7;
}
