/* === Dodo Chat UI (Modern + Responsive + Splash) === */

/* ---------- Global ---------- */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #f1f1f1;
    overflow: auto;
}

/* ---------- Splash Screen ---------- */
#splash-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
    background: linear-gradient(to right, #1f1c2c, #928dab);
    font-family: 'Space Mono', monospace;
    color: #fff;
    z-index: 9999;
    animation: fadeOut 1s ease 4s forwards;
}

#splash-screen h1 {
    font-size: 2.8rem;
    margin: 0;
    animation: slideDown 1s;
}

#splash-screen p {
    font-size: 1.3rem;
    margin: 10px 0 0;
    animation: slideUp 1s;
}

/* ---------- Animations ---------- */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* ---------- Chat Layout ---------- */
.chat-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    backdrop-filter: blur(12px);
    background: rgba(18, 18, 34, 0.7);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-size: 1.6em;
    font-weight: bold;
    background: linear-gradient(to right, #3f5efb, #fc466b);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.chat-header i {
    margin-right: 10px;
    font-size: 1.2em;
}

/* Messages area */
.chat-messages {
    flex-grow: 1;
    min-height: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Message bubble */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 20px;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    animation: fadeInUp 0.4s forwards;
    font-size: 1rem;
}

.message-icon {
    font-size: 1.2em;
    min-width: 24px;
}

/* User and Bot styling */
.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #3da9fc, #1976d2);
    color: white;
    border-bottom-right-radius: 5px;
    animation: fadeInLeft 0.4s forwards;
}

.bot-message {
    align-self: flex-start;
    background: linear-gradient(135deg, #434343, #2a2a3c);
    font-family: 'Space Mono', monospace;
    border-bottom-left-radius: 5px;
    animation: fadeInRight 0.4s forwards;
}

/* Typing Indicator */
.typing-indicator {
    background-color: #2e2e42;
    color: #aaa;
    font-style: italic;
    padding-left: 20px;
    border-radius: 15px;
    animation: pulse 1.5s infinite;
}

/* ---------- Input Area ---------- */
.chat-input {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background-color: rgba(30, 30, 50, 0.7);
    border-top: 1px solid #3d3d5c;
    backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.chat-input input[type="text"] {
    flex-grow: 1;
    min-width: 0;
    padding: 12px 16px;
    font-size: 1em;
    border: none;
    border-radius: 30px;
    background-color: #1e1e2e;
    color: #f1f1f1;
    box-shadow: inset 2px 2px 5px #111122, inset -2px -2px 5px #2a2a3a;
    outline: none;
}

.chat-input input[type="text"]:focus {
    box-shadow: 0 0 0 3px rgba(61, 169, 252, 0.3);
}

.chat-input button {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    font-size: 1.2em;
    color: white;
    background: linear-gradient(135deg, #3da9fc, #1976d2);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-input button:hover {
    box-shadow: 0 0 10px rgba(61, 169, 252, 0.5);
    transform: translateY(-2px);
}

.chat-input button:active {
    transform: translateY(1px);
}

.chat-input button i {
    margin: 0;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .chat-header {
        font-size: 1.3em;
        padding: 12px;
    }

    .message {
        font-size: 0.95rem;
        padding: 10px 14px;
    }

    .chat-input {
        padding: 10px;
    }

    .chat-input input[type="text"] {
        font-size: 0.95em;
    }

    .chat-input button {
        width: 42px;
        height: 42px;
        font-size: 1em;
    }

    #splash-screen h1 {
        font-size: 2.2rem;
    }

    #splash-screen p {
        font-size: 1rem;
    }
}
