:root {
    /* Light mode (default) */
    --bg-color: #f8f9fa;
    --text-color: #202124;
    --border-color: #dfe1e5;
    --hover-border-color: #dadce0;
    --button-bg: #1a73e8;
    --button-hover-bg: #1557b0;
    --tool-bg: white;
    --tool-hover-bg: #f8f9fa;
    --shadow-color: rgba(32, 33, 36, 0.28);
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #888;
    --scrollbar-thumb-hover: #555;
    --clear-button-bg: #ccc;
    --clear-button-hover: #999;
}

[data-theme="dark"] {
    --bg-color: #202124;
    --text-color: #e8eaed;
    --border-color: #5f6368;
    --hover-border-color: #80868b;
    --button-bg: #8ab4f8;
    --button-hover-bg: #93b7f7;
    --tool-bg: #303134;
    --tool-hover-bg: #3c4043;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --scrollbar-track: #303134;
    --scrollbar-thumb: #5f6368;
    --scrollbar-thumb-hover: #80868b;
    --clear-button-bg: #5f6368;
    --clear-button-hover: #80868b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    text-align: center;
}

.logo h1 {
    color: var(--text-color);
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.search-container {
    width: 100%;
}

.search-box {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.search-input-container {
    position: relative;
    width: 100%;
}

.clear-button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background-color: var(--clear-button-bg);
    color: white;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

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

.clear-button.visible {
    display: flex;
}

#searchInput {
    width: 100%;
    padding: 20px;
    padding-right: 45px;
    font-size: 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    outline: none;
    transition: all 0.3s ease;
    resize: none;
    min-height: 120px;
    line-height: 1.5;
    font-family: inherit;
    background-color: var(--bg-color);
    color: var(--text-color);
}

#searchInput:hover,
#searchInput:focus {
    box-shadow: 0 1px 6px var(--shadow-color);
    border-color: var(--hover-border-color);
}

#searchInput::placeholder {
    color: var(--text-color);
    opacity: 0.7;
}

#searchInput::-webkit-scrollbar {
    width: 8px;
}

#searchInput::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

#searchInput::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

#searchInput::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

#startChat {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 1rem;
    background-color: var(--button-bg);
    color: var(--bg-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#startChat:hover {
    background-color: var(--button-hover-bg);
}

.ai-tools {
    margin-top: 30px;
}

.tool-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.tool-option {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background-color: var(--tool-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tool-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tool-option.disabled::after {
    content: 'Coming Soon';
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--button-bg);
    color: var(--bg-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
}

.tool-option.disabled:hover {
    background-color: var(--tool-bg);
    border-color: var(--border-color);
    transform: none;
}

.tool-option.disabled .tool-icon {
    filter: grayscale(100%);
}

.tool-option:hover {
    background-color: var(--tool-hover-bg);
    border-color: var(--hover-border-color);
}

.tool-option input[type="checkbox"] {
    margin-right: 8px;
}

.tool-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.tool-option:hover .tool-icon {
    transform: scale(1.1);
}

/* Language Selector */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-selector select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--tool-bg);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s;
}

.language-selector select:hover {
    border-color: var(--hover-border-color);
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: background-color 0.3s ease;
}

.theme-toggle:hover {
    background-color: var(--tool-hover-bg);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* RTL Support */
[dir="rtl"] .language-selector {
    right: auto;
    left: 20px;
}

[dir="rtl"] .theme-toggle {
    left: auto;
    right: 20px;
}

[dir="rtl"] .search-box {
    flex-direction: row-reverse;
}

[dir="rtl"] .tool-option {
    flex-direction: row-reverse;
}

[dir="rtl"] .tool-option input[type="checkbox"] {
    margin-left: 8px;
    margin-right: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .logo h1 {
        font-size: 2rem;
    }

    #searchInput {
        padding: 15px;
        font-size: 1rem;
    }

    .tool-options {
        gap: 10px;
    }

    .tool-option {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .tool-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.8rem;
    }

    #searchInput {
        padding: 12px;
    }

    #startChat {
        width: 100%;
        padding: 10px;
    }

    .tool-options {
        flex-direction: column;
        align-items: center;
    }

    .tool-option {
        width: 100%;
        justify-content: center;
    }

    .tool-icon {
        width: 18px;
        height: 18px;
    }
}

/* Chat History Styles */
.history-toggle {
    position: absolute;
    top: 20px;
    left: 60px;
    z-index: 1000;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: background-color 0.3s ease;
}

.history-toggle:hover {
    background-color: var(--tool-hover-bg);
}

.history-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.chat-history {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background-color: var(--bg-color);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 5px var(--shadow-color);
    transition: left 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.chat-history.visible {
    left: 0;
}

.history-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.history-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
    flex: 1;
    text-align: center;
}

.history-actions {
    display: flex;
    gap: 8px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.clear-history,
.close-history {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: bold;
    width: 32px;
    height: 32px;
}

.close-history {
    font-family: Arial, sans-serif;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-color);
    opacity: 0.8;
}

.clear-history:hover,
.close-history:hover {
    background-color: var(--tool-hover-bg);
    transform: scale(1.1);
    opacity: 1;
}

[data-theme="dark"] .close-history {
    color: var(--text-color);
    opacity: 0.8;
}

[data-theme="dark"] .close-history:hover {
    opacity: 1;
}

.clear-history svg,
.close-history svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* RTL Support for history actions */
[dir="rtl"] .history-actions {
    right: auto;
    left: 20px;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

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

.history-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 10px;
    padding: 0 12px;
    opacity: 0.8;
}

.bookmarked-section .section-title {
    color: var(--button-bg);
}

.history-item {
    padding: 12px;
    margin-bottom: 8px;
    background-color: var(--tool-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding-right: 80px;
}

.history-item.bookmarked {
    border-color: var(--button-bg);
    background-color: var(--tool-hover-bg);
}

.history-item:hover {
    background-color: var(--tool-hover-bg);
    border-color: var(--primary-color);
}

.history-item .query {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 8px;
    word-break: break-word;
}

.history-item .timestamp {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    margin-bottom: 8px;
}

.history-item .tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.history-item .tool-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.history-actions {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-item:hover .history-actions {
    opacity: 1;
}

.bookmark-history-item,
.delete-history-item {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text-color);
    transition: all 0.3s ease;
}

.bookmark-history-item:hover,
.delete-history-item:hover {
    background-color: var(--tool-hover-bg);
    color: var(--text-color);
}

.bookmark-history-item svg,
.delete-history-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* RTL Support for history actions */
[dir="rtl"] .history-item {
    padding-right: 12px;
    padding-left: 80px;
}

[dir="rtl"] .history-actions {
    right: auto;
    left: 8px;
}

/* RTL Support for Chat History */
[dir="rtl"] .history-toggle {
    left: auto;
    right: 60px;
}

[dir="rtl"] .chat-history {
    left: auto;
    right: -320px;
    border-right: none;
    border-left: 1px solid var(--border-color);
    box-shadow: -2px 0 5px var(--shadow-color);
}

[dir="rtl"] .chat-history.visible {
    right: 0;
}

/* Responsive Design for Chat History */
@media (max-width: 768px) {
    .chat-history {
        width: 280px;
    }
    
    .history-toggle {
        left: 50px;
    }
    
    [dir="rtl"] .history-toggle {
        left: auto;
        right: 50px;
    }
    
    .history-header {
        padding: 15px;
    }
    
    .history-actions {
        right: 15px;
    }
    
    [dir="rtl"] .history-actions {
        right: auto;
        left: 15px;
    }
}

@media (max-width: 480px) {
    .chat-history {
        width: 100%;
        left: -100%;
    }
    
    [dir="rtl"] .chat-history {
        right: -100%;
    }
    
    .history-toggle {
        left: 40px;
    }
    
    [dir="rtl"] .history-toggle {
        left: auto;
        right: 40px;
    }
    
    .history-header {
        padding: 12px;
    }
    
    .history-actions {
        right: 12px;
    }
    
    [dir="rtl"] .history-actions {
        right: auto;
        left: 12px;
    }
} 