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

:root {
    --primary-blue: #1a73e8;
    --primary-blue-hover: #1557b0;
    --background: #ffffff;
    --background-secondary: #f8f9fa;
    --border-color: #dadce0;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #80868b;
    --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --shadow-md: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

body {
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Navigation */
.top-nav {
    height: 64px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--background);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-button:hover {
    background: var(--background-secondary);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 24px;
    cursor: pointer;
}

.user-profile:hover {
    background: var(--background-secondary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
}

.user-name {
    font-size: 14px;
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 40px 24px;
}

.content-wrapper {
    width: 100%;
    max-width: 768px;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 48px;
}

.welcome-content {
    padding: 40px 0;
}

.welcome-title {
    font-size: 36px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Search Container */
.search-container {
    margin-bottom: 32px;
}

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

.search-input {
    width: 100%;
    height: 56px;
    padding: 0 56px 0 20px;
    border: 1px solid var(--border-color);
    border-radius: 28px;
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 1px 6px rgba(26, 115, 232, 0.3);
}

.search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-button:hover {
    background: var(--primary-blue-hover);
}

.search-button:active {
    transform: translateY(-50%) scale(0.95);
}

/* Suggestions */
.suggestions {
    margin-top: 24px;
}

.suggestions-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    padding: 10px 16px;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    background: var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Results Section */
.results-section {
    margin-top: 32px;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Response Container */
.response-container {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
}

.response-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

.response-content h1,
.response-content h2,
.response-content h3 {
    margin: 16px 0 8px 0;
    font-weight: 500;
}

.response-content h1 {
    font-size: 24px;
}

.response-content h2 {
    font-size: 20px;
}

.response-content h3 {
    font-size: 16px;
}

.response-content p {
    margin: 12px 0;
}

.response-content ul,
.response-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.response-content li {
    margin: 6px 0;
}

.response-content strong {
    font-weight: 500;
}

.response-content code {
    background: var(--background-secondary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
}

.response-meta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Error Container */
.error-container {
    background: #fce8e6;
    border: 1px solid #f28b82;
    border-radius: 8px;
    padding: 16px 20px;
}

.error-message {
    color: #c5221f;
    font-size: 14px;
}

/* Workspace Info */
.workspace-info {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.workspace-title {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.workspace-services {
    display: flex;
    gap: 24px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.service-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.gmail-icon {
    background: linear-gradient(135deg, #d93025 0%, #f28b82 100%);
}

.calendar-icon {
    background: linear-gradient(135deg, #1a73e8 0%, #8ab4f8 100%);
}

.drive-icon {
    background: linear-gradient(135deg, #0f9d58 0%, #81c995 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .top-nav {
        padding: 0 16px;
    }

    .welcome-title {
        font-size: 28px;
    }

    .welcome-subtitle {
        font-size: 16px;
    }

    .user-name {
        display: none;
    }

    .suggestion-chips {
        flex-direction: column;
    }

    .suggestion-chip {
        width: 100%;
    }
}

/* Hidden state for welcome when results shown */
.welcome-section.hidden {
    display: none;
}

.workspace-info.hidden {
    display: none;
}

.suggestions.hidden {
    display: none;
}

/* Generating text animation */
.generating-text {
    color: #5f6368;
    font-size: 14px;
    padding: 12px 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Gradient shimmer effect for generating state */
.generating-text::after {
    content: '';
    display: inline-block;
    width: 100%;
    height: 20px;
    margin-top: 8px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 16px;
    font-size: 14px;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.filter-chip:hover {
    background: #f8f9fa;
    border-color: #5f6368;
}

.filter-chip.active {
    background: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
}

.filter-chip svg {
    width: 16px;
    height: 16px;
}

.filter-chip .chip-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
    cursor: pointer;
    opacity: 0.7;
}

.filter-chip .chip-close:hover {
    opacity: 1;
}

.filter-chip:not(.active) .chip-close {
    display: none;
}
