/* AI Cannabis - Estilos Modernos e Profissionais */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4ade80;
    --primary-dark: #22c55e;
    --primary-light: #86efac;
    --background: #0a0f0a;
    --card-bg: #0f1810;
    --border: #1f2d1f;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --glow: rgba(74, 222, 128, 0.3);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.7);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #0a0f0a 0%, #0f1810 50%, #0a0f0a 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===============================
   HEADER - DESIGN MODERNO
================================ */

header {
    background: rgba(15, 24, 16, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(74, 222, 128, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo-container:hover {
    transform: scale(1.02);
}

.logo {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 0 15px var(--glow));
    border-radius: 12px;
    background: rgba(74, 222, 128, 0.1);
    padding: 5px;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 20px var(--glow);
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* ===============================
   BOTÕES - DESIGN MODERNO
================================ */

.btn {
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--background);
    box-shadow: 0 0 25px var(--glow);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 0 0 40px var(--glow);
    transform: translateY(-3px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(74, 222, 128, 0.1);
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--background);
    box-shadow: 0 0 20px var(--glow);
}

/* ===============================
   ÍCONES - DESIGN MODERNO
================================ */

.icon-btn {
    background: rgba(74, 222, 128, 0.05);
    border: 1.5px solid var(--border);
    color: var(--primary);
    padding: 0.8rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    position: relative;
}

.icon-btn:hover {
    background: var(--primary);
    color: var(--background);
    box-shadow: 0 0 20px var(--glow);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.icon-btn:active {
    transform: translateY(0);
}

.icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===============================
   MENU RESPONSIVO
================================ */

.menu-toggle {
    display: none;
    background: rgba(74, 222, 128, 0.1);
    border: 1.5px solid var(--border);
    color: var(--primary);
    font-size: 1.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
}

.menu-toggle:hover {
    background: var(--primary);
    color: var(--background);
    box-shadow: 0 0 15px var(--glow);
}

/* ===============================
   SELETOR DE IDIOMA
================================ */

.language-wrapper {
    position: relative;
}

.lang-icon {
    font-size: 1.3rem;
    padding: 0.7rem;
}

.language-menu {
    position: absolute;
    top: 55px;
    right: 0;
    background: rgba(15, 24, 16, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    overflow: hidden;
}

.language-menu button {
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0.9rem 1.2rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.language-menu button:hover {
    background: var(--primary);
    color: var(--background);
    padding-left: 1.4rem;
}

.language-menu.hidden {
    display: none;
}

/* ===============================
   CONTAINER PRINCIPAL
================================ */

.container {
    max-width: 900px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

/* ===============================
   CHAT CONTAINER
================================ */

.chat-container {
    background: rgba(15, 24, 16, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    padding: 2.5rem;
    box-shadow: 0 0 50px rgba(74, 222, 128, 0.08);
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-title {
    text-align: center;
    margin-bottom: 2rem;
}

.chat-title h1 {
    font-size: 2.8rem;
    color: var(--primary);
    text-shadow: 0 0 30px var(--glow);
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.chat-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ===============================
   MENSAGENS
================================ */

.messages-container {
    flex: 1;
    overflow-y: auto;
    margin: 1.5rem 0;
    padding: 1.5rem;
    max-height: 400px;
    scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: rgba(74, 222, 128, 0.05);
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    animation: slideIn 0.3s ease-out;
}

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

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

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

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--background);
}

.message.assistant .message-avatar {
    background: rgba(74, 222, 128, 0.15);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.message-content {
    background: var(--background);
    padding: 1.2rem;
    border-radius: 1rem;
    max-width: 70%;
    border: 1px solid var(--border);
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--background);
    border: none;
}

.message-image {
    max-width: 100%;
    border-radius: 0.75rem;
    margin-top: 0.8rem;
    border: 1px solid var(--primary);
    cursor: pointer;
    transition: all 0.3s;
}

.message-image:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px var(--glow);
}

/* ===============================
   ÁREA DE INPUT
================================ */

.input-container {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.question-counter {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.question-counter.warning {
    color: var(--warning);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.input-group {
    flex: 1;
    position: relative;
}

.chat-input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 1.5px solid var(--border);
    border-radius: 0.85rem;
    background: rgba(10, 15, 10, 0.8);
    color: var(--text);
    font-size: 1rem;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
    transition: all 0.3s;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--glow);
    background: rgba(10, 15, 10, 0.95);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.image-preview {
    position: relative;
    margin-top: 0.8rem;
}

.image-preview img {
    max-width: 150px;
    border-radius: 0.75rem;
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px var(--glow);
}

.remove-image {
    position: absolute;
    top: -12px;
    right: -12px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.remove-image:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.input-actions {
    display: flex;
    gap: 0.8rem;
}

/* ===============================
   MENU DE FOTOS
================================ */

.photo-menu {
    position: absolute;
    bottom: 80px;
    right: 20px;
    background: rgba(15, 24, 16, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 0.8rem;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    min-width: 220px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.photo-menu.hidden {
    display: none;
}

.photo-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    border-radius: 0.7rem;
    transition: all 0.3s;
    color: var(--text);
    font-weight: 500;
}

.photo-menu-item:hover {
    background: var(--primary);
    color: var(--background);
    padding-left: 1.2rem;
}

.photo-menu-item span:first-child {
    font-size: 1.5rem;
}

/* ===============================
   MODAL CÂMERA
================================ */

.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.camera-modal.hidden {
    display: none;
}

.camera-container {
    width: 100%;
    max-width: 640px;
    padding: 20px;
}

.camera-video {
    width: 100%;
    border-radius: 1.2rem;
    background: #000;
    box-shadow: var(--shadow-lg);
}

.camera-canvas {
    display: none;
}

.camera-controls {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.camera-btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 0.85rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.camera-btn-capture {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--background);
    box-shadow: 0 0 25px var(--glow);
}

.camera-btn-capture:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: scale(1.05);
    box-shadow: 0 0 40px var(--glow);
}

.camera-btn-cancel {
    background: var(--error);
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.camera-btn-cancel:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* ===============================
   LOADING - ANIMAÇÃO
================================ */

.loading {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.loading.hidden {
    display: none;
}

.loading-dot {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    box-shadow: 0 0 10px var(--glow);
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===============================
   MODAL - AUTENTICAÇÃO
================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(15, 24, 16, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 0 60px var(--glow);
    animation: slideUp 0.3s ease-out;
    position: relative;
}

.modal-title {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: 0.75rem;
    background: rgba(10, 15, 10, 0.8);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--glow);
    background: rgba(10, 15, 10, 0.95);
}

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

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-actions .btn {
    flex: 1;
}

.modal-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.modal-switch a {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.modal-switch a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

#closeModal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#closeModal:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

/* ===============================
   HISTÓRICO - CONVERSAS
================================ */

.conversations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.conversation-card {
    background: rgba(15, 24, 16, 0.8);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.conversation-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--glow);
    transform: translateY(-8px);
}

.conversation-title {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.conversation-preview {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===============================
   RESPONSIVO - MOBILE
================================ */

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .menu-toggle {
        display: block;
    }

    .header-actions {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        width: 100%;
        background: rgba(15, 24, 16, 0.98);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        padding: 1.2rem;
        display: none;
        flex-direction: column;
        gap: 1rem;
        z-index: 999;
        box-shadow: var(--shadow-lg);
        animation: slideDown 0.3s ease-out;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .header-actions.active {
        display: flex !important;
    }

    .header-actions .btn,
    .header-actions a {
        width: 100%;
        text-align: center;
    }

    .container {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }

    .chat-container {
        padding: 1.5rem;
        min-height: auto;
    }

    .chat-title h1 {
        font-size: 2rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .message-content {
        max-width: 90%;
    }

    .modal-content {
        padding: 1.8rem;
        max-width: 90%;
    }

    .conversations-grid {
        grid-template-columns: 1fr;
    }

    .camera-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .camera-btn {
        width: 100%;
    }

    .language-menu {
        right: auto;
        left: 0;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.8rem;
    }

    .logo-container {
        gap: 0.8rem;
    }

    .logo {
        width: 100px;
        height: 100px;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .chat-title h1 {
        font-size: 1.5rem;
    }

    .chat-title {
        margin-bottom: 1rem;
    }

    .btn {
        padding: 0.7rem 1.4rem;
        font-size: 0.9rem;
    }

    .message-content {
        max-width: 95%;
        padding: 0.9rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .input-actions {
        width: 100%;
    }

    .input-actions .btn {
        flex: 1;
    }
}

/* ===============================
   UTILITÁRIOS
================================ */

.hidden {
    display: none !important;
}

/* Scrollbar customizado */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(74, 222, 128, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Transições suaves */
* {
    transition: background-color 0.3s ease, color 0.3s ease;
}

button, a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ===============================
   ANIMAÇÃO DE FOLHA DE CANNABIS
================================ */

.cannabis-leaf-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}

.cannabis-leaf-loader.hidden {
    display: none;
}

.leaf-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.leaf-svg {
    width: 100%;
    height: 100%;
    animation: leafRotate 3s linear infinite, leafFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px var(--glow));
}

@keyframes leafRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes leafFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(360deg);
    }
}

.leaf-text {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Versão alternativa com múltiplas folhas */
.cannabis-multi-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
}

.leaf-item {
    width: 60px;
    height: 60px;
    animation: leafBounce 1.2s ease-in-out infinite;
}

.leaf-item:nth-child(1) {
    animation-delay: 0s;
}

.leaf-item:nth-child(2) {
    animation-delay: 0.2s;
}

.leaf-item:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes leafBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-20px) scale(1.1);
        opacity: 0.8;
    }
}

/* Versão com efeito de crescimento */
.cannabis-grow-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
}

.leaf-grow {
    width: 80px;
    height: 80px;
    animation: leafGrow 2s ease-in-out infinite;
    filter: drop-shadow(0 0 15px var(--glow));
}

@keyframes leafGrow {
    0% {
        transform: scale(0.3) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.8) rotate(45deg);
        opacity: 0;
    }
}

.grow-text {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* Loader com partículas */
.cannabis-particle-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    width: 120px;
    height: 120px;
}

.leaf-center {
    width: 100%;
    height: 100%;
    animation: leafSpin 2s linear infinite;
    filter: drop-shadow(0 0 20px var(--glow));
}

@keyframes leafSpin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--glow);
}

.particle:nth-child(1) {
    animation: particleMove1 2s ease-in-out infinite;
}

.particle:nth-child(2) {
    animation: particleMove2 2s ease-in-out infinite;
}

.particle:nth-child(3) {
    animation: particleMove3 2s ease-in-out infinite;
}

.particle:nth-child(4) {
    animation: particleMove4 2s ease-in-out infinite;
}

@keyframes particleMove1 {
    0%, 100% {
        top: 50%;
        left: 50%;
        opacity: 0;
    }
    50% {
        top: 10%;
        left: 50%;
        opacity: 1;
    }
}

@keyframes particleMove2 {
    0%, 100% {
        top: 50%;
        left: 50%;
        opacity: 0;
    }
    50% {
        top: 90%;
        left: 50%;
        opacity: 1;
    }
}

@keyframes particleMove3 {
    0%, 100% {
        top: 50%;
        left: 50%;
        opacity: 0;
    }
    50% {
        top: 50%;
        left: 10%;
        opacity: 1;
    }
}

@keyframes particleMove4 {
    0%, 100% {
        top: 50%;
        left: 50%;
        opacity: 0;
    }
    50% {
        top: 50%;
        left: 90%;
        opacity: 1;
    }
}

/* Loader com brilho */
.cannabis-glow-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.leaf-glow {
    width: 100px;
    height: 100px;
    position: relative;
    animation: leafGlowSpin 3s linear infinite;
}

.leaf-glow svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px var(--primary));
}

@keyframes leafGlowSpin {
    0% {
        transform: rotate(0deg);
        filter: drop-shadow(0 0 10px var(--primary));
    }
    50% {
        filter: drop-shadow(0 0 30px var(--primary));
    }
    100% {
        transform: rotate(360deg);
        filter: drop-shadow(0 0 10px var(--primary));
    }
}

.glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: ringExpand 2s ease-out infinite;
}

@keyframes ringExpand {
    0% {
        width: 120px;
        height: 120px;
        opacity: 0.8;
    }
    100% {
        width: 180px;
        height: 180px;
        opacity: 0;
    }
}

/* Responsivo para loaders */
@media (max-width: 768px) {
    .cannabis-leaf-loader {
        padding: 1.5rem;
    }

    .leaf-container {
        width: 100px;
        height: 100px;
    }

    .cannabis-multi-loader {
        gap: 1rem;
    }

    .leaf-item {
        width: 50px;
        height: 50px;
    }

    .leaf-grow {
        width: 60px;
        height: 60px;
    }

    .cannabis-particle-loader {
        width: 100px;
        height: 100px;
    }

    .leaf-glow {
        width: 80px;
        height: 80px;
    }

    .glow-ring {
        width: 100px;
        height: 100px;
    }
}


/* ===============================
   NOVO LOADER - FOLHA ENCHENDO
================================ */

.cannabis-fill-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    gap: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.cannabis-fill-loader.hidden {
    display: none;
}

.fill-leaf-container {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fill-leaf-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 25px var(--glow));
    animation: leafPulse 0.5s ease-in-out infinite;
}

@keyframes leafPulse {
    0%, 100% {
        filter: drop-shadow(0 0 25px var(--glow));
    }
    50% {
        filter: drop-shadow(0 0 40px var(--glow));
    }
}

/* Animação de enchimento da máscara */
@keyframes fillUp {
    0% {
        y: 100;
        height: 100;
    }
    100% {
        y: 0;
        height: 200;
    }
}

.fill-leaf-svg #fillRect {
    animation: fillUp 2.5s ease-in-out infinite;
}

/* Animação de rotação suave */
@keyframes leafRotateSlow {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(5deg) scale(1.05);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

.fill-leaf-svg {
    animation: leafPulse 0.5s ease-in-out infinite, leafRotateSlow 3s ease-in-out infinite;
}

/* Texto de status */
.fill-status-text {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    animation: fadeInOut 2.5s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Indicador de progresso - barras verticais */
.fill-progress-bars {
    display: flex;
    gap: 0.4rem;
    align-items: flex-end;
    height: 40px;
}

.progress-bar {
    width: 4px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--glow);
    animation: barGrow 1.2s ease-in-out infinite;
}

.progress-bar:nth-child(1) {
    animation-delay: 0s;
    height: 20%;
}

.progress-bar:nth-child(2) {
    animation-delay: 0.15s;
    height: 40%;
}

.progress-bar:nth-child(3) {
    animation-delay: 0.3s;
    height: 60%;
}

.progress-bar:nth-child(4) {
    animation-delay: 0.45s;
    height: 80%;
}

.progress-bar:nth-child(5) {
    animation-delay: 0.6s;
    height: 100%;
}

@keyframes barGrow {
    0%, 100% {
        height: 20%;
        opacity: 0.5;
    }
    50% {
        height: 100%;
        opacity: 1;
    }
}

/* Versão com partículas ao redor */
.cannabis-fill-particle-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    gap: 1.5rem;
    position: relative;
}

.cannabis-fill-particle-loader.hidden {
    display: none;
}

.fill-leaf-container-particle {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fill-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--glow);
}

.fill-particle:nth-child(1) {
    animation: particleOrbit1 3s linear infinite;
}

.fill-particle:nth-child(2) {
    animation: particleOrbit2 3s linear infinite;
}

.fill-particle:nth-child(3) {
    animation: particleOrbit3 3s linear infinite;
}

.fill-particle:nth-child(4) {
    animation: particleOrbit4 3s linear infinite;
}

@keyframes particleOrbit1 {
    0% {
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }
    25% {
        top: 50%;
        left: 100%;
        transform: translate(-50%, -50%);
    }
    50% {
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
    }
    75% {
        top: 50%;
        left: 0;
        transform: translate(-50%, -50%);
    }
    100% {
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }
}

@keyframes particleOrbit2 {
    0% {
        top: 50%;
        left: 100%;
        transform: translate(-50%, -50%);
    }
    25% {
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
    }
    50% {
        top: 50%;
        left: 0;
        transform: translate(-50%, -50%);
    }
    75% {
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }
    100% {
        top: 50%;
        left: 100%;
        transform: translate(-50%, -50%);
    }
}

@keyframes particleOrbit3 {
    0% {
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
    }
    25% {
        top: 50%;
        left: 0;
        transform: translate(-50%, -50%);
    }
    50% {
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }
    75% {
        top: 50%;
        left: 100%;
        transform: translate(-50%, -50%);
    }
    100% {
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
    }
}

@keyframes particleOrbit4 {
    0% {
        top: 50%;
        left: 0;
        transform: translate(-50%, -50%);
    }
    25% {
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }
    50% {
        top: 50%;
        left: 100%;
        transform: translate(-50%, -50%);
    }
    75% {
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
    }
    100% {
        top: 50%;
        left: 0;
        transform: translate(-50%, -50%);
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .cannabis-fill-loader {
        padding: 1.5rem;
        gap: 1rem;
    }

    .fill-leaf-container {
        width: 120px;
        height: 120px;
    }

    .fill-status-text {
        font-size: 0.9rem;
    }

    .progress-bar {
        width: 3px;
    }

    .fill-leaf-container-particle {
        width: 120px;
        height: 120px;
    }

    .fill-particle {
        width: 5px;
        height: 5px;
    }
}

@media (max-width: 480px) {
    .cannabis-fill-loader {
        padding: 1rem;
        gap: 0.8rem;
    }

    .fill-leaf-container {
        width: 100px;
        height: 100px;
    }

    .fill-status-text {
        font-size: 0.85rem;
    }

    .progress-bar {
        width: 2px;
    }
}


/* ===============================
   NOVO LOADER - IMAGEM COM EFEITO
================================ */

.cannabis-image-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    gap: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.cannabis-image-loader.hidden {
    display: none;
}

.image-loader-container {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-loader-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: leafThink 2s ease-in-out infinite;
    filter: drop-shadow(0 0 25px var(--glow));
}

/* Efeito de rotação suave com pulsação */
@keyframes leafThink {
    0% {
        transform: rotate(0deg) scale(1);
        filter: drop-shadow(0 0 25px var(--glow));
    }
    25% {
        transform: rotate(-5deg) scale(1.05);
        filter: drop-shadow(0 0 35px var(--glow));
    }
    50% {
        transform: rotate(0deg) scale(1.1);
        filter: drop-shadow(0 0 45px var(--glow));
    }
    75% {
        transform: rotate(5deg) scale(1.05);
        filter: drop-shadow(0 0 35px var(--glow));
    }
    100% {
        transform: rotate(0deg) scale(1);
        filter: drop-shadow(0 0 25px var(--glow));
    }
}

/* Efeito de brilho pulsante */
.image-loader-container::before {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    animation: pulseRing 2s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

/* Efeito de partículas ao redor */
.image-loader-container::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: particleFloat 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--glow);
}

@keyframes particleFloat {
    0% {
        top: 0;
        left: 50%;
        opacity: 1;
    }
    50% {
        top: 50%;
        left: 100%;
        opacity: 0.5;
    }
    100% {
        top: 0;
        left: 50%;
        opacity: 1;
    }
}

/* Texto de status */
.image-loader-text {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    animation: fadeInOut 2s ease-in-out infinite;
    text-align: center;
}

/* Indicador de progresso com pontos */
.loader-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.loader-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotBounce 1.4s infinite;
    box-shadow: 0 0 8px var(--glow);
}

.loader-dot:nth-child(1) {
    animation-delay: 0s;
}

.loader-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .cannabis-image-loader {
        padding: 1.5rem;
        gap: 1rem;
    }

    .image-loader-container {
        width: 120px;
        height: 120px;
    }

    .image-loader-container::before {
        width: 140px;
        height: 140px;
    }

    .image-loader-text {
        font-size: 0.9rem;
    }

    .loader-dot {
        width: 7px;
        height: 7px;
    }
}

@media (max-width: 480px) {
    .cannabis-image-loader {
        padding: 1rem;
        gap: 0.8rem;
    }

    .image-loader-container {
        width: 100px;
        height: 100px;
    }

    .image-loader-container::before {
        width: 120px;
        height: 120px;
    }

    .image-loader-text {
        font-size: 0.85rem;
    }

    .loader-dot {
        width: 6px;
        height: 6px;
    }
}


/* ===============================
   EFEITO ESPECIAL - FOLHA PENSANDO
================================ */

.image-loader-container img {
    filter: drop-shadow(0 0 25px var(--glow)) 
            brightness(1.1) 
            saturate(1.2) 
            hue-rotate(10deg);
    animation: leafThink 2s ease-in-out infinite,
               glowPulse 1.5s ease-in-out infinite,
               shimmer 3s ease-in-out infinite;
}

/* Efeito de brilho pulsante mais intenso */
@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 15px var(--primary))
                drop-shadow(0 0 25px var(--glow));
    }
    50% {
        filter: drop-shadow(0 0 30px var(--primary))
                drop-shadow(0 0 50px var(--glow))
                drop-shadow(0 0 80px rgba(74, 222, 128, 0.5));
    }
}

/* Efeito de brilho ondulante */
@keyframes shimmer {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        opacity: 1;
    }
}

/* Efeito de movimento suave */
@keyframes leafThink {
    0% {
        transform: rotate(0deg) scale(1) translateY(0);
    }
    25% {
        transform: rotate(-8deg) scale(1.08) translateY(-5px);
    }
    50% {
        transform: rotate(0deg) scale(1.12) translateY(0);
    }
    75% {
        transform: rotate(8deg) scale(1.08) translateY(-5px);
    }
    100% {
        transform: rotate(0deg) scale(1) translateY(0);
    }
}

/* Anel com efeito de múltiplas camadas */
.image-loader-container::before {
    box-shadow: 0 0 20px var(--primary),
                0 0 40px rgba(74, 222, 128, 0.5),
                inset 0 0 20px rgba(74, 222, 128, 0.2);
}

/* Partícula com brilho aumentado */
.image-loader-container::after {
    box-shadow: 0 0 15px var(--glow),
                0 0 30px rgba(74, 222, 128, 0.6);
}


/* ===============================
   MODAL DE SALVAR CONVERSA
================================ */

.save-conversation-modal {
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-modal-content {
    width: 90%;
    max-width: 500px;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(15, 24, 16, 0.8) 100%);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

.save-modal-content h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.save-modal-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.save-modal-content .form-group {
    margin-bottom: 1.5rem;
}

.save-modal-content label {
    display: block;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.save-modal-content input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s;
}

.save-modal-content input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(74, 222, 128, 0.1);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.3);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-buttons .btn {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ===============================
   BOTÃO DE SALVAR CONVERSA RÁPIDO
================================ */

.save-conversation-prompt {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid var(--primary);
    border-radius: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.save-conversation-prompt .btn {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ===============================
   NOTIFICAÇÕES
================================ */

.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease-out;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text);
    font-weight: 500;
}

.notification-success {
    border-color: var(--primary);
    background: rgba(74, 222, 128, 0.1);
}

.notification-success .notification-content {
    color: var(--primary);
}

.notification-error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.notification-error .notification-content {
    color: var(--error);
}

.notification-info {
    border-color: var(--primary);
    background: rgba(74, 222, 128, 0.1);
}

.notification-info .notification-content {
    color: var(--primary);
}

/* Responsivo */
@media (max-width: 768px) {
    .save-modal-content {
        padding: 1.5rem;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-buttons .btn {
        width: 100%;
    }

    .notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .save-conversation-prompt {
        flex-direction: column;
    }

    .save-conversation-prompt .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .save-modal-content {
        width: 95%;
        padding: 1.2rem;
    }

    .save-modal-content h2 {
        font-size: 1.2rem;
    }

    .notification {
        bottom: 0.8rem;
        right: 0.8rem;
        left: 0.8rem;
        padding: 0.8rem 1rem;
    }
}


/* ========== FORMATAÇÃO DE TEXTO DAS RESPOSTAS ========== */
.message.assistant .message-content {
    line-height: 1.7;
}

.message.assistant .message-content p {
    margin-bottom: 16px;
}

.message.assistant .message-content h1,
.message.assistant .message-content h2,
.message.assistant .message-content h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #4ade80;
}

.message.assistant .message-content h1 {
    font-size: 24px;
}

.message.assistant .message-content h2 {
    font-size: 20px;
}

.message.assistant .message-content h3 {
    font-size: 18px;
}

.message.assistant .message-content ul,
.message.assistant .message-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.message.assistant .message-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.message.assistant .message-content strong {
    font-weight: 600;
    color: #4ade80;
}

.message.assistant .message-content em {
    font-style: italic;
    color: #9ca3af;
}

.message.assistant .message-content code {
    background: #1f2937;
    color: #4ade80;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

.message.assistant .message-content pre {
    background: #1f2937;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.message.assistant .message-content pre code {
    background: transparent;
    padding: 0;
}


/* ========== LAYOUT MOBILE ESTILO MANUS ========== */
@media (max-width: 768px) {
    body {
        overflow: hidden;
    }
    
    .container {
        height: 100vh;
        display: flex;
        flex-direction: column;
        padding: 0;
        margin: 0;
        max-width: 100%;
    }
    
    .chat-container {
        height: 100vh;
        display: flex;
        flex-direction: column;
        padding: 0;
        margin: 0;
        border-radius: 0;
        border: none;
    }
    
    .chat-title {
        flex-shrink: 0;
        padding: 1rem;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border);
    }
    
    .chat-title h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .chat-subtitle {
        font-size: 0.875rem;
    }
    
    .messages-container {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
        margin-bottom: 0;
    }
    
    .input-container {
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--card-bg);
        border-top: 1px solid var(--border);
        padding: 0.75rem;
        margin: 0;
        border-radius: 0;
    }
    
    .input-wrapper {
        margin: 0;
    }
    
    .chat-input {
        min-height: 44px;
        max-height: 120px;
        font-size: 16px; /* Evita zoom no iOS */
        padding: 0.75rem;
    }
    
    .input-actions {
        margin-top: 0.5rem;
        gap: 0.5rem;
    }
    
    .icon-btn {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
    
    /* Loader pequeno no mobile */
    .cannabis-image-loader {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1000;
    }
    
    .image-loader-container {
        width: 60px;
        height: 60px;
    }
    
    .image-loader-text {
        font-size: 0.875rem;
        margin-top: 0.5rem;
    }
    
    /* Mensagens no mobile */
    .message {
        margin-bottom: 1rem;
        padding: 0.75rem;
    }
    
    .message-content {
        font-size: 0.9375rem;
        line-height: 1.5;
    }
    
    /* Footer escondido no mobile durante chat */
    footer,
    .seo-content {
        display: none;
    }
}

/* ========== LAYOUT DESKTOP ========== */
@media (min-width: 769px) {
    .container {
        max-width: 900px;
        margin: 0 auto;
        padding: 2rem 1rem;
    }
    
    .chat-container {
        min-height: 600px;
    }
    
    .messages-container {
        min-height: 400px;
        max-height: 600px;
    }
}


/* ===============================
   OVERRIDE FINAL – CHAT GPT REAL
   =============================== */

/* Remove card visual do chat */
.container,
.chat-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Centraliza apenas o conteúdo */
.messages-container,
.input-wrapper {
    max-width: 880px !important;
    margin: 0 auto !important;
}

/* Área das mensagens */
.messages-container {
    padding: 32px 16px 160px !important;
    gap: 32px !important;
    max-height: none !important;
}

/* Remove completamente estrutura antiga */
.message {
    all: unset;
    display: block;
    margin-bottom: 32px;
}

/* Remove avatar e alinhamentos antigos */
.message-avatar,
.message-header {
    display: none !important;
}

/* Texto das mensagens */
.message-content {
    all: unset;
    display: block;
    width: 100%;
    font-size: 1.08rem;
    line-height: 1.8;
    color: #e5e7eb;
    white-space: pre-wrap;
}

/* IA – um pouco maior */
.message.assistant .message-content {
    font-size: 1.12rem;
}

/* Usuário */
.message.user .message-content {
    opacity: 0.9;
}

/* INPUT FIXO */
.input-container {
    position: fixed !important;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(
        to top,
        #0b120e 85%,
        rgba(11,18,14,0)
    );
    padding: 16px !important;
    border-top: none !important;
    z-index: 999;
}

/* Textarea estilo GPT */
.chat-input {
    width: 100% !important;
    font-size: 1.05rem;
    line-height: 1.6;
    padding: 14px 16px;
    border-radius: 14px;
    resize: none;
}

/* Mobile */
@media (max-width: 768px) {
    .messages-container {
        padding: 20px 14px 180px !important;
    }

    .chat-input {
        font-size: 16px !important;
    }
}

/* =====================================
   CORREÇÃO DEFINITIVA INPUT MOBILE
===================================== */

/* BASE */
.input-container {
    width: 100%;
    left: 0;
    z-index: 1000;
    background: linear-gradient(
        to top,
        #0b120e 90%,
        rgba(11,18,14,0)
    );
}

/* DESKTOP */
@media (min-width: 769px) {
    .input-container {
        position: fixed;
        bottom: 0;
    }

    .messages-container {
        padding-bottom: 200px !important;
    }
}

/* MOBILE – comportamento tipo GPT */
@media (max-width: 768px) {
    .input-container {
        position: sticky !important;
        bottom: 0;
    }

    .messages-container {
        padding-bottom: 140px !important;
    }

    /* garante que nada esconda */
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}


/* ===============================
   TÍTULO INICIAL DO CHAT
================================ */
.chat-title {
    transition: all 0.4s ease;
}

/* ESCONDER APÓS PRIMEIRA MENSAGEM */
.chat-title.hidden {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* =========================================
   MODO CHAT ATIVO (APÓS PRIMEIRA RESPOSTA)
========================================= */

body.chat-active .chat-title {
    display: none;
}

/* some contador e textos inúteis */
body.chat-active .question-counter {
    display: none !important;
}

/* container principal sem limite */
body.chat-active .container,
body.chat-active .chat-container {
    max-width: 100% !important;
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
}

/* mensagens ocupam tudo */
body.chat-active .messages-container {
    max-width: 100% !important;
    width: 100%;
    padding: 24px 5vw 160px !important;
    margin: 0;
}

/* mensagens SEM limite lateral */
body.chat-active .message {
    max-width: 100% !important;
}

/* texto da IA largo, confortável */
body.chat-active .message.assistant .message-content {
    max-width: 100% !important;
    width: 100%;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* campo de escrita largura total */
body.chat-active .input-container {
    width: 100%;
    left: 0;
    right: 0;
}

/* textarea de ponta a ponta */
body.chat-active .chat-input {
    width: 100%;
    max-width: 100%;
}

/* MOBILE */
@media (max-width: 768px) {
    body.chat-active .messages-container {
        padding: 16px 12px 140px !important;
    }

    body.chat-active .message.assistant .message-content {
        font-size: 1rem;
    }
}

/* ===============================
   FIX DEFINITIVO HEADER MOBILE
================================ */
@media (max-width: 768px) {

    header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0.8rem 1rem !important;
        text-align: left !important;
    }

    .logo-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        width: auto !important;
        margin: 0 !important;
    }

    .logo-container img.logo {
        width: 36px !important;
        height: 36px !important;
        display: block !important;
    }

    .logo-text {
        font-size: 1rem !important;
        white-space: nowrap !important;
    }

    .menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        margin: 0 !important;
    }

    /* GARANTE QUE NÃO QUEBRE LINHA */
    header>* {
        flex-shrink: 0;
    }
}

/* ===============================
   ESTADO INICIAL DO CHAT (VAZIO)
================================ */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 45vh;
    gap: 14px;
    opacity: 0.85;
}

.chat-empty-image {
    width: 70%;
    max-width: 220px;
    filter: drop-shadow(0 0 25px rgba(74,222,128,0.25));
}

.chat-empty-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}

