/* Base styles */
:root {
    --primary-color: #4a76a8;
    --primary-hover: #365e89;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #ddd;
    --sidebar-width: 280px;
    --header-height: 60px;
    --footer-height: 40px;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: #f5f5f5;
    line-height: 1.6;
}

/* Chat container */
.chatbot-container {
    display: flex;
    height: 100vh;
    background-color: white;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--light-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar .logo {
    padding: 20px;
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.sidebar .logo i {
    margin-right: 10px;
    color: var(--primary-color);
}

.new-chat-btn {
    margin: 15px;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

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

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

.sidebar-nav {
    display: none !important;
}

.recent-chats {
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto;
}

.recent-chats h3 {
    font-size: 14px;
    color: #a0a0c0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    padding-left: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-chats h3 i {
    font-size: 16px;
    color: #4a76a8;
}

.search-box {
    position: relative;
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    padding-left: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 13px;
}

.search-box input::placeholder {
    color: #666;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
}

.conversation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.conversation-item {
    margin-bottom: 6px;
}

.conversation-link {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a0c0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.conversation-link:hover {
    background: rgba(74, 118, 168, 0.1);
    border-color: rgba(74, 118, 168, 0.2);
    color: #fff;
    transform: translateX(2px);
}

.conversation-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.conversation-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(74, 118, 168, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a76a8;
    font-size: 14px;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-title {
    font-size: 13px;
    font-weight: 500;
    color: inherit;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-timestamp {
    font-size: 11px;
    color: #666;
}

.no-conversations {
    padding: 20px;
    text-align: center;
    color: #666;
}

.no-conversations p {
    margin: 0 0 4px;
    font-size: 13px;
    color: #a0a0c0;
}

.no-conversations small {
    font-size: 11px;
    opacity: 0.7;
}

/* Main chat area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0; /* Prevent flex item from overflowing */
    position: relative;
}

.chat-header {
    flex: 0 0 var(--header-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
    background: white;
    z-index: 10;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    display: none;
}

.upgrade-section {
    display: flex;
    align-items: center;
}

.upgrade-section span {
    margin-right: 15px;
    font-size: 14px;
}

.upgrade-btn {
    padding: 5px 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-btn {
    background: none;
    border: none;
    margin-right: 0;
    font-size: 16px;
    color: #666;
    cursor: pointer;
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.conversation-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Critical for Firefox */
    position: relative;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.welcome-message {
    text-align: center;
    margin: auto;
    max-width: 600px;
    padding: 30px;
}

.welcome-message .bot-icon {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.welcome-message h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.welcome-message p {
    color: #666;
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
    max-width: 100%;
}

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

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

.ai-message {
    justify-content: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.user-message .message-avatar {
    background-color: #5c5c5c;
    order: 2;
    margin-left: 10px;
}

.ai-message .message-avatar {
    margin-right: 10px;
}

.message-content {
    max-width: 70%;
}

.message-bubble {
    font-size: 16px !important;
    line-height: 1.7 !important;
    white-space: pre-wrap !important;
    max-width: 800px !important;
    margin: 0 auto !important;
}

.user-message .message-bubble {
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message .message-bubble {
    background-color: #f0f0f0 !important;
    color: #1a1a1a !important;
    padding: 24px 28px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Main topic introduction */
.ai-message .message-bubble > p:first-of-type {
    font-size: 17px !important;
    color: #2c2c2c !important;
    margin-bottom: 20px !important;
    line-height: 1.6 !important;
}

/* Numbered sections */
.ai-message .message-bubble strong {
    display: block !important;
    font-size: 16px !important;
    color: #4a76a8 !important;
    margin-top: 20px !important;
    margin-bottom: 8px !important;
    padding-bottom: 4px !important;
    border-bottom: 1px solid rgba(74, 118, 168, 0.2) !important;
}

/* Section content */
.ai-message .message-bubble p {
    margin-bottom: 15px !important;
    padding-left: 8px !important;
}

/* Scripture references and citations */
.ai-message .message-bubble cite {
    display: inline-block !important;
    color: #666 !important;
    font-size: 14px !important;
    font-style: normal !important;
    background: rgba(74, 118, 168, 0.1) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    margin-left: 4px !important;
}

/* Add subtle dividers between major sections */
.ai-message .message-bubble hr {
    border: none !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    margin: 20px 0 !important;
}

.typing-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    margin-right: 4px;
    background-color: #666;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.3s infinite;
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Chat input area */
.chat-input-area {
    flex: 0 0 auto;
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
    background: white;
    z-index: 10;
    position: relative;
    margin-bottom: 0;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
    margin-bottom: 0;
}

.input-wrapper input {
    flex-grow: 1;
    border: none;
    outline: none;
    padding: 8px 0;
    font-size: 16px;
    font-family: inherit;
}

.voice-btn, .send-btn {
    background: none;
    border: none;
    margin-left: 8px;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.send-btn {
    background-color: var(--primary-color);
    color: white;
}

.send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.input-options {
    display: none !important;
}

/* Suggestion buttons container */
.suggestion-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.suggestion-buttons::-webkit-scrollbar {
    width: 4px;
}

.suggestion-buttons::-webkit-scrollbar-track {
    background: transparent;
}

.suggestion-buttons::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Category headers */
.suggestion-category {
    grid-column: 1 / -1;
    font-size: 15px;
    font-weight: 600;
    color: #8892a0;
    margin-top: 15px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-category i {
    font-size: 16px;
}

/* Individual suggestion buttons */
.suggestion-buttons button {
    background: linear-gradient(135deg, rgba(74, 118, 168, 0.05) 0%, rgba(74, 118, 168, 0.1) 100%);
    border: 1px solid rgba(74, 118, 168, 0.15);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #a0a0c0;
    cursor: pointer;
    white-space: normal;
    text-align: left;
    line-height: 1.3;
    height: 100%;
    min-height: 48px;
    width: 100%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.suggestion-buttons button:nth-child(4n+1) {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05) 0%, rgba(76, 175, 80, 0.1) 100%);
    border-color: rgba(76, 175, 80, 0.15);
}

.suggestion-buttons button:nth-child(4n+2) {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.05) 0%, rgba(33, 150, 243, 0.1) 100%);
    border-color: rgba(33, 150, 243, 0.15);
}

.suggestion-buttons button:nth-child(4n+3) {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.05) 0%, rgba(156, 39, 176, 0.1) 100%);
    border-color: rgba(156, 39, 176, 0.15);
}

.suggestion-buttons button:nth-child(4n+4) {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.05) 0%, rgba(255, 152, 0, 0.1) 100%);
    border-color: rgba(255, 152, 0, 0.15);
}

.suggestion-buttons button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.suggestion-buttons button:nth-child(4n+1):hover {
    color: #4CAF50;
    border-color: rgba(76, 175, 80, 0.3);
}

.suggestion-buttons button:nth-child(4n+2):hover {
    color: #2196F3;
    border-color: rgba(33, 150, 243, 0.3);
}

.suggestion-buttons button:nth-child(4n+3):hover {
    color: #9C27B0;
    border-color: rgba(156, 39, 176, 0.3);
}

.suggestion-buttons button:nth-child(4n+4):hover {
    color: #FF9800;
    border-color: rgba(255, 152, 0, 0.3);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chatbot-container {
        height: 100%;
        height: -webkit-fill-available;
    }

    .messages-container {
        padding: 15px;
    }

    .message-content {
        max-width: 100%;
    }

    .input-wrapper {
        padding: 6px 12px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .upgrade-section span {
        display: none;
    }
    
    .input-options {
        display: none;
    }
    
    .suggestion-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0 12px;
        max-height: 280px;
    }
    
    .suggestion-buttons button {
        padding: 8px 10px;
        min-height: 42px;
        font-size: 11px;
    }
    
    .suggestion-category {
        font-size: 14px;
        margin-top: 12px;
        margin-bottom: 6px;
    }

    .recent-chats {
        padding: 12px;
    }
    
    .search-box input {
        padding: 6px 10px;
        padding-left: 28px;
        font-size: 12px;
    }
    
    .conversation-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .conversation-title {
        font-size: 12px;
    }
    
    .conversation-timestamp {
        font-size: 10px;
    }
}

/* iOS height fix */
@supports (-webkit-touch-callout: none) {
    .chatbot-container {
        height: -webkit-fill-available;
    }
}

/* Share dialog styles */
.share-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.share-dialog.active {
    display: flex;
}

.share-dialog-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.share-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.share-dialog-header h3 {
    margin: 0;
    font-size: 18px;
}

.share-dialog-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
}

.share-dialog-form {
    margin-bottom: 20px;
}

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

.share-expiration {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

.share-url-container {
    display: flex;
    margin-top: 15px;
}

.share-url {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    background-color: #f8f9fa;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    padding: 10px 15px;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.copy-btn:hover {
    background-color: #365e89;
}

.share-btn-container {
    text-align: center;
    margin-top: 20px;
}

.create-share-btn {
    padding: 10px 20px;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.create-share-btn:hover {
    background-color: #365e89;
}

.share-status {
    margin-top: 15px;
    text-align: center;
    color: #4CAF50;
    font-weight: 500;
    display: none;
}

/* Keep the new chat button visible */
.new-chat-btn {
    margin-bottom: 0;
}

/* Ensure logo stays visible */
.logo {
    margin-bottom: 20px;
}

.user-profile {
    display: none !important;
} 