* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f5f5f7;
    color: #111;
    font-family: "Space Grotesk", sans-serif;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ORTA KART */
.chat-wrapper {
    width: 100%;
    max-width: 900px;
    height: 85vh;
    max-height: 800px;
    background: #ffffff;
    border-radius: 22px;
    border: 1px solid #ddd;
    box-shadow: 0 16px 60px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* HEADER */
.chat-header {
    padding: 14px 22px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    font-weight: 600;
    color: #444;
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-header-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
}

/* CHAT ALANI */
.chatbox {
    flex: 1;
    padding: 20px 22px 10px;
    overflow-y: auto;
    background: #fafafc;
}

.msg-row { margin-bottom: 14px; display: flex; }
.msg-row.user { justify-content: flex-end; }
.msg-row.bot  { justify-content: flex-start; }

.bubble {
    max-width: 82%;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.bubble.user {
    background: #e8f7ff;
    color: #000;
    border-bottom-right-radius: 5px;
    border: 1px solid #bde0f1;
}

.bubble.bot {
    background: #ffffff;
    color: #222;
    border-bottom-left-radius: 5px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

/* INPUT ALANI */
.input-area {
    padding: 14px 20px 14px;
    border-top: 1px solid #eee;
    background: #fff;
}

.input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

textarea#message {
    flex: 1;
    resize: none;
    min-height: 50px;
    max-height: 140px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 13px;
    color: #000;
    font-size: 15px;
    outline: none;
}

textarea#message:focus {
    border-color: #888;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.06);
}

.send-btn {
    padding: 15px 21px;
    border-radius: 5px;
    border: none;
    background: #222;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.send-btn::after {
    content:"➤";
    font-size:13px;
    margin-left:6px;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.status {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    min-height: 18px;
}

.typing span {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 3px;
    border-radius: 999px;
    background: #888;
    animation: blink 1.2s infinite;
}
.typing span:nth-child(2){animation-delay:.2s;}
.typing span:nth-child(3){animation-delay:.4s;}

@keyframes blink {
    0%,20%{opacity:.2;transform:translateY(0);}
    50%{opacity:1;transform:translateY(-2px);}
    100%{opacity:.2;transform:translateY(0);}
}

@media(max-width:768px){
    .chat-wrapper{
        height: 100vh;
        max-height:none;
        border-radius:0;
        border:none;
    }
}
