@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    overflow: hidden;
}

.chat-wrapper {
    height: calc(100vh - 60px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: relative;
    overflow: hidden;
}

.chat-wrapper::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    top: -250px;
    right: -250px;
    animation: float 20s infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(-50px, 50px) rotate(180deg);
    }
}

.chat-container {
    max-width: 1300px;
    height: 90%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 320px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.sidebar-header h4 {
    color: white;
    font-size: 20px;
    font-weight: 700;
    flex: 1;
}

.btn-new {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 16px;
}

.btn-new:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.history-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.history-item.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.history-text {
    flex: 1;
    min-width: 0;
}

.history-title {
    color: white;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.btn-del {
    background: rgba(239, 68, 68, 0.2);
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.btn-del:hover {
    background: rgba(239, 68, 68, 0.4);
}

.no-history {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 40px 20px;
}

.main-chat {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    overflow: hidden;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.messages::-webkit-scrollbar {
    width: 6px;
}

.messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.welcome {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.welcome h2 {
    color: white;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.welcome p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    margin-bottom: 32px;
}

.suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.sug-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 16px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.sug-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.msg {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.msg-text {
    max-width: 65%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.msg.user .msg-text {
    background: rgba(255, 255, 255, 0.3);
}

.msg-text p {
    margin-bottom: 8px;
}

.msg-text p:last-child {
    margin-bottom: 0;
}

.msg-text ul {
    padding-left: 1.2em;
    margin: 8px 0;
}

.msg-text strong {
    font-weight: 700;
}

.msg-text code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.input-area {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 8px 8px 8px 20px;
    transition: all 0.3s;
}

.input-container:focus-within {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

#input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 15px;
    resize: none;
    outline: none;
    max-height: 120px;
    padding: 8px 0;
}

#input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#sendBtn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    border: none;
    color: #667eea;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#sendBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.9));
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#sendBtn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.3);
}

.input-hint {
    text-align: center;
    margin-top: 12px;
}

.input-hint small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
        height: 100%;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
    }

    .suggestions {
        grid-template-columns: 1fr;
    }

    .msg-text {
        max-width: 80%;
    }
}