/**
 * Gemini Chat Widget Styles
 * Premium dark theme matching SPARK.AI aesthetic
 */

/* Chat Widget Container */
.gemini-chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    font-family: 'Avenir Next', 'Avenir', sans-serif;
}

/* Toggle Button */
.gemini-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d95d1e 0%, #bf4d15 100%);
    border: none;
    box-shadow: 0 8px 24px rgba(217, 93, 30, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    color: white;
}

.gemini-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(217, 93, 30, 0.6);
}

.gemini-chat-toggle:active {
    transform: scale(0.95);
}

.gemini-chat-toggle .close-icon {
    display: none;
    position: absolute;
}

.gemini-chat-toggle.active .chat-icon {
    display: none;
}

.gemini-chat-toggle.active .close-icon {
    display: block;
}

/* Chat Window */
.gemini-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 4rem);
    height: 600px;
    max-height: calc(100vh - 180px);
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.gemini-chat-widget.open .gemini-chat-window {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Chat Header */
.gemini-chat-header {
    padding: 1.5rem;
    background: rgba(26, 26, 26, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.gemini-chat-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.gemini-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(217, 93, 30, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.gemini-chat-avatar img {
    width: 100%;
    height: auto;
    opacity: 0.9;
}

.gemini-chat-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: 0.05em;
}

.gemini-chat-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27c93f;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Gemini Branding */
.gemini-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.gemini-logo {
    height: 24px;
    width: auto;
    opacity: 0.9;
}

.powered-by {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 400;
}

.gemini-chat-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.gemini-chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #d95d1e;
}

/* Messages Container */
.gemini-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.gemini-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.gemini-chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.gemini-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.gemini-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Welcome Message */
.gemini-welcome-message {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.gemini-welcome-message .msg-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gemini-welcome-message .msg-avatar img {
    width: 100%;
    height: auto;
    opacity: 0.8;
}

.gemini-welcome-message .msg-content {
    flex: 1;
}

.gemini-welcome-message .msg-sender {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.gemini-welcome-message .msg-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Message Styles */
.gemini-message {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.gemini-message .msg-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gemini-message .msg-avatar img {
    width: 100%;
    height: auto;
    opacity: 0.8;
}

.gemini-message .msg-content {
    flex: 1;
    max-width: 75%;
}

.gemini-message.user-message .msg-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.gemini-message .msg-sender {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.gemini-message .msg-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    padding: 0.875rem 1rem;
    border-radius: 12px;
    word-wrap: break-word;
}

.gemini-message.ai-message .msg-text {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.gemini-message.user-message .msg-text {
    background: linear-gradient(135deg, rgba(217, 93, 30, 0.2) 0%, rgba(191, 77, 21, 0.2) 100%);
    border: 1px solid rgba(217, 93, 30, 0.3);
}

/* System Message */
.gemini-system-message {
    text-align: center;
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
}

.gemini-system-message .msg-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* Typing Indicator */
.gemini-typing-indicator {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0 1.5rem 1rem;
}

.gemini-typing-indicator .msg-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gemini-typing-indicator .msg-avatar img {
    width: 100%;
    height: auto;
    opacity: 0.8;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: typingDot 1.4s ease-in-out infinite;
}

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

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

@keyframes typingDot {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Input Area */
.gemini-chat-input-area {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.gemini-chat-input {
    flex: 1;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-family: 'Avenir', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.gemini-chat-input:focus {
    border-color: rgba(217, 93, 30, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(217, 93, 30, 0.1);
}

.gemini-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.gemini-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(135deg, #d95d1e 0%, #bf4d15 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.gemini-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 93, 30, 0.4);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .gemini-chat-widget {
        bottom: 1rem;
        right: 1rem;
    }

    .gemini-chat-toggle {
        width: 56px;
        height: 56px;
    }

    .gemini-chat-window {
        width: calc(100vw - 2rem);
        height: calc(100vh - 140px);
        bottom: 72px;
        right: 0;
    }
}

/* Smooth animations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}