/* ===========================================
   ASISTENTE VIRTUAL CHILLÁN VIEJO
   Estilos CSS - Versión Reparada y Optimizada
   =========================================== */

:root {
    /* Institutional Color Palette */
    --primary-color: #003399;
    --primary-hover: #002266;
    --secondary-color: #f1f5f9;
    --accent-color: #0ea5e9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;

    /* Modern UI tokens */
    --bg-surface: #ffffff;
    --bg-app: #f8fafc;
    --border-soft: #e2e8f0;
    --shadow-soft: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-card: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    /* Standard Spacing */
    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-full: 9999px;

    /* Spacing Refined */
    --gap-xs: 0.25rem;
    --gap-sm: 0.75rem;
    --gap-md: 1rem;
    --gap-lg: 1.5rem;

    /* Typo Scale (Standard/Professional) */
    --font-base: 16px;
    --h1: 2rem;
    --h2: 1.5rem;
    --h3: 1.25rem;
}

/* Reading Mode (Legacy Accessibility) - Refined */
body.font-large {
    --font-base: 18px;
    --h1: 2.5rem;
    --h2: 2rem;
    --h3: 1.5rem;
}

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

html {
    font-size: var(--font-base);
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Controls */
.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    border-bottom: 1px solid var(--border-soft);
    height: 64px;
    display: flex;
    align-items: center;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.logo-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    display: block;
    margin-top: 1px;
}

.accessibility-controls {
    display: flex;
    gap: 4px;
    background: var(--secondary-color);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.access-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.access-btn:hover {
    color: var(--primary-color);
}

#fontNormal {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-soft);
}

body.font-large #fontNormal {
    background: transparent;
    color: var(--text-muted);
    box-shadow: none;
}

body.font-large #fontLarge {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-soft);
}

/* Main Layout Centered */
.main-content {
    flex: 1;
    padding: var(--spacing-md);
    width: 100%;
    max-width: 1100px;
    margin: 70px auto 0 auto;
}

/* Home View Layout */
#homeView {
    display: flex;
    flex-direction: column;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    padding: var(--gap-md) 0;
}

.welcome-container {
    max-width: 650px;
    margin: 0 auto;
}

.assistant-avatar {
    width: 64px;
    height: 64px;
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--gap-sm);
    box-shadow: var(--shadow-soft);
    font-size: 1.5rem;
}

.welcome-title {
    font-size: var(--h1);
    color: var(--text-main);
    margin-bottom: var(--gap-xs);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.welcome-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* Search Box Repair */
.search-section {
    padding: var(--gap-md) 0;
}

.search-container {
    max-width: 720px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    outline: 2px solid rgba(0, 51, 153, 0.2);
    box-shadow: 0 0 0 4px rgba(0, 51, 153, 0.1);
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 1rem;
    outline: none;
    color: var(--text-main);
    background: transparent;
}

.search-button {
    background: var(--primary-color);
    border: none;
    padding: 0 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.search-button:hover {
    background: var(--primary-hover);
}

.search-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 12px;
}

/* Categories Section */
.categories-section {
    padding: var(--gap-lg) 0;
}

.section-title {
    font-size: var(--h3);
    color: var(--text-main);
    margin-bottom: var(--gap-md);
    text-align: center;
    font-weight: 600;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--gap-md);
}

.category-card {
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.category-card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.category-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    background: var(--secondary-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.category-card:hover .category-icon {
    background: #e0f2fe;
}

.category-info {
    display: flex;
    flex-direction: column;
}

.category-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.25;
}

.category-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chat-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 2px solid rgba(14, 165, 233, 0.3);
    transition: all 0.2s;
    padding: 0 2px;
}

.chat-link:hover {
    background: rgba(14, 165, 233, 0.1);
    border-bottom-color: var(--accent-color);
}

.maps-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #10b981;
    /* Green color for Maps */
    color: white !important;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    text-decoration: none !important;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 12px 0;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
    border-bottom: none !important;
}

.maps-button:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.35);
}


/* Info Useful Section */
.info-section {
    padding: var(--gap-lg) 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--gap-md);
    padding: var(--gap-md) 0;
}

.info-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-soft);
}

.info-icon {
    font-size: 1.25rem;
    display: block;
    margin-bottom: 8px;
    opacity: 0.8;
}

.info-card h4 {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 4px;
    font-weight: 600;
}

.info-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Chat Section Restoration */
.chat-section {
    display: none;
    padding: var(--gap-md) 0 100px;
}

.chat-section.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: var(--gap-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    min-height: 70vh;
}

.chat-controls {
    margin-bottom: var(--gap-lg);
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 12px;
}

.back-home-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.back-home-btn:hover {
    background: var(--secondary-color);
    color: var(--text-main);
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
}

.message {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    line-height: 1.6;
    max-width: 90%;
}

.message.user {
    background: var(--primary-color);
    color: var(--white);
    align-self: flex-end;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 16px 16px 2px 16px;
    box-shadow: 0 4px 12px rgba(0, 51, 153, 0.15);
}

.message.assistant {
    background: var(--white);
    color: var(--text-main);
    align-self: flex-start;
    font-size: 0.95rem;
    border-radius: 2px 16px 16px 16px;
    border: 1px solid var(--border-soft);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    /* For absolute positioning of tools if needed, but flex is better */
    padding-bottom: 32px;
    /* Space for tools */
}

.msg-tools {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    border-top: 1px solid var(--border-soft);
    padding-top: 8px;
    justify-content: flex-end;
}

.msg-tool-btn {
    background: transparent;
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.msg-tool-btn:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.message p {
    margin-bottom: 1rem;
}

.message p:last-child {
    margin-bottom: 0;
}

.response-list {
    margin: 0.5rem 0 1rem 1.25rem;
    padding: 0;
    list-style: none;
}

.response-list li {
    position: relative;
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
}

.response-list li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.message p strong:first-child:last-child {
    color: var(--primary-color);
    font-weight: 700;
}

.response-h2 {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 1.5rem 0 0.5rem 0;
    border-bottom: 2px solid var(--border-soft);
    padding-bottom: 4px;
}

.response-h3 {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Director Photo & Responsive Images */
.chat-image-container {
    margin: 12px 0;
    display: block;
    max-width: 100%;
}

.chat-image-response {
    max-width: 200px;
    height: auto;
    border-radius: var(--radius-md);
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-soft);
    display: block;
    background: #f8fafc;
}

.director-photo-thumb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    float: left;
    margin-right: 12px;
    margin-bottom: 8px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


.category-banner {
    background: var(--secondary-color);
    padding: var(--gap-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--gap-md);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
}

.banner-icon {
    font-size: 2rem;
}

.banner-text h2 {
    font-size: 1.25rem;
    color: var(--text-main);
    font-weight: 600;
}

.banner-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Sticky Chat Footer */
.chat-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-soft);
    padding: 12px 0;
    z-index: 1000;
}

.footer-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.chat-input-wrapper {
    display: flex;
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-full);
    padding: 4px;
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 2;
}

/* Quick Chips Scroll */
.quick-chips-wrapper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 8px;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
    -ms-overflow-style: none;
    /* Hide scrollbar IE */
}

.quick-chips-wrapper::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.quick-chip {
    background: var(--white);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    user-select: none;
}

.quick-chip:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 51, 153, 0.2);
}

.quick-chip:active {
    transform: scale(0.95);
}

.chat-input {
    flex: 1;
    border: none;
    padding: 10px 20px;
    outline: none;
    font-size: 0.95rem;
    background: transparent;
    color: var(--text-main);
}

.send-button {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.send-button:hover {
    background: var(--primary-hover);
}

/* Main Footer */
.footer {
    background: var(--white);
    color: var(--text-muted);
    padding: var(--gap-lg) 24px;
    text-align: center;
    border-top: 1px solid var(--border-soft);
    margin-top: auto;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer p {
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.footer-disclaimer {
    opacity: 0.7;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--secondary-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Quick Replies & Theme Buttons */
.theme-buttons-container,
.quick-replies-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.theme-button,
.quick-reply-btn {
    background: var(--white);
    border: 1px solid var(--border-soft);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-soft);
}

.theme-button:hover,
.quick-reply-btn:hover {
    border-color: var(--accent-color);
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 51, 153, 0.1);
}

.theme-button:active,
.quick-reply-btn:active {
    transform: translateY(0);
}

/* Ver Más Repair */
.ver-mas-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
    margin-top: 10px;
    display: block;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .header-content {
        justify-content: space-between;
    }

    .logo-text h1 {
        font-size: 0.9rem;
    }

    .logo-text span {
        font-size: 0.6rem;
    }

    .main-content {
        padding: 12px;
        margin-top: 60px;
    }

    .assistant-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

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

    .category-card {
        padding: 12px;
    }

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

@media (max-width: 480px) {
    .search-input {
        font-size: 1rem;
    }

    .search-button {
        padding: 0 15px;
    }

    .chat-container {
        padding: 15px;
    }
}

/* Voice STT Custom Styles */
.search-actions {
    display: flex;
    gap: 10px;
    background: #f1f5f9;
    padding: 5px;
}

.voice-button {
    background: var(--highlight-color);
    border: none;
    color: var(--primary-dark);
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.voice-button:hover {
    background: #f59e0b;
}

.voice-button.recording {
    background: var(--accent-color);
    color: white;
    animation: pulse-red 1.5s infinite;
}

.voice-button-mini {
    background: #f1f5f9;
    border: none;
    color: var(--primary-color);
    padding: 0 15px;
    cursor: pointer;
    font-size: 1.4rem;
    transition: 0.2s;
    border-left: 2px solid #e2e8f0;
}

.voice-button-mini:hover {
    background: #e2e8f0;
}

.voice-button-mini.recording {
    color: var(--accent-color);
    animation: pulse-icon 1s infinite;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-md);
    max-width: 440px;
    width: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    background: var(--secondary-color);
    color: var(--text-main);
    padding: 16px 20px;
    font-weight: 600;
}

.modal-body {
    padding: 24px 20px;
    font-size: 1rem;
    color: var(--text-main);
}

.modal-footer {
    padding: 12px 20px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-soft);
}

.modal-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    border: none;
    transition: all 0.2s;
}

.modal-btn.primary {
    background: var(--primary-color);
    color: white;
}

.modal-btn.secondary {
    background: var(--secondary-color);
    color: var(--text-main);
}

/* Recording Overlay (Prominent & Professional) */
.recording-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 58, 95, 0.4);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    transition: all 0.3s ease;
}

.recording-overlay.active {
    display: flex;
}

.recording-card {
    background: var(--white);
    padding: var(--gap-lg);
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    max-width: 320px;
    width: 90%;
    animation: slideUp 0.3s ease-out;
}

.voice-waves {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    height: 60px;
    margin-bottom: var(--gap-sm);
}

.wave {
    width: 6px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 3px;
    animation: wave-pulse 1s ease-in-out infinite;
}

.wave:nth-child(2) {
    animation-delay: 0.2s;
    height: 40px;
}

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

.recording-text h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 4px;
    font-weight: 700;
}

.recording-text p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.status-not-found {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
}

0% {
    box-shadow: 0 0 0 0 rgba(204, 0, 0, 0.7);
}

70% {
    box-shadow: 0 0 0 10px rgba(204, 0, 0, 0);
}

100% {
    box-shadow: 0 0 0 0 rgba(204, 0, 0, 0);
}
}

@keyframes pulse-white {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(0.9);
        opacity: 0.7;
    }
}

@keyframes pulse-icon {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

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

/* Quick Replies / Sugerencias */
.quick-replies-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-soft);
}

.quick-reply-btn {
    background: var(--white);
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.05);
}

.quick-reply-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 51, 153, 0.2);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

/* ===========================================
   AUTHORITY CARDS (New v1.1)
   =========================================== */

.authority-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    overflow: hidden;
    /* Eliminar borde y padding extra ya que la 'message' bubble ya tiene padding */
    margin-top: -0.5rem; 
}

/* Image */
.authority-image-wrapper {
    margin: -12px -16px 16px -16px; /* Negativo para romper el padding de .message */
    text-align: center;
    background: #f1f5f9;
    padding: 1rem;
    border-bottom: 1px solid var(--border-soft);
}

.authority-photo {
    max-width: 100%;
    height: auto;
    max-height: 280px; 
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    object-fit: contain;
    background: white;
}

/* Header */
.authority-header {
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.75rem;
}

.authority-title {
    font-size: 1.15rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.authority-identity {
    display: flex;
    flex-direction: column;
}

.auth-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.auth-role {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Contact Box */
.authority-contact-box {
    background: #f8fafc;
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.authority-contact-box h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    font-weight: 700;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main) !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.contact-link:hover {
    color: var(--primary-color) !important;
    text-decoration: underline;
}

.contact-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
}

/* Bio Text */
.authority-bio {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.authority-bio strong {
    color: var(--primary-color);
}

/* Expandable Content */
.ver-mas-btn {
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.ver-mas-btn:hover {
    text-decoration: underline;
}

/* CTA */
.authority-cta {
    margin-top: 1rem;
    text-align: right;
    border-top: 1px solid var(--border-soft);
    padding-top: 1rem;
}

.cta-button {
    background: var(--white);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: default; /* Por ahora decorativo según requerimiento */
    display: inline-block;
}