/* Smooth Page Load Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Smart Search Dropdown Styling */
#searchResults {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Tool Card Hover Effect */
.tool-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6; /* Blue border on hover */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* PROFESSIONAL PRINT STYLING */
@media print {
    /* Hide UI Elements */
    header, footer, #initialState, form, .share-bar, .related-tools, .cookie-banner, nav, button, #emailModal {
        display: none !important;
    }

    /* Reset Layout */
    body, .container {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Ensure Table Prints Well */
    table { width: 100% !important; border-collapse: collapse; font-size: 10pt; }
    th, td { border: 1px solid #ddd !important; padding: 4px !important; }
    
    /* Force Result Visibility */
    #resultState, #view-basic, #view-advanced { display: block !important; opacity: 1 !important; }
    
    /* Chart Sizing for A4 */
    canvas { max-height: 200px !important; width: auto !important; }

    /* Break Pages Correctly */
    tr { page-break-inside: avoid; }
    h1, h2, h3 { page-break-after: avoid; }

    /* THE COPYRIGHT FOOTER (ON EVERY PAGE) */
    body {
        margin-bottom: 20px;
    }
    
    @page {
        margin: 20mm;
        @bottom-center {
            content: "Copyright © FinanceSmartUSA.com | Page " counter(page);
            font-size: 9pt;
            color: #666;
        }
    }
    
    /* Fallback for browsers that don't support @page content */
    body::after {
        content: "Copyright © FinanceSmartUSA.com - Generated Report";
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        text-align: center;
        font-size: 10pt;
        color: #888;
        background: white;
        padding: 10px;
        border-top: 1px solid #eee;
    }
}