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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
    touch-action: manipulation;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.login-card {
    background: #2a2a2a;
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid #404040;
    max-width: 400px;
    width: 90%;
    animation: fadeIn 0.5s ease-out;
}

.claw-logo {
    font-size: 64px;
    margin-bottom: 16px;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.login-card p {
    color: #999999;
    margin-bottom: 32px;
    font-size: 16px;
}

.google-signin-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    color: #757575;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    border: 1px solid #dadce0;
}

.google-signin-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.google-logo {
    width: 20px;
    height: 20px;
}

/* Chat Screen */
.chat-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #1a1a1a;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #2a2a2a;
    border-bottom: 1px solid #404040;
    min-height: 64px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.claw-icon {
    font-size: 24px;
}

.app-name {
    font-size: 18px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn, .user-btn {
    background: none;
    border: none;
    color: #999999;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.header-btn:hover, .user-btn:hover {
    background: #404040;
    color: #ffffff;
}

.header-btn svg, .user-btn svg {
    width: 20px;
    height: 20px;
}

.user-menu {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-top: 4px;
    min-width: 120px;
    z-index: 1000;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    text-decoration: none;
    color: #ffffff;
    font-size: 14px;
    transition: background 0.2s ease;
}

.logout-btn:hover {
    background: #404040;
}

.logout-btn svg {
    width: 16px;
    height: 16px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.welcome-message {
    text-align: center;
    margin: auto;
    max-width: 400px;
}

.claw-logo-large {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.welcome-message h2 {
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

.welcome-message p {
    color: #999999;
    font-size: 16px;
    line-height: 1.5;
}

.message {
    display: flex;
    margin-bottom: 16px;
}

.message.user {
    justify-content: flex-end;
}

.message.assistant {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: #007AFF;
    color: #ffffff;
}

.message.assistant .message-bubble {
    background: #404040;
    color: #ffffff;
}

.message-bubble pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    margin: 8px 0;
    overflow-x: auto;
    font-size: 13px;
}

.message-bubble code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 13px;
}

.message-bubble p {
    margin: 0 0 8px 0;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul,
.message-bubble ol {
    padding-left: 1.5em;
    margin: 4px 0;
}

.message-bubble li {
    margin-bottom: 2px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #404040;
    border-radius: 18px;
    max-width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #999999;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

/* Chat Input */
.chat-input-container {
    padding: 20px;
    background: #1a1a1a;
    border-top: 1px solid #404040;
}

.file-preview {
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 12px;
}

.file-preview img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
}

.file-preview .file-icon {
    width: 48px;
    height: 48px;
    background: #404040;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #999999;
}

.file-preview .file-info {
    flex: 1;
    min-width: 0;
}

.file-preview .file-name {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-preview .file-size {
    font-size: 12px;
    color: #999999;
    margin-top: 2px;
}

.file-preview .file-remove {
    background: none;
    border: none;
    color: #999999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.file-preview .file-remove:hover {
    background: #404040;
    color: #ffffff;
}

.file-preview .file-remove svg {
    width: 16px;
    height: 16px;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.input-buttons {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.input-btn {
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999999;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.input-btn:hover {
    background: #404040;
    color: #ffffff;
    border-color: #666666;
}

.input-btn svg {
    width: 20px;
    height: 20px;
}

#chatInput {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 20px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 16px;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

#chatInput:focus {
    border-color: #007AFF;
}

#chatInput::placeholder {
    color: #999999;
}

.send-btn {
    background: #007AFF;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #0056CC;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #404040;
    cursor: not-allowed;
    transform: none;
}

.send-btn svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

/* Secure Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal-card {
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease-out;
}

.modal-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.modal-card p {
    color: #999999;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.4;
}

.modal-card label {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    margin-top: 16px;
}

.modal-card label:first-of-type {
    margin-top: 0;
}

.modal-card input,
.modal-card textarea {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 12px;
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
    resize: vertical;
}

.modal-card input:focus,
.modal-card textarea:focus {
    border-color: #007AFF;
}

.modal-card input::placeholder,
.modal-card textarea::placeholder {
    color: #666666;
}

.modal-card textarea {
    min-height: 100px;
    max-height: 200px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.modal-btn-secondary {
    background: #404040;
    color: #ffffff;
}

.modal-btn-secondary:hover {
    background: #505050;
}

.modal-btn-primary {
    background: #007AFF;
    color: #ffffff;
}

.modal-btn-primary:hover {
    background: #0056CC;
}

.modal-btn:disabled {
    background: #333333;
    color: #666666;
    cursor: not-allowed;
}

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

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

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

/* Responsive */
@media (max-width: 768px) {
    .login-card {
        padding: 32px 24px;
        margin: 20px;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .chat-input-container {
        padding: 16px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .file-preview {
        margin-left: 0;
        margin-right: 0;
    }
    
    .modal-card {
        padding: 24px;
        margin: 16px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}

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

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

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

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