:root {
    --primary-color: #fd7e14;
    --primary-hover: #f76707;
    --bg-color: #1a1a1a;
    --chat-bg: #242424;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --message-user-bg: #fd7e14;
    --message-bot-bg: #2d2d2d;
    --message-user-border: #f76707;
    --message-bot-border: #343434;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.container {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
}

.chat-wrapper {
    background-color: var(--chat-bg);
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    box-shadow: none;
}

.header {
    padding: 0.75rem;
    border-bottom: 1px solid #343434;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
    min-height: 60px;
    flex-shrink: 0;
    background-color: #1a1a1a;
}

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

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.message-wrapper {
    display: flex;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
    animation: fadeIn 0.3s ease-in-out;
    align-items: flex-end;
    gap: 8px;
}

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

.message-wrapper.user {
    justify-content: flex-end;
}

.message-wrapper.bot {
    justify-content: flex-start;
}

.message {
    max-width: 85%;
    padding: 0.625rem 0.875rem;
    border-radius: 12px;
    font-size: 0.9375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user {
    background-color: var(--message-user-bg);
    color: white;
    border: 1px solid var(--message-user-border);
    border-top-right-radius: 4px;
    margin-left: auto;
    order: 0;
}

.message.bot {
    background-color: var(--message-bot-bg);
    color: var(--text-primary);
    border: 1px solid var(--message-bot-border);
    border-top-left-radius: 4px;
    margin-right: auto;
    order: 1;
}

/* Styles for formatted bot messages */
.message.bot h1 {
    font-size: 1.5rem;
    margin: 0.75rem 0 0.5rem;
    border-bottom: 1px solid #454545;
    padding-bottom: 0.25rem;
}

.message.bot h2 {
    font-size: 1.25rem;
    margin: 0.75rem 0 0.5rem;
    border-bottom: 1px solid #454545;
    padding-bottom: 0.25rem;
}

.message.bot h3 {
    font-size: 1.125rem;
    margin: 0.5rem 0 0.25rem;
}

.message.bot code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background-color: #1a1a1a;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-size: 0.875rem;
}

.message.bot pre {
    background-color: #1a1a1a;
    padding: 0.75rem;
    border-radius: 4px;
    margin: 0.5rem 0;
    overflow-x: auto;
    width: 100%;
}

.message.bot pre code {
    background-color: transparent;
    padding: 0;
    white-space: pre;
    display: block;
    color: #e9ecef;
}

.message.bot ul, .message.bot ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
    padding-left: 0.5rem;
}

.message.bot li {
    margin-bottom: 0.25rem;
}

.message.bot strong {
    font-weight: 600;
}

.message.bot em {
    font-style: italic;
}

.message.bot a {
    color: var(--primary-color);
    text-decoration: underline;
    word-break: break-all;
}

.message.bot a:hover {
    color: var(--primary-hover);
}

.message.bot blockquote {
    border-left: 3px solid var(--primary-color);
    padding-left: 0.75rem;
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.message.bot hr {
    border: none;
    border-top: 1px solid #454545;
    margin: 1rem 0;
}

.message.bot del {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Add syntax highlighting styles for code blocks */
.message.bot pre.language-js code,
.message.bot pre.language-javascript code {
    color: #dcdcaa;
}

.message.bot pre.language-python code {
    color: #569cd6;
}

.message.bot pre.language-html code {
    color: #ce9178;
}

.message.bot pre.language-css code {
    color: #d7ba7d;
}

.input-container {
    padding: 0.75rem;
    background: #1a1a1a;
    border-top: 1px solid #343434;
    flex-shrink: 0;
}

.markdown-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding: 0 0.5rem;
    text-align: center;
}

.input-form {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.message-input {
    flex: 1;
    padding: 0.625rem 5rem 0.625rem 0.875rem;
    border: 1px solid #343434;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    min-height: 42px;
    resize: none;
    background-color: #2d2d2d;
    color: var(--text-primary);
}

.message-input::placeholder {
    color: var(--text-secondary);
}

.message-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(253, 126, 20, 0.2);
}

.send-button {
    padding: 0.625rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.send-button:hover {
    background-color: var(--primary-hover);
}

.send-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.new-chat-button {
    padding: 0.4375rem 0.875rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
}

.new-chat-button:hover {
    background-color: var(--primary-hover);
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #343434;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #454545;
}

.char-counter {
    position: absolute;
    right: 75px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-secondary);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid #343434;
}

@media (max-width: 480px) {
    .header {
        padding: 0.625rem;
    }
    
    .logo {
        height: 28px;
    }
    
    .new-chat-button {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .chat-container {
        padding: 0.75rem;
    }
    
    .message {
        max-width: 90%;
        font-size: 0.875rem;
    }
    
    .input-container {
        padding: 0.625rem;
    }
    
    .send-button {
        width: 38px;
        height: 38px;
        padding: 0.5rem;
    }
    
    .send-icon {
        width: 18px;
        height: 18px;
    }
}

.suggestion-bubbles {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    padding: 0 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding-left: max(15px, calc(50% - 300px));
    padding-right: max(15px, calc(50% - 300px));
}

.suggestion-bubbles::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.suggestion-bubble {
    background-color: #2d2d2d;
    border: 1px solid #fd7e14;
    color: var(--text-primary);
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.suggestion-bubble:hover {
    background-color: #fd7e14;
    color: #fff;
    transform: scale(1.02);
}

.suggestion-bubbles.hidden {
    display: none;
}

.waiting-animation {
    display: none;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 15px;
    height: 25px; /* Adjust based on your GIF size */
}

.waiting-animation.visible {
    display: flex;
}

.waiting-animation img {
    height: 100%;
    width: auto;
}

@media (max-width: 600px) {
    .suggestion-bubbles {
        padding: 0 10px;
    }
    
    .suggestion-bubble {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #242424;
    padding: 1.5rem;
    border-radius: 12px;
    max-width: 90%;
    width: 360px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid #343434;
}

.redirect-modal-content {
    text-align: center;
    background: linear-gradient(to bottom, #242424, #1a1a1a);
    border: 1px solid #343434;
}

.modal-logo {
    width: 120px;
    height: auto;
    margin: 0 auto 1rem;
    display: block;
}

.modal-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    text-align: center;
}

.modal-content p {
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.modal-button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-button.cancel {
    background-color: #2d2d2d;
    border: 1px solid #343434;
    color: var(--text-primary);
}

.modal-button.cancel:hover {
    background-color: #343434;
}

.modal-button.confirm {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: white;
}

.modal-button.confirm:hover {
    background-color: var(--primary-hover);
}

.redirect-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    margin: 0.5rem 0;
    background-color: var(--primary-color);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.redirect-link:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.website-text {
    font-size: 1.125rem;
}

.external-link-icon {
    transition: transform 0.3s ease;
}

.redirect-link:hover .external-link-icon {
    transform: translate(2px, -2px);
}

/* Hide main content when redirect modal is shown */
.container.hidden {
    display: none;
}

/* Rate limit modal specific styles */
#rateLimitModal .modal-content {
    border-left: 4px solid #ff4d4d;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Responsive styles for modals in iframe */
@media (max-width: 480px) {
    .modal-content {
        max-width: 95%;
        width: 320px;
        padding: 1.2rem;
    }
    
    .modal-content h3 {
        font-size: 1.1rem;
    }
    
    .modal-content p {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }
    
    .modal-logo {
        width: 80px;
    }
}

.user-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    order: 1;
    margin-left: 8px;
}

.bot-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    order: 0;
    margin-right: 8px;
} 
