* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #f7f7f8;
    color: #2d3748;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    height: 100%;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}

html {
    height: -webkit-fill-available;
} 

header {
    padding: 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#chat-container {
    flex: 1;
    padding: 2rem;
    padding-bottom: calc(2rem - 50px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    width: 1000px;
    margin: 0 auto;
}

#chat-top-spacer {
    display: none;
}

footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

@media (max-width: 1000px) {
    #chat-container {
        width: 100%;
        padding: 1rem;
    }
}

.input-area {
    padding: 1rem 2rem;
}

@media (max-width: 768px) {
    body {
        overscroll-behavior: auto;
        position: fixed;
        width: 100%;
    }
    
    .content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.menu-toggle {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    z-index: 1001;
    background: transparent;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-50%) scale(1.05);
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #6366f1;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 2rem;
    color: #718096;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-sidebar:hover {
    background: #f7f7f8;
    color: #2d3748;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #2d3748;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-link:hover {
    background: #f7f7f8;
    color: #6366f1;
}

.sidebar-link .icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}



@media (max-width: 768px) {
    .header {
        padding: 1rem 1rem;
    }
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}




.scroll-indicator {
    position: fixed;
    bottom: 140px;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: #6366f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 50;
}

.scroll-indicator.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.scroll-indicator:hover {
    background: #4f46e5;
    transform: scale(1.1);
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
    fill: white;
}

@media (max-width: 768px) {
    .scroll-indicator {
        bottom: 180px;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

.message {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease-in;
    border-radius: 12px;
    max-width: 100%;
    margin: 0;
    width: 100%;
}

@media (max-width: 768px) {
    .message {
        padding: 1rem;
        gap: 0.75rem;
        flex-direction: column;
    }
    
    .message .message-icon {
        align-self: flex-start;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.message.assistant {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.message-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.message.user .message-icon {
    background: #6366f1;
    color: #ffffff;
}

.message.assistant .message-icon {
    background: #10b981;
    color: #ffffff;
}

.message-content {
    flex: 1;
    line-height: 1.6;
}

.message-text {
    margin-bottom: 0.5rem;
}

.message-disclaimer {
    font-size: 0.75rem;
    font-style: italic;
    color: #718096;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.message.user .message-disclaimer {
    display: none;
}



@media (max-width: 768px) {
    .input-area {
        padding: 1rem 1rem 1rem;
    }
}

.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.input-disclaimer {
    max-width: 800px;
    margin: 0.5rem auto 0;
    font-size: 0.75rem;
    color: #718096;
    text-align: center;
    font-style: italic;
}

.input-box {
    width: 100%;
    padding: 1rem 5.5rem 1rem 1rem;
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 12px;
    color: #2d3748;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.input-box::placeholder {
    color: #a0aec0;
}

.input-box:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

@media (max-width: 768px) {
    .input-box {
        font-size: 16px;
    }
}

.voice-button {
    position: absolute;
    right: 3.5rem;
    bottom: 0.75rem;
    width: 32px;
    height: 32px;
    background: #10b981;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.voice-button:hover:not(:disabled) {
    background: #059669;
    transform: scale(1.05);
}

.voice-button:active:not(:disabled) {
    transform: scale(0.95);
    background: #ef4444;
}

.voice-button.recording {
    background: #ef4444 !important;
    animation: pulse 1.5s ease-in-out infinite;
}

.voice-button.recording:hover {
    background: #dc2626 !important;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.voice-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.voice-button svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.send-button {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 32px;
    height: 32px;
    background: #6366f1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.send-button:hover:not(:disabled) {
    background: #4f46e5;
    transform: scale(1.05);
}

.send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.send-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.send-button svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.loading {
    display: flex !important;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 0;
}

.loading-dot {
    width: 10px;
    height: 10px;
    background: #6366f1;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    display: inline-block;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
}

.empty-state-icon {
    font-size: 4rem;
}

@media (max-width: 768px) {
    .empty-state-icon {
        font-size: 3rem;
    }
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

@media (max-width: 768px) {
    .profile-photo {
        width: 100px;
        height: 100px;
        border-width: 3px;
    }
}

.empty-state h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #1a202c;
    text-align: center;
}

@media (max-width: 768px) {
    .empty-state h2 {
        font-size: 1.5rem;
    }
}

.empty-state p {
    text-align: center;
    max-width: 800px;
}

.suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin-top: 2rem;
    width: 100%;
}

@media (max-width: 768px) {
    .suggestions {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .suggestions {
        grid-template-columns: repeat(2, 1fr);
    }
}

.suggestion-card {
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.suggestion-card:hover {
    background: #f8fafc;
    border-color: #6366f1;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.suggestion-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.suggestion-card p {
    font-size: 0.875rem;
    color: #718096;
    line-height: 1.5;
}

.legal-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.legal-popup-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.legal-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #718096;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.legal-popup-close:hover {
    background: #f7f7f8;
    color: #2d3748;
}

.legal-popup-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.legal-text {
    color: #2d3748;
    line-height: 1.7;
}

.legal-text p {
    margin-bottom: 1rem;
}

.legal-text p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .legal-popup-content {
        padding: 1.5rem;
        max-height: 85vh;
    }
    
    .legal-popup-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .legal-text {
        font-size: 0.9rem;
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.cookie-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #1a202c;
}

.cookie-content p {
    margin: 0 0 1rem 0;
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cookie-accept {
    background: #6366f1;
    color: white;
}

.cookie-accept:hover {
    background: #4f46e5;
    transform: translateY(-2px);
}

.cookie-decline {
    background: #e2e8f0;
    color: #4a5568;
}

.cookie-decline:hover {
    background: #cbd5e0;
}

@media (max-width: 768px) {
    .cookie-banner {
        padding: 1rem;
    }
    
    .cookie-content h3 {
        font-size: 1.1rem;
    }
    
    .cookie-content p {
        font-size: 0.9rem;
    }
    
    .cookie-buttons {
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
        padding: 0.875rem;
    }
}
