/**
 * DIÁRIO ANALYSIS CSS
 * Estilos para a feature ANÁLISE do Diário Aquarismo Sereno
 * Design: Clean, elegante, estilo Apple
 */

/* Container principal */
.diario-analysis {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.header-nav {
    flex: 0 0 auto;
}

.header-title {
    flex: 1 1 auto;
    text-align: center;
}

.header-title h2 {
    margin: 0 0 5px 0;
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

.header-title p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Aquarium Selector */
.analysis-aquarium-selector {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.selector-header {
    text-align: center;
    margin-bottom: 30px;
}

.selector-header h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: #2c3e50;
}

.selector-header p {
    color: #666;
    font-size: 1.05rem;
}

.aquarium-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.aquarium-selector-card {
    display: block;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    background: #fff;
}

.aquarium-selector-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.selector-card-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.selector-card-info {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 6px;
}

.selector-card-fauna-flora {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 6px;
}

.selector-card-measurement {
    font-size: 0.85rem;
    color: #999;
    margin-top: 4px;
}

/* No Aquarium CTA */
.analysis-no-aquarium {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.no-aquarium-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.analysis-no-aquarium h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 12px;
}

.analysis-no-aquarium p {
    color: #666;
    font-size: 1.05rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.analysis-no-aquarium .btn-lg {
    padding: 14px 28px;
    font-size: 1.1rem;
}

@media (max-width: 600px) {
    .aquarium-selector-grid {
        grid-template-columns: 1fr;
    }
    .analysis-aquarium-selector {
        padding: 20px 12px;
    }
}

/* Loading e Error states */
.analysis-loading,
.analysis-error {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.analysis-error h3 {
    color: #e74c3c;
    margin-bottom: 15px;
}

/* Tabs de navegação */
.analysis-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
}

.analysis-tab {
    flex: 1;
    min-width: 150px;
    padding: 15px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.analysis-tab:hover {
    color: #3498db;
    background: #f8f9fa;
}

.analysis-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e0e0e0;
    color: #666;
    font-weight: 600;
}

.analysis-tab.active .tab-badge {
    background: #3498db;
    color: white;
}

/* Seletor de Dados */
.data-selector {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.data-selector h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.data-selector-header h3 {
    margin: 0;
    flex: 1;
}

.data-selector-info {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #666;
}

.selector-group {
    margin-bottom: 20px;
}

.selector-group:last-child {
    margin-bottom: 0;
}

.selector-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 14px;
}

.form-select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: #3498db;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    font-weight: normal;
    font-size: 14px;
    margin: 0;
}

.checkbox-grid input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.plan-limits-info {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
}

.info-message {
    margin: 0;
    font-size: 14px;
    color: #856404;
}

.empty-data-message {
    padding: 12px 15px;
    background: #f0f8ff;
    border-left: 4px solid #3498db;
    border-radius: 8px;
    margin-top: 10px;
}

.empty-data-message p {
    margin: 0;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Mensagem de upgrade de medições */
.measurements-upgrade-message {
    margin-top: 12px;
    padding: 15px;
    background: #f0f8ff;
    border-left: 4px solid #3498db;
    border-radius: 8px;
}

.measurements-upgrade-message .info-message {
    margin: 0;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.measurements-upgrade-message .upgrade-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.measurements-upgrade-message .upgrade-link:hover {
    border-bottom-color: #3498db;
    text-decoration: none;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Tab Intro */
.tab-intro {
    margin-bottom: 30px;
    text-align: center;
}

.tab-intro h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.tab-intro p {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #666;
}

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

.info-note {
    font-size: 14px !important;
    color: #888 !important;
}

.cost-info {
    font-size: 18px !important;
    font-weight: 500 !important;
    color: #3498db !important;
}

/* Buttons */
.btn-large {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    display: block;
    margin: 30px auto;
    min-width: 300px;
}

/* Results Container */
.results-container {
    margin-top: 30px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

/* Analysis Footer */
.analysis-footer {
    margin-top: 30px;
    text-align: center;
}

/* ==================== */
/* TAB ESPECÍFICAS */
/* ==================== */

/* Tab: Simple Analysis */
.simple-analysis-container {
    padding: 20px;
}

.analysis-report {
    padding: 25px;
}

.analysis-summary {
    padding: 20px;
    background: #f0f8ff;
    border-left: 4px solid #3498db;
    border-radius: 8px;
    margin-bottom: 30px;
}

.analysis-summary h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.problems-section,
.warnings-section,
.recommendations-section {
    margin-top: 30px;
}

.problems-section h4,
.warnings-section h4,
.recommendations-section h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.problem-card,
.warning-card {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid;
}

.problem-card.severity-critical {
    background: #fff5f5;
    border-left-color: #e53e3e;
}

.problem-card.severity-high,
.warning-card.severity-high {
    background: #fffaf0;
    border-left-color: #ed8936;
}

.problem-card.severity-medium,
.warning-card.severity-medium {
    background: #fefcbf;
    border-left-color: #ecc94b;
}

.problem-card h5,
.warning-card h5 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.problem-card p,
.warning-card p {
    margin: 0 0 15px 0;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

.problem-card p:last-child,
.warning-card p:last-child {
    margin-bottom: 0;
}

.action {
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    font-size: 14px;
    color: #333;
}

/* Produtos Recomendados */
.recommended-products {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.recommended-products-header {
    margin-bottom: 15px;
}

.recommended-products-header h6 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.affiliate-disclaimer {
    display: block;
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.product-card-mini {
    background: white;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.product-card-mini:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #3498db;
}

.product-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #f0f0f0;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.relevance-reason {
    font-size: 12px;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.4;
    font-style: italic;
}

.btn-product {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-top: auto;
}

.btn-product:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.btn-product .icon {
    margin-left: 5px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .product-card-mini {
        padding: 10px;
    }

    .product-img {
        height: 100px;
    }
}

/* ===============================================
   Conteúdos Recomendados
   =============================================== */
.recommended-content {
    margin-top: 20px;
    padding: 15px;
    background: #f0f7ff;
    border-radius: 8px;
    border: 1px solid #c8ddf0;
}

.recommended-content-header {
    margin-bottom: 15px;
}

.recommended-content-header h6 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.content-subtitle {
    display: block;
    font-size: 12px;
    color: #5a7a9a;
    margin-top: 4px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.content-card-mini {
    background: white;
    border-radius: 8px;
    border: 1px solid #d4e4f0;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.content-card-mini:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #2980b9;
}

.content-img-wrapper {
    position: relative;
}

.content-img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    background: #e8f0f8;
}

.content-type-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.content-info {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-title {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 6px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-reason {
    font-size: 11px;
    color: #5a7a9a;
    margin: 0;
    line-height: 1.3;
    font-style: italic;
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .content-img {
        height: 85px;
    }

    .content-info {
        padding: 8px 10px;
    }
}

.upgrade-banner {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    text-align: center;
    color: white;
}

.upgrade-banner p {
    margin: 0 0 15px 0;
    font-size: 16px;
    line-height: 1.6;
}

.btn-upgrade {
    display: inline-block;
    padding: 12px 30px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.btn-upgrade:hover {
    transform: scale(1.05);
}

/* Tab: AI Analysis */
.ai-analysis-container {
    padding: 20px;
}

.ai-chat-container {
    margin-top: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.ai-chat-container h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-info {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.chat-messages {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 25px;
    padding: 20px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.chat-messages:empty {
    display: none;
}

/* Estrutura de Mensagem */
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: chatMessageSlideIn 0.3s ease-out forwards;
}

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

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

.chat-message-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #64748b;
}

.chat-role-icon {
    font-size: 14px;
}

.chat-message-bubble {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

/* User Bubble */
.chat-message.user {
    align-self: flex-end;
}

.chat-message.user .chat-message-label {
    justify-content: flex-end;
    margin-right: 4px;
}

.chat-message.user .chat-message-bubble {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Assistant Bubble */
.chat-message.assistant {
    align-self: flex-start;
}

.chat-message.assistant .chat-message-label {
    margin-left: 4px;
}

.chat-message.assistant .chat-message-bubble {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* Typing Indicator */
.chat-typing-indicator {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.chat-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: #f1f5f9;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.chat-typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: chatTypingBounce 1.4s infinite ease-in-out both;
}

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

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

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

@keyframes chatTypingBounce {

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

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

/* Markdown Support in Assistant Bubble */
.chat-message.assistant .chat-message-bubble h2,
.chat-message.assistant .chat-message-bubble h3,
.chat-message.assistant .chat-message-bubble h4 {
    margin: 15px 0 10px 0;
    color: #0f172a;
    font-weight: 700;
}

.chat-message.assistant .chat-message-bubble h3 {
    font-size: 1.1rem;
}

.chat-message.assistant .chat-message-bubble h4 {
    font-size: 1rem;
}

.chat-message.assistant .chat-message-bubble p {
    margin: 0 0 10px 0;
}

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

.chat-message.assistant .chat-message-bubble ul,
.chat-message.assistant .chat-message-bubble ol {
    margin: 10px 0;
    padding-left: 20px;
}

.chat-message.assistant .chat-message-bubble li {
    margin-bottom: 5px;
}

.chat-message.assistant .chat-message-bubble strong {
    color: #0f172a;
    font-weight: 600;
}

.chat-message.assistant .chat-message-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.chat-message.assistant .chat-message-bubble th,
.chat-message.assistant .chat-message-bubble td {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.chat-message.assistant .chat-message-bubble th {
    background: #f8fafc;
    font-weight: 600;
}

/* Chat Input Styling */
.chat-input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 15px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 90px;
    transition: all 0.2s ease;
    background: white;
}

.chat-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.chat-input:disabled {
    background: #f8fafc;
    cursor: not-allowed;
}

.chat-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #64748b;
    padding: 0 4px;
}

.char-counter {
    font-weight: 500;
}

.token-cost-estimate {
    color: #6366f1;
    font-weight: 600;
}

.chat-send-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

.chat-cost-info {
    margin-top: 15px;
    padding: 10px 15px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
    display: inline-block;
}

/* Tab: Community */
.community-container {
    padding: 20px;
}

.data-preview {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.data-preview h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.selected-data-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.selected-data-list li {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
}

/* Community checkboxes grid */
.community-checkboxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.community-checkbox-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.community-checkbox-item:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.community-checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.community-checkbox-item input[type="checkbox"]:checked+span {
    color: #333;
}

.community-checkbox-item span {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #555;
}

.community-checkbox-item input[type="checkbox"]:checked+span strong {
    color: #3498db;
}

.question-input-group {
    margin-bottom: 30px;
}

.question-input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.question-input-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
}

.question-input-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.char-count {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    text-align: right;
}

.info-footer {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.warning-message {
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    margin-top: 15px;
}

/* Tab: Expert */
.expert-container {
    padding: 20px;
}

.expert-question-group {
    margin-bottom: 30px;
}

.expert-question-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.expert-question-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 200px;
}

.expert-question-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.cost-breakdown {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.cost-breakdown h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.cost-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cost-list li {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #555;
}

.cost-list li:last-child {
    border-bottom: none;
}

.cost-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #3498db !important;
    font-size: 16px !important;
    color: #3498db !important;
}

.expert-history {
    margin-top: 50px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
}

.expert-history h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ticket-card {
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s ease;
}

.ticket-card:hover {
    border-color: #3498db;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ticket-number {
    font-weight: 600;
    color: #333;
}

.ticket-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ticket-status.status-pending {
    background: #fef5e7;
    color: #f39c12;
}

.ticket-status.status-answered {
    background: #d4edda;
    color: #155724;
}

.ticket-status.status-closed {
    background: #e2e3e5;
    color: #383d41;
}

.ticket-content h5 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.ticket-excerpt {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Hidden class */
.diario-modal-hidden {
    display: none !important;
}

/* Gráfico de Bioload */
.bioload-chart-section {
    margin: 30px 0;
    padding: 25px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.bioload-chart-section h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.bioload-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.bioload-chart {
    position: relative;
    width: 220px;
    height: 220px;
    cursor: pointer;
}

.bioload-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.bioload-capacity,
.bioload-excess {
    transition: opacity 0.2s ease, stroke-width 0.2s ease, filter 0.2s ease;
}

.bioload-capacity:hover,
.bioload-excess:hover {
    stroke-width: 12;
    opacity: 0.9;
    filter: brightness(1.1);
}

.bioload-capacity {
    stroke-linecap: round;
}

.bioload-excess {
    stroke-linecap: round;
    stroke-dasharray: var(--excess-arc, 0) 9999;
}

.bioload-background {
    opacity: 0.3;
}

.bioload-chart-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

.bioload-percent {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    transition: color 0.3s ease;
}

.bioload-percent.moderado {
    color: #3498db;
}

.bioload-percent.atencao {
    color: #f39c12;
}

.bioload-percent.critico {
    color: #e74c3c;
}

.bioload-text {
    font-size: 13px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

.bioload-severity {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    margin-top: 4px;
}

.bioload-severity.moderado {
    background: #e3f2fd;
    color: #1976d2;
}

.bioload-severity.atencao {
    background: #fff3e0;
    color: #f57c00;
}

.bioload-severity.critico {
    background: #ffebee;
    color: #c62828;
}

/* Tooltip */
.bioload-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.tooltip-content {
    background: white;
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-width: 320px;
}

.tooltip-header {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.tooltip-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.tooltip-label {
    color: #666;
    font-weight: 500;
}

.tooltip-value {
    color: #333;
    font-weight: 600;
}

.tooltip-severity {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
}

.tooltip-severity.moderado {
    background: #e3f2fd;
    color: #1976d2;
}

.tooltip-severity.atencao {
    background: #fff3e0;
    color: #f57c00;
}

.tooltip-severity.critico {
    background: #ffebee;
    color: #c62828;
}

.tooltip-severity strong {
    display: block;
    margin-bottom: 4px;
}

/* Legenda */
.bioload-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 350px;
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.legend-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    text-align: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    padding: 6px 0;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
    border: 3px solid;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.legend-text {
    color: #555;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}

.legend-text strong {
    color: #333;
    font-weight: 600;
}

.legend-hint {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 2px solid #e0e0e0;
    font-size: 13px;
    color: #666;
    text-align: center;
    line-height: 1.5;
}

.legend-hint strong {
    color: #3498db;
}

/* Informações */
.bioload-info {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.bioload-info p {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #555;
    line-height: 1.6;
}

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

.bioload-info strong {
    font-weight: 600;
}

.bioload-action {
    margin-top: 15px !important;
    padding: 12px 15px;
    background: #f8f9fa;
    border-left: 4px solid;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
}

.bioload-action strong {
    display: block;
    margin-bottom: 4px;
}

/* Recomendação do bioload (novo estilo) */
.bioload-recommendation {
    margin-top: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #3498db;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
}

.bioload-recommendation .recommendation-icon {
    color: #3498db;
    margin-right: 6px;
}

.bioload-recommendation strong {
    color: #2c3e50;
}

/* Ajustes considerados no gráfico */
.adjustment-item {
    display: inline-block;
    background: rgba(52, 152, 219, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px 4px 2px 0;
    font-size: 12px;
    color: #2980b9;
}

/* Responsive para gráfico */
@media (max-width: 768px) {
    .bioload-chart {
        width: 180px;
        height: 180px;
    }

    .bioload-chart-label {
        gap: 3px;
    }

    .bioload-percent {
        font-size: 28px;
    }

    .bioload-text {
        font-size: 12px;
    }

    .bioload-severity {
        font-size: 11px;
        padding: 3px 8px;
    }

    .tooltip-content {
        min-width: 240px;
        max-width: 280px;
        padding: 12px;
    }

    .bioload-legend {
        max-width: 100%;
    }
}

/* Header do seletor de dados */
.data-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Indicador de aba ativa (apenas mobile) */
.active-tab-indicator-mobile {
    display: none;
    /* Oculto por padrão (desktop) */
}

/* Responsive */
@media (max-width: 768px) {

    /* Mostrar indicador de aba ativa no mobile - discreto no canto direito */
    .active-tab-indicator-mobile {
        display: inline-block;
        padding: 4px 10px;
        background: #f0f0f0;
        color: #666;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 500;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .active-tab-indicator-mobile span {
        display: inline-block;
    }

    .analysis-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .header-title {
        text-align: left;
    }

    .analysis-tabs {
        flex-wrap: nowrap;
        gap: 6px;
        margin-bottom: 20px;
    }

    .analysis-tab {
        flex: 1;
        min-width: 0;
        padding: 8px 6px;
        font-size: 11px;
        gap: 3px;
        border-bottom-width: 2px;
    }

    .analysis-tab .tab-badge {
        font-size: 9px;
        padding: 2px 4px;
    }

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

    .btn-large {
        min-width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }

    .data-selector,
    .results-container,
    .ai-chat-container,
    .data-preview,
    .cost-breakdown,
    .expert-history {
        padding: 15px;
    }

    .community-checkboxes-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Chat Overrides */
    .chat-message {
        max-width: 92%;
    }

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