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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 900px;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 90vh;
    max-height: 800px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-title {
    text-align: left;
}

header h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
}

.subtitle {
    opacity: 0.9;
    font-size: 0.9em;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    font-size: 0.9em;
    opacity: 0.9;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s, border-color 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f7f7f8;
}

.message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

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

.message-content {
    padding: 15px 20px;
    border-radius: 15px;
    max-width: 80%;
    line-height: 1.6;
}

.user-message .message-content {
    background: #667eea;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
}

.bot-message .message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.bot-message .message-content li {
    margin: 5px 0;
}

.typing-indicator {
    display: inline-block;
    padding: 15px 20px;
    background: white;
    border-radius: 15px;
    border: 1px solid #e0e0e0;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #667eea;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.attachment-list {
    margin-top: 15px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 8px;
}

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.attachment-name {
    flex: 1;
    font-weight: 500;
}

.download-btn {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.download-btn:hover {
    background: #5568d3;
}

.input-container {
    display: flex;
    gap: 10px;
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

#messageInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    resize: none;
    font-family: inherit;
    transition: border-color 0.3s;
    max-height: 120px;
}

#messageInput:focus {
    outline: none;
    border-color: #667eea;
}

#sendButton {
    padding: 15px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sendButton:hover {
    background: #5568d3;
}

#sendButton:active {
    transform: scale(0.95);
}

#sendButton:disabled {
    background: #ccc;
    cursor: not-allowed;
}

footer {
    text-align: center;
    padding: 15px;
    background: #f7f7f8;
    color: #666;
    font-size: 0.9em;
    border-top: 1px solid #e0e0e0;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 50px 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.login-header h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2em;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 1em;
    margin-bottom: 40px;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #333;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.google-signin-btn:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.google-signin-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.google-icon {
    flex-shrink: 0;
}

.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-footer p {
    color: #999;
    font-size: 0.85em;
    line-height: 1.5;
}

.login-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 0.9em;
    text-align: left;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-title {
        text-align: center;
    }

    .header-user {
        flex-direction: column;
        gap: 10px;
    }

    .user-email {
        max-width: 100%;
    }

    .login-card {
        padding: 40px 25px;
    }
}
