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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #FFE5EC 0%, #E1CCEC 50%, #FFF8E7 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    gap: 0;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px 0 0 30px;
    box-shadow: 0 20px 60px rgba(225, 204, 236, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    background: linear-gradient(135deg, #FFB6C1 0%, #E1CCEC 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    color: #fff;
    font-size: 1.2rem;
}

.new-chat-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    padding: 8px 15px;
    border-radius: 15px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.new-chat-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.session-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f8f8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.session-item:hover {
    background: #E1CCEC;
    color: #fff;
    transform: translateX(5px);
}

.session-item.active {
    background: linear-gradient(135deg, #E1CCEC 0%, #D4BBFF 100%);
    color: #fff;
}

.session-title {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 4px;
}

.delete-session {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 0, 0, 0.6);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    display: none;
}

.session-item:hover .delete-session {
    display: block;
}

.container {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 30px 30px 0;
    box-shadow: 0 20px 60px rgba(225, 204, 236, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #FFB6C1 0%, #E1CCEC 100%);
    padding: 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.toggle-sidebar {
    position: absolute;
    left: 20px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: none;
}

.crown {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

h1 {
    color: #fff;
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #E1CCEC;
    border-radius: 10px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.crown-large {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.message {
    display: flex;
    margin-bottom: 15px;
    animation: slideIn 0.3s ease-out;
}

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

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

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

.message-content {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 20px;
    word-wrap: break-word;
    line-height: 1.6;
    white-space: pre-wrap;
}

.message.user .message-content {
    background: linear-gradient(135deg, #E1CCEC 0%, #D4BBFF 100%);
    color: #fff;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 10px rgba(225, 204, 236, 0.3);
}

.message.ai .message-content {
    background: #FFF8E7;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.message-content strong {
    font-weight: 700;
}

.message-content em {
    font-style: italic;
}

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

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

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 15px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #E1CCEC;
    border-radius: 50%;
    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;
    }
}

.input-container {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    background: #F8F8F8;
    padding: 5px;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

#userInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 20px;
    font-size: 1rem;
    outline: none;
    color: #333;
}

#sendBtn {
    background: linear-gradient(135deg, #E1CCEC 0%, #D4BBFF 100%);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(225, 204, 236, 0.4);
}

#sendBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(225, 204, 236, 0.6);
}

#sendBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .app-container {
        height: 100vh;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        height: 100%;
        z-index: 1000;
        border-radius: 0;
        transition: left 0.3s;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .container {
        border-radius: 0;
        width: 100%;
    }
    
    .toggle-sidebar {
        display: block;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .message-content {
        max-width: 85%;
    }
}
/* Blinking cursor for streaming */
.cursor {
    animation: blink 1s infinite;
    opacity: 1;
    margin-left: 2px;
}
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}
