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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --bg-body: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dark Mode Colors */
body.dark-mode {
    --text-primary: #f7fafc;
    --text-secondary: #cbd5e0;
    --text-light: #a0aec0;
    --bg-light: #1a202c;
    --bg-white: #2d3748;
    --bg-body: #1a202c;
    --border-color: #4a5568;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    min-height: 100vh;
}

/* Home Page Styles */
.home-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.logo-container {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

.logo {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

/* Eye styling for the O's */
.eye {
    display: inline-block;
    position: relative;
    font-size: 1em;
}

.eye::before {
    content: 'O';
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pupil {
    position: absolute;
    width: 0.35em;
    height: 0.35em;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    border-radius: 50%;
    top: 50%;
    right: 15%;
    transform: translateY(-50%);
}

.tagline {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 300;
}

.search-container {
    width: 100%;
    max-width: 600px;
    animation: fadeInUp 0.6s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-box-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50px;
    padding: 8px 20px;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
    width: 100%;
}

.search-box:focus-within {
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.2), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.3);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-light);
    flex-shrink: 0;
    margin-right: 12px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 12px 0;
    color: var(--text-primary);
    background: transparent;
}

.search-input::placeholder {
    color: var(--text-light);
}

.clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: color 0.2s ease;
    margin-left: 8px;
}

.clear-btn:hover {
    color: var(--text-secondary);
}

.clear-btn svg {
    width: 18px;
    height: 18px;
}

/* Search History Dropdown */
.search-history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    margin-top: 8px;
    overflow: hidden;
    z-index: 1000;
    animation: fadeInUp 0.2s ease-out;
}

.search-history-dropdown ul {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.history-item, .history-clear {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: var(--text-primary);
}

.history-item:hover {
    background: var(--bg-light);
}

.history-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-light);
    flex-shrink: 0;
}

.history-item span {
    font-size: 0.95rem;
    flex: 1;
}

.history-clear {
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-clear:hover {
    background: rgba(239, 68, 68, 0.05);
    color: #dc2626;
}

.history-clear svg {
    width: 18px;
    height: 18px;
    color: currentColor;
    flex-shrink: 0;
}

.search-btn {
    width: auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 48px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

/* Results Page Styles */
.results-page {
    min-height: 100vh;
    background: var(--bg-light);
}

.results-header {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    padding: 12px 30px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-small {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    letter-spacing: -1px;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Small eye styling for header */
.eye-small {
    display: inline-block;
    position: relative;
    font-size: 1em;
}

.eye-small::before {
    content: 'O';
    color: white;
}

.pupil-small {
    position: absolute;
    width: 0.28em;
    height: 0.28em;
    background: white;
    border-radius: 50%;
    top: 50%;
    right: 15%;
    transform: translateY(-50%);
}

.logo-small:hover {
    opacity: 0.9;
}

.search-container-small {
    flex: 1;
    max-width: 600px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-container-small .search-box {
    padding: 6px 16px;
    margin-bottom: 0;
}

.search-container-small .search-input {
    padding: 8px 0;
    font-size: 0.95rem;
}

.search-container-small .search-icon {
    width: 18px;
    height: 18px;
}

.search-btn-small {
    background: var(--bg-white);
    color: var(--primary-color);
    border: none;
    border-radius: 25px;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.search-btn-small:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.results-layout {
    display: flex;
    gap: 40px;
    max-width: 1600px;
    padding: 30px 40px 30px 240px;
}

.results-content {
    flex: 1;
    max-width: 1000px;
}

.results-info {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding-left: 5px;
}

/* AI Summary Styles */
.ai-summary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    animation: fadeInUp 0.5s ease-out;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
}

.ai-header svg {
    width: 22px;
    height: 22px;
}

.ai-content {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.ai-content p {
    margin-bottom: 12px;
}

.sources-label {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-left: 5px;
}

/* Knowledge Panel Styles */
.knowledge-panel {
    width: 380px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    margin-top: 37px;
}

.knowledge-card {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: slideInRight 0.5s ease-out;
}

.knowledge-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.knowledge-body {
    padding: 20px;
}

.knowledge-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.knowledge-extract {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.knowledge-source {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.knowledge-source-icon {
    width: 20px;
    height: 20px;
    color: var(--text-light);
}

.knowledge-source-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.knowledge-source-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.result-item {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    animation: fadeInUp 0.4s ease-out;
}

.result-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.result-url {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.result-favicon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.result-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.result-title:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.result-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.result-tag {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner p {
    color: var(--text-light);
    font-size: 1rem;
}

/* No Results */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.no-results svg {
    width: 80px;
    height: 80px;
    color: var(--text-light);
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.no-results .suggestion {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 3rem;
    }
    
    .pupil {
        width: 0.32em;
        height: 0.32em;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .search-container-small {
        width: 100%;
        max-width: 100%;
    }

    .logo-small {
        font-size: 1.5rem;
    }

    .result-title {
        font-size: 1.1rem;
    }

    .results-layout {
        flex-direction: column;
        padding: 30px 20px;
    }

    .knowledge-panel {
        width: 100%;
        position: static;
        order: -1;
        margin-bottom: 20px;
    }

    .knowledge-image {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 2.5rem;
    }
    
    .pupil {
        width: 0.3em;
        height: 0.3em;
    }

    .tagline {
        font-size: 1rem;
    }

    .search-container {
        max-width: 100%;
    }

    .results-content {
        width: 100%;
    }

    .result-item {
        padding: 16px 18px;
    }

    .results-layout {
        padding: 20px 15px;
    }
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    position: fixed;
    top: 10px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dark-mode-toggle:hover {
    box-shadow: var(--shadow-lg);
    transform: scale(1.05);
}

.dark-mode-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

body.dark-mode .sun-icon {
    display: block;
}

body.dark-mode .moon-icon {
    display: none;
}

/* Add transitions to all elements that change with theme */
.search-box,
.result-item,
.ai-summary,
.knowledge-card,
.search-history-dropdown,
.history-item {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

