/* Reset and base styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --success: #10b981;
    --border: #333333;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Light mode theme */
[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e8e8;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --success: #10b981;
    --border: #d1d5db;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* App container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
}

/* Header */
.header {
    padding: 1.5rem;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-text h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.restart-button {
    margin-left: auto;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.restart-button:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: rotate(180deg);
}

/* Theme toggle switch */
.theme-switch {
    position: relative;
    width: 56px;
    height: 28px;
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch .slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 28px;
    transition: all 0.3s ease;
}

.theme-switch .slider::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    left: 2px;
    bottom: 2px;
    background: var(--accent);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.theme-switch input:checked+.slider::before {
    transform: translateX(28px);
}

.theme-switch .icon-moon,
.theme-switch .icon-sun {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    transition: opacity 0.3s ease;
}

.theme-switch .icon-moon {
    left: 6px;
    opacity: 1;
}

.theme-switch .icon-sun {
    right: 6px;
    opacity: 0.4;
}

.theme-switch input:checked+.slider .icon-moon {
    opacity: 0.4;
}

.theme-switch input:checked+.slider .icon-sun {
    opacity: 1;
}

.download-button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.download-button:hover {
    background: var(--success);
    border-color: var(--success);
}

.music-button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-button:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.music-button.playing {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    animation: spin 3s linear infinite;
}

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

/* Chat container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Welcome message */
.welcome-message {
    text-align: center;
    padding: 3rem 1rem;
    animation: fadeIn 0.5s ease;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.welcome-message h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.welcome-message p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.suggestion {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.suggestion:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Chat messages */
.message {
    display: flex;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--accent);
}

.message.bot .message-avatar {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    max-width: 70%;
    padding: 0.875rem 1rem;
    border-radius: 16px;
    line-height: 1.5;
}

.message.user .message-content {
    background: var(--accent);
    border-bottom-right-radius: 4px;
}

.message.bot .message-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

/* Input container */
.input-container {
    padding: 1rem 1.5rem 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.input-form {
    display: flex;
    gap: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.5rem;
    transition: border-color 0.2s ease;
}

.input-form:focus-within {
    border-color: var(--accent);
}

.input-form input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.5rem;
    outline: none;
}

.input-form input::placeholder {
    color: var(--text-secondary);
}

.input-form button {
    background: var(--accent);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.input-form button:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Scrollbar */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 600px) {
    .message-content {
        max-width: 85%;
    }

    .suggestions {
        flex-direction: column;
    }

    .suggestion {
        width: 100%;
    }
}

/* Dog button */
.dog-button {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
}

.dog-button:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-color: #fbbf24;
}

/* Chat images */
.message-content img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 0.5rem;
}