/* ========================================
   AJUSTES ESPECÍFICOS PARA CHAT.PHP
   ======================================== */

/* --- 1. HEADER MÁS DELGADO --- */
.header {
    padding: 0.5rem 0 !important; /* Reducido de 1rem a 0.5rem */
}

body {
    padding-top: 60px !important; /* Reducido de 80px a 60px */
}

/* --- 2. CHAT HEADER MÁS COMPACTO --- */
.chat-header {
    padding: 0.75rem 1.5rem;
    height: auto;
    min-height: 50px; /* Más delgado */
}

/* --- 3. BOTONES DE CATEGORÍAS MÁS PEQUEÑOS --- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    max-width: 600px;
    margin: 2rem auto 0;
}

.category-btn {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 1rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.category-btn:hover {
    border-color: #F4D03F;
    background: linear-gradient(135deg, #222 0%, #1a1a1a 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(244, 208, 63, 0.15);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.category-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

/* --- 4. BOTÓN DE ENVIAR - ESTILO AVIÓN DE PAPEL --- */
.chat-input-container {
    padding: 1rem 1.5rem;
    background: #0a0a0a;
    border-top: 1px solid #222;
}

.chat-input-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 0.875rem 1rem;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #F4D03F;
}

.chat-input::placeholder {
    color: #666;
}

/* Botón de enviar - Circular negro con avión blanco */
#sendBtn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    padding: 0 !important;
    background: #1a1a1a !important;
    border: 1px solid #333;
    border-radius: 50% !important; /* Circular */
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#sendBtn:hover {
    background: #2a2a2a !important;
    border-color: #F4D03F;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(244, 208, 63, 0.3);
}

#sendBtn:active {
    transform: scale(0.95);
}

#sendBtn svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
}

/* --- 5. RESPONSIVE PARA MÓVILES --- */

@media (max-width: 768px) {
    body {
        padding-top: 55px !important;
        overflow: hidden !important;
        height: 100dvh !important;
    }

    /* Chat container ocupa toda la pantalla */
    .chat-container {
        display: flex !important;
        flex-direction: column !important;
        height: 100dvh !important;
        overflow: hidden !important;
    }

    /* Chat main ocupa todo el espacio */
    .chat-main {
        display: flex !important;
        flex-direction: column !important;
        height: 100dvh !important;
        overflow: hidden !important;
        padding-top: 55px !important;
    }

    /* Header fijo y compacto */
    .chat-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 50 !important;
        padding: 0.5rem 1rem !important;
        min-height: 45px !important;
        flex-shrink: 0 !important;
    }

    /* Mensajes ocupan el espacio disponible y scrollean */
    .messages-container {
        flex: 1 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 1rem !important;
        padding-bottom: 1rem !important;
        height: auto !important;
        min-height: 0 !important;
    }

    /* Input SIEMPRE visible abajo - NO fixed, sino sticky */
    .chat-input-container {
        position: sticky !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 0.75rem 1rem !important;
        background: #0a0a0a !important;
        border-top: 1px solid #222 !important;
        flex-shrink: 0 !important;
        z-index: 50 !important;
    }

    .chat-input {
        padding: 0.75rem 0.875rem !important;
        font-size: 16px !important; /* Evita zoom automático en iOS */
        border-radius: 10px !important;
    }

    #sendBtn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
    }

    /* Botones de categorías */
    .categories-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
        max-width: 100% !important;
    }

    .category-btn {
        padding: 0.85rem 0.75rem !important;
        border-radius: 14px !important;
    }

    .starter-prompts {
        padding: 1.5rem 1rem !important;
    }

    .starter-title {
        font-size: 1.75rem !important;
        margin-bottom: 1rem !important;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 50px !important;
    }

    .chat-main {
        padding-top: 50px !important;
    }

    .chat-header {
        min-height: 40px !important;
        padding: 0.4rem 0.75rem !important;
    }

    .messages-container {
        padding: 0.75rem !important;
    }

    .chat-input-container {
        padding: 0.6rem 0.75rem !important;
    }

    .chat-input {
        font-size: 16px !important;
        padding: 0.7rem 0.8rem !important;
        border-radius: 10px !important;
    }

    #sendBtn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
    }

    #sendBtn svg {
        width: 16px !important;
        height: 16px !important;
    }

    .starter-title {
        font-size: 1.5rem !important;
    }

    .category-btn {
        padding: 0.75rem 0.65rem !important;
        border-radius: 12px !important;
    }

    .category-icon {
        font-size: 1.5rem !important;
    }

    .category-label {
        font-size: 0.75rem !important;
    }
}

/* --- 6. AJUSTES ADICIONALES --- */
.starter-prompts {
    padding: 2rem 1.5rem;
}

.starter-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.model-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    outline: none;
    cursor: pointer;
}

.model-select:focus {
    border-color: #F4D03F;
}

#messagesContainer {
    padding-bottom: 100px !important;
}
.chat-input-container {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
}