:root {
    /* Apple AI-inspired Navy Blue Dark Theme */
    --primary-navy: #1a1d29;
    --secondary-navy: #252936;
    --accent-navy: #2d3142;
    --light-navy: #3a3f54;
    --text-primary: #ffffff;
    --text-secondary: #b8bcc8;
    --text-muted: #8b92a5;
    --accent-blue: #007aff;
    --accent-blue-hover: #0056cc;
    --success: #30d158;
    --warning: #ff9f0a;
    --danger: #ff453a;
    --border-light: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.2);
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 40px rgba(0, 0, 0, 0.25);
    --blur-bg: rgba(26, 29, 41, 0.8);
    --gradient-primary: linear-gradient(135deg, #1a1d29 0%, #252936 100%);
    --gradient-accent: linear-gradient(135deg, #007aff 0%, #0056cc 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--gradient-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

.language-selector select {
    background: var(--blur-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector select:hover {
    border-color: var(--accent-blue);
    background: var(--secondary-navy);
}

/* Main Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInUp 0.8s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.logo-img {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    box-shadow: var(--shadow-medium);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Chat Container - Apple AI Style */
.chat-container {
    width: 100%;
    max-width: 700px;
    background: var(--blur-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 24px;
    min-height: 120px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Messages */
.message {
    margin-bottom: 20px;
    animation: messageSlideIn 0.4s ease-out;
}

.message-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.message.user-message .message-content {
    flex-direction: row-reverse;
}

.message.user-message .message-text {
    background: var(--gradient-accent);
    color: white;
    margin-left: auto;
    border-radius: 18px 18px 4px 18px;
}

.message.ai-message .message-text {
    background: var(--secondary-navy);
    color: var(--text-primary);
    border-radius: 18px 18px 18px 4px;
}

.message-text {
    padding: 12px 16px;
    max-width: 80%;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message.ai-message .message-icon {
    background: var(--gradient-accent);
    color: white;
}

.message.user-message .message-icon {
    background: var(--light-navy);
    color: var(--text-secondary);
}

.message-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(1.1);
}

.welcome-message {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.welcome-message .message-content {
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}

.welcome-message i {
    font-size: 24px;
    color: var(--accent-blue);
}

/* Input Container */
.input-container {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--secondary-navy);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

#questionInput {
    flex: 1;
    background: var(--primary-navy);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    resize: none;
    min-height: 44px;
    max-height: 120px;
}

#questionInput:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

#questionInput::placeholder {
    color: var(--text-muted);
}

#askButton {
    background: var(--gradient-accent);
    border: none;
    border-radius: 16px;
    padding: 12px 20px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: center;
}

#askButton:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

#askButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* FAQ Browse Button */
.browse-faq-container {
    margin-top: 30px;
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.browse-faq-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--secondary-navy);
    color: var(--text-primary);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
}

.browse-faq-btn:hover {
    background: var(--light-navy);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Report Bug Button - Bottom Left */
.report-bug-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-heavy);
    transition: all 0.3s ease;
    z-index: 1000;
}

.report-bug-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 69, 58, 0.4);
}

/* Footer */
.footer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: var(--text-muted);
    font-size: 12px;
    z-index: 1000;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 29, 41, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: var(--text-primary);
}

.loading-spinner i {
    font-size: 32px;
    color: var(--accent-blue);
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 29, 41, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--secondary-navy);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-heavy);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-content textarea {
    width: 100%;
    min-height: 120px;
    background: var(--primary-navy);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    outline: none;
    margin-bottom: 20px;
    font-family: inherit;
}

.modal-content textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.modal-content textarea::placeholder {
    color: var(--text-muted);
}

.modal-content button[type="submit"] {
    background: var(--gradient-accent);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.modal-content button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-primary);
}

/* Feedback Buttons */
.feedback-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

.feedback-btn {
    background: var(--light-navy);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 6px 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.feedback-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.feedback-btn.liked {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.feedback-btn.disliked {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

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

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Custom Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--secondary-navy);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: var(--shadow-heavy);
    z-index: 10000;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification.warning {
    border-left: 4px solid var(--warning);
}

.notification.info {
    border-left: 4px solid var(--accent-blue);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-icon {
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.notification.success .notification-icon {
    color: var(--success);
}

.notification.error .notification-icon {
    color: var(--danger);
}

.notification.warning .notification-icon {
    color: var(--warning);
}

.notification.info .notification-icon {
    color: var(--accent-blue);
}

.notification-text {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 14px;
}

.notification-message {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin-left: 8px;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    color: var(--text-primary);
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notificationSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

/* Typing Indicator */
.typing-indicator .typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Thinking Animation */
.thinking-animation {
    display: flex;
    align-items: center;
    gap: 12px;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-blue);
    animation: thinkingDot 1.4s infinite ease-in-out;
}

.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
.thinking-dots span:nth-child(3) { animation-delay: 0s; }

.thinking-text {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 14px;
}

@keyframes thinkingDot {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Message Media Content */
.message-media {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.media-item {
    border-radius: 12px;
    overflow: hidden;
    background: var(--primary-navy);
    border: 1px solid var(--border-light);
}

.media-item img {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.media-item img:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.media-item video {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    cursor: pointer;
}

.media-caption {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    background: var(--secondary-navy);
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: var(--shadow-heavy);
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10001;
}

.image-modal-close:hover {
    color: var(--accent-blue);
}

.image-modal-caption {
    color: white;
    margin-top: 15px;
    font-size: 16px;
    padding: 0 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 0 auto;
    }
    
    .header {
        margin-bottom: 30px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .chat-container {
        border-radius: 16px;
        margin: 0;
        width: 100%;
        max-width: none;
    }
    
    .chat-messages {
        max-height: 350px;
        padding: 16px;
        min-height: 100px;
    }
    
    .message {
        margin-bottom: 16px;
    }
    
    .message-content {
        gap: 8px;
    }
    
    .message-text {
        max-width: 80%;
        font-size: 14px;
        padding: 10px 14px;
        line-height: 1.4;
    }
    
    .message-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .message-logo {
        width: 16px;
        height: 16px;
    }
    
    .input-container {
        padding: 16px;
    }
    
    .input-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    #questionInput {
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 12px;
        min-height: 48px;
    }
    
    #askButton {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 12px;
        min-height: 48px;
    }
    
    .feedback-buttons {
        gap: 6px;
        margin-top: 6px;
    }
    
    .feedback-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .browse-faq-container {
        margin-top: 20px;
    }
    
    .browse-faq-btn {
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 12px;
    }
    
    .report-bug-btn {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .language-selector {
        top: 15px;
        right: 15px;
    }
    
    .language-selector select {
        font-size: 14px;
        padding: 6px 8px;
    }
    
    .footer {
        bottom: 15px;
        right: 15px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header {
        margin-bottom: 20px;
    }
    
    .logo h1 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .chat-container {
        border-radius: 12px;
    }
    
    .chat-messages {
        padding: 12px;
        max-height: 300px;
    }
    
    .message-text {
        max-width: 85%;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .message-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .message-logo {
        width: 14px;
        height: 14px;
    }
    
    .input-container {
        padding: 12px;
    }
    
    #questionInput {
        font-size: 16px;
        padding: 12px 14px;
    }
    
    #askButton {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 15px;
        border-radius: 16px;
    }
    
    .browse-faq-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .report-bug-btn {
        width: 45px;
        height: 45px;
        font-size: 14px;
        bottom: 15px;
        left: 15px;
    }
}