/* Mobile responsive styles for search results */
@media (max-width: 768px) {
    /* Make search result card scrollable */
    .search-result-card {
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    /* Adjust result content for mobile */
    .result-card-content {
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    /* Fix widgets display on mobile */
    .widgets-container {
        grid-template-columns: 1fr !important;
    }
    
    /* Ensure proper padding */
    .message-bubble {
        padding: 12px !important;
    }
    
    /* Improve result readability on mobile */
    .result-title {
        font-size: 1.2rem !important;
    }
    
    .result-body {
        font-size: 0.95rem !important;
    }
    
    /* Fix table display on mobile */
    .result-body table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Adjust source citations for mobile */
    .source-citation {
        word-break: break-word;
    }
}

/* Print-specific styles */
@media print {
    /* Hide navigation elements and UI components when printing */
    .sidebar, 
    .chat-input-container,
    .header-bar,
    .mobile-nav,
    .research-status-container,
    .modal,
    .result-actions,
    button,
    .user-message,
    .message-time,
    [data-print-hide="true"] {
        display: none !important;
    }
    
    /* Full-width content for print */
    .app-container {
        display: block;
        height: auto;
    }
    
    .main-content {
        width: 100%;
        overflow: visible;
    }
    
    .chat-container {
        overflow: visible;
    }
    
    .chat-messages {
        overflow: visible;
    }
    
    /* Ensure search results are formatted nicely for print */
    .search-result {
        break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 30px;
        page-break-inside: avoid;
        box-shadow: none;
    }
    
    .result-header {
        background-color: #f1f1f1 !important;
        color: #333 !important;
        padding: 15px;
    }
    
    .result-title {
        color: #0f766e !important;
    }
    
    .result-body {
        padding: 15px;
    }
    
    /* Section titles appear in color even when printed */
    .section-title {
        color: #0f766e !important;
        font-weight: bold;
    }
    
    /* Better link visibility in print */
    a, .widget-link {
        color: #0f766e !important;
        text-decoration: underline;
    }
    
    /* Add printing disclaimer at the top */
    .chat-messages::before {
        content: "Printed from ImmiSearch - For reference only";
        display: block;
        text-align: center;
        margin-bottom: 20px;
        font-size: 14px;
        color: #666;
    }
    
    /* Format widgets for print */
    .widgets-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .widget-item {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    /* Show print-specific elements */
    .print-only {
        display: block !important;
    }
    
    /* Disclaimer section formatting */
    .disclaimer-section {
        border-top: 1px solid #ddd;
        padding-top: 15px;
        font-size: 12px;
        color: #666;
    }
}