/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1d1d1f;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f7 50%, #e8e8ed 100%);
    min-height: 100vh;
}

/* Navigation (same as other pages) */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(248, 248, 248, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo {
    height: 96px;
    width: auto;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.logo:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.logo-text {
    font-size: 2rem;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.04em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    background: linear-gradient(135deg, #007AFF, #5856D6, #AF52DE);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: logoTextShimmer 4s ease-in-out infinite, logoTextFloat 6s ease-in-out infinite 0.5s;
}

@keyframes logoTextShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes logoTextFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-2px); }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: #1d1d1f;
    font-weight: 400;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.8;
}

.nav-link:hover {
    color: #007AFF;
    opacity: 1;
    transform: translateY(-1px);
}

.cta-button {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 25px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4);
    background: linear-gradient(135deg, #0056CC, #4C44CC);
}

/* Language Selector */
.language-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lang-btn.active {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
}

.lang-btn:hover:not(.active) {
    background: rgba(0, 122, 255, 0.1);
    color: #007AFF;
}

/* User Indicator (same as main page) */
.user-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 122, 255, 0.2);
    border-radius: 50px;
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.15);
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007AFF, #5856D6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.avatar-circle {
    color: white;
    font-size: 1.2rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1d1d1f;
    line-height: 1.2;
}

.user-status {
    font-size: 0.8rem;
    color: #30d158;
    font-weight: 500;
}

.user-menu-btn {
    background: none;
    border: none;
    color: #86868b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-left: 0.25rem;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1001;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    color: #1d1d1f;
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: #007AFF;
}

.dropdown-item.logout {
    color: #ff3b30;
}

.dropdown-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0.5rem 0;
}

/* Main Chat Interface */
.chat-main {
    padding-top: 120px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: calc(100vh - 140px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 2rem;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ai-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.ai-logo {
    height: 30px;
    width: auto;
    filter: brightness(0) invert(1);
}

.chat-info h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #30d158;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.chat-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.user-message,
.ai-message {
    display: flex;
    gap: 0.75rem;
    animation: messageSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.user-message {
    flex-direction: row-reverse;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
    font-weight: 600;
}

.ai-message .message-avatar {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
}

.ai-logo-small {
    height: 20px;
    width: auto;
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.message-bubble {
    padding: 1rem 1.25rem;
    border-radius: 18px;
    max-width: 70%;
    word-wrap: break-word;
    position: relative;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 6px;
}

.ai-message .message-bubble {
    background: #f8fafc;
    color: #1d1d1f;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 6px;
}

.message-bubble p {
    margin: 0 0 0.75rem 0;
    line-height: 1.6;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble br {
    margin: 0.25rem 0;
}

.message-bubble strong {
    font-weight: 600;
    color: inherit;
}

.bullet-point {
    color: #007AFF;
    font-weight: bold;
    margin-right: 0.5rem;
}

.ai-message .message-bubble {
    max-width: 85%;
}

.user-message .message-bubble {
    max-width: 75%;
}

/* Error message styling */
.message-bubble.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.message-time {
    font-size: 0.8rem;
    color: #86868b;
    margin-top: 0.25rem;
}

.user-message .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.75rem;
    padding: 0 1.5rem;
    margin-bottom: 1rem;
    animation: messageSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.typing-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.typing-bubble {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    padding: 1rem 1.25rem;
    max-width: 70px;
}

.typing-dots {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #86868b;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 0 0 20px 20px;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.chat-input-wrapper:focus-within {
    border-color: #007AFF;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.5;
    max-height: 120px;
    min-height: 24px;
    background: transparent;
    color: #1d1d1f;
}

.chat-input::placeholder {
    color: #86868b;
}

.send-button {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.send-button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Input Suggestions */
.input-suggestions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.suggestion-btn {
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.2);
    color: #007AFF;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.suggestion-btn:hover {
    background: rgba(0, 122, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}



/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #30d158;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

.toast.error {
    border-left-color: #ff3b30;
}

.toast.warning {
    border-left-color: #ff9500;
}

.toast.info {
    border-left-color: #007AFF;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        gap: 4px;
    }

    .hamburger .bar {
        width: 25px;
        height: 3px;
        background: #1d1d1f;
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    .chat-main {
        padding-top: 140px;
    }

    .chat-container {
        margin: 0 1rem;
        height: calc(100vh - 160px);
    }

    .chat-header {
        padding: 1rem 1.5rem;
    }

    .chat-header h1 {
        font-size: 1.25rem;
    }

    .chat-messages {
        padding: 1rem;
    }

    .chat-input-container {
        padding: 1rem;
    }

    .input-suggestions {
        flex-direction: column;
    }

    .suggestion-btn {
        text-align: center;
    }

    .user-indicator .user-info {
        display: none;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .chat-container {
        margin: 0 0.5rem;
        border-radius: 16px;
    }

    .chat-header {
        padding: 1rem;
        border-radius: 16px 16px 0 0;
    }

    .chat-title {
        gap: 0.75rem;
    }

    .ai-avatar {
        width: 40px;
        height: 40px;
    }

    .ai-logo {
        height: 24px;
    }

    .chat-header h1 {
        font-size: 1.1rem;
    }

    .chat-actions {
        gap: 0.25rem;
    }

    .chat-action-btn {
        padding: 0.5rem;
    }
}

/* Welcome Message */
.welcome-message {
    opacity: 0.9;
}

.welcome-message .message-bubble {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid rgba(0, 122, 255, 0.2);
    color: #1d1d1f;
}

/* Animations */
.chat-container {
    animation: slideInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus states for accessibility */
button:focus,
textarea:focus,
a:focus {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
}