:root {
    --primary-dark: #8b4513;
    --primary-light: #a0522d;
    --accent-user: #fff8f0;
    --accent-user-alt: #fff0e0;
    --accent-bot: #fffaf5;
    --accent-bot-alt: #fff5ea;
    --profile-bg: linear-gradient(180deg,#ffffff,#fffcf9);
    --tag-bg: linear-gradient(135deg,#fff8f0,#ffe8d0);
    --tag-color: #8b4513;
    --border-color: #f5deb3;
    --input-border: #daa520;
    --text-primary: #5d3a1a;
    --text-secondary: #8b4513;
    --shadow-color: rgba(139,69,19,0.22);
    --bg-dark: #6b4423;
    --bg-panel: #6b4423;
    --text-light: #ffffff;
    --accent: #daa520;
    --secondary: #f4a460;
    --radius: 10px;
    --shadow: 0 8px 25px rgba(139, 69, 19, 0.3);
}

body {
    font-family: Georgia, 'Times New Roman', Times, serif;
    background: #fffaf5;
    color: #5d3a1a;
    margin: 0;
    padding: 0;
}

/* Container principal */
.container {
    width: 95%;
    margin: 40px auto;
    background: var(--bg-panel);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 18px 18px 24px 18px;
    color: var(--text-light);
    max-width: 1400px;
}

.container a {
    color: var(--secondary);
    font-weight: 700;
    text-decoration: none;
}
.container a:hover { opacity: 0.9; }

h3 {
    color: var(--accent);
    text-align: center;
    margin-bottom: 18px;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

/* Chat Box */
.chat-box {
    height: 350px;
    overflow-y: auto;
    background: #fffaf5;
    border: 1px solid var(--secondary);
    border-radius: var(--radius);
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
    box-shadow: 0 2px 12px rgba(139, 69, 19, 0.15);
}

.message {
    margin: 10px 0;
    padding: 12px 16px;
    border-radius: var(--radius);
    max-width: 80%;
    font-size: 1.04rem;
    line-height: 1.6;
    word-break: break-word;
    box-shadow: 0 2px 8px #0002;
}

.user {
    background: linear-gradient(135deg, #a0522d 0%, #8b4513 100%);
    color: var(--text-light);
    align-self: flex-end;
    text-align: right;
    border-bottom-right-radius: 2px;
    border-top-right-radius: 18px;
    border-top-left-radius: 18px;
    margin-left: auto;
}

.assistant {
    background: linear-gradient(135deg, #f4a460 0%, #daa520 100%);
    color: #ffffff;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

.error {
    background: #f8d7da;
    color: #842029;
    text-align: center;
    border: 1px solid #f5c2c7;
}

.warning {
    background: #fff3cd;
    color: #856404;
    text-align: center;
    border: 1px solid #ffeeba;
}

.chat-form-row {
    display: flex;
    align-items: stretch;
    gap: 0;
}

#user-message {
    background: #ffffff;
    color: #5d3a1a;
    border: 2px solid var(--secondary);
    border-right: none;
    border-radius: 10px 0 0 10px;
    padding: 12px;
    font-size: 1.05rem;
    height: 48px;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.1);
    flex: 1 1 auto;
    box-sizing: border-box;
}

#user-message::placeholder { color: #b8956f; }

.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 0 10px 10px 0;
    padding: 0 18px;
    font-size: 1.08rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s;
    box-shadow: 0 2px 8px rgba(212, 86, 143, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    min-width: 52px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.btn-primary:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 4px 12px rgba(212, 86, 143, 0.5); 
}

/* Tema Pink */
body.theme-pink {
    --primary-dark: #c94a7f;
    --primary-light: #e573a1;
    --accent-user: #fff8e6;
    --accent-user-alt: #fff5d4;
    --accent-bot: #ffe8f5;
    --accent-bot-alt: #ffd9ed;
    --profile-bg: linear-gradient(180deg,#ffffff,#fff5fa);
    --tag-bg: linear-gradient(135deg,#fee5f2,#fdd6eb);
    --tag-color: #b8357a;
    --border-color: #fdd9ec;
    --input-border: #f9c8de;
    --text-primary: #7a1f4d;
    --text-secondary: #a13367;
    --shadow-color: rgba(201,74,127,0.22);
}

body.theme-pink .user {
    background: linear-gradient(135deg,#fff8e6,#fff5d4);
    color: #6b5a00;
}

@media (max-width:600px) {
    .container { 
        width: 95% !important; 
        max-width: 95%; 
        padding:16px 12px; 
        margin: 20px auto; 
    }
    .chat-box { 
        height:220px; 
        padding:10px 4px; 
    }
    #user-message { 
        font-size:1rem; 
        height: 44px; 
    }
    .btn-primary { 
        height:44px; 
        font-size:1rem; 
        min-width: 44px; 
    }
}
