:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-color: #3b82f6;
    --secondary-bg: #1e293b;
    --border-color: #334155;
    --user-msg: #2563eb;
    --ai-msg: #1e293b;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    height: 100vh;
}

.container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    box-sizing: border-box;
}

header {
    text-align: center;
    padding: 1rem 0 2.5rem;
}

header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(to right, #60a5fa, #c084fc, #f472b6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    margin: 0;
    font-size: 1.1rem;
    color: #94a3b8;
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--secondary-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

#chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
}

#messages {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    max-width: 85%;
    padding: 1.25rem 1.75rem;
    border-radius: 16px;
    line-height: 1.7;
    font-size: 1.05rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    align-self: flex-end;
    background-color: var(--user-msg);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ai-message {
    align-self: flex-start;
    background-color: #0d121c;
    /* slightly darker base for contrast */
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.ai-message pre {
    background-color: #000;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

.ai-message code {
    font-family: monospace;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.ai-message pre code {
    background-color: transparent;
    padding: 0;
}

.ai-message img {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    border: 1px solid #334155;
}

.suggestions {
    display: flex;
    gap: 10px;
    padding: 1rem 1.25rem;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
    background-color: #151d2b;
}

.suggestions::-webkit-scrollbar {
    height: 6px;
}

.suggestions::-webkit-scrollbar-track {
    background: transparent;
}

.suggestions::-webkit-scrollbar-thumb {
    background-color: #475569;
    border-radius: 3px;
}

.suggestion-btn {
    background-color: #0d121c;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-btn:hover {
    background-color: #1e293b;
    border-color: #60a5fa;
    color: #60a5fa;
}

.suggestion-btn:active {
    transform: scale(0.98);
}

.input-area {
    padding: 1.25rem;
    background-color: #151d2b;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
}

input {
    flex-grow: 1;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid #475569;
    background-color: #0f172a;
    color: white;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

button {
    padding: 0 2rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    border-top-color: #8b5cf6;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.media-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.media-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
    background: #1e293b;
    border: 1px solid #3b82f6;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.media-btn:hover {
    background: #3b82f6;
    color: white;
}

.media-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #1e293b;
    color: #475569;
    border-color: #475569;
}

.media-player {
    margin-top: 15px;
    width: 100%;
}

.media-player audio {
    width: 100%;
    outline: none;
}

.media-player video {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #334155;
    background: #000;
}