/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: #fff;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

/* Header */
.app-header {
    background: #000;
    color: white;
    padding: 12px 20px;
    -webkit-app-region: drag;
    flex-shrink: 0;
}

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

.header-left {
    display: flex;
    align-items: center;
    width: 60px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 60px;
    justify-content: flex-end;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.vinsi-logo {
    height: 32px;
    width: auto;
    vertical-align: baseline;
    transform: translateY(0px);
}

.icon-btn {
    background: none;
    border: none;
    padding: 8px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
    -webkit-app-region: no-drag;
    border-radius: 4px;
}

.icon-btn:hover {
    color: #fff;
}

/* Chat Area */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
    background: #000;
}

/* Messages */
.message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-end;
}

.message.assistant {
    align-items: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

.message.user .message-bubble {
    background: #333;
    color: white;
    border-bottom-right-radius: 4px;
    border: 1px solid #555;
}

.message.assistant .message-bubble {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.message-content {
    line-height: 1.4;
    font-size: 14px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    align-self: flex-end;
}

.message.assistant .message-time {
    align-self: flex-start;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #1a1a1a;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    border: 1px solid #333;
    width: fit-content;
    margin-left: 20px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #ccc;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

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

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

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

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

/* Input Area */
.input-container {
    background: #000;
    padding: 4px 20px 20px;
    flex-shrink: 0;
    position: relative;
}

.input-wrapper {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0 20px;
}

#message-input {
    width: 100%;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: #fff;
    min-height: 20px;
    max-height: 120px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}


@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

#message-input::placeholder {
    color: #666;
    font-size: 16px;
    font-weight: 300;
    text-align: left;
}

#message-input.placeholder-animate::placeholder {
    animation: placeholder-fade 2s infinite ease-in-out;
    -webkit-animation: placeholder-fade 2s infinite ease-in-out;
}

@keyframes placeholder-fade {
    0%, 100% {
        color: #999;
    }
    50% {
        color: #ffffff;
    }
}

@-webkit-keyframes placeholder-fade {
    0%, 100% {
        color: #999;
    }
    50% {
        color: #ffffff;
    }
}

.ask-alfred-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #333 10%, #666 50%, #333 90%, transparent 100%);
    margin: 16px 20px;
    opacity: 0.8;
    border-radius: 1px;
    box-shadow: 0 0 10px rgba(102, 102, 102, 0.3);
}

.input-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 11px;
    color: #888;
    padding: 0 4px;
}

.shortcut-hint {
    font-style: italic;
    text-align: right;
}

#char-count {
    color: #666;
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #ccc;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background: #333;
    color: #fff;
}

.modal-body {
    padding: 0 20px 20px;
}

.setting-group {
    margin-bottom: 24px;
}

.setting-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #fff;
}

.setting-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 14px;
    background: #000;
    color: #fff;
}

.setting-group input:focus {
    outline: none;
    border-color: #666;
    background: #111;
}

.setting-group small {
    display: block;
    margin-top: 6px;
    color: #888;
    font-size: 12px;
    line-height: 1.4;
}

.setting-group small a {
    color: #fff;
    text-decoration: none;
}

.setting-group small a:hover {
    text-decoration: underline;
}

.personal-info-display {
    background: #000;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 6px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    line-height: 1.4;
    color: #fff;
}

.personal-info-empty {
    color: #666;
    font-style: italic;
}

.modal-footer {
    padding: 0 20px 20px;
    border-top: 1px solid #333;
    margin-top: 20px;
    padding-top: 20px;
}

.btn-primary {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: #ddd;
}

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

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

.messages-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 85%;
    }
    
    .app-header {
        padding: 10px 16px;
    }
    
    .messages-area {
        padding: 16px;
    }
    
    .input-container {
        padding: 6px 16px 6px;
    }
}