/* Print-specific styles for Date Night Planner */
@media print {
    /* Hide non-essential elements */
    .navbar,
    nav,
    .btn,
    button,
    .form-control,
    .form-select,
    .card-header,
    .spinner-border,
    .alert,
    #blazor-error-ui,
    form,
    input,
    select,
    label,
    .no-print,
    .top-row,
    a[href*="microsoft.com"],
    a[href*="docs."],
    /* Hide all interactive elements */
    [class*="inline-flex"],
    [class*="space-x-"],
    /* Hide specific page elements */
    .max-w-6xl > div:first-child, /* Hero header */
    .backdrop-blur-xl.bg-white\\/90, /* Search criteria card */
    .bg-yellow-50, /* AI disclaimer */
    .bg-gradient-to-r, /* Usage indicators and badges */
    /* Hide footer buttons area */
    .flex.justify-between.items-start,
    .flex.items-center.space-x-4 {
        display: none !important;
    }

    /* Show print-only elements */
    .print-only {
        display: block !important;
    }

    /* Add print header */
    body::before {
        content: "Date Night Planner - Date Ideas";
        display: block;
        text-align: center;
        font-size: 14pt;
        font-weight: bold;
        padding: 0.5rem 0;
        margin-bottom: 1rem;
        border-bottom: 2pt solid #333;
        page-break-after: avoid;
    }

    /* Hide screen-only elements (elements that should not print) */
    .search-form-card,
    .d-flex.gap-2,
    .d-flex.gap-3,
    .venue-info,
    .card-footer {
        display: none !important;
    }

    /* Hide Safety Priority text to save space */
    .text-end .mt-1 {
        display: none !important;
    }

    /* Create compact layout for event details */
    .date-idea-card .mb-2 {
        margin-bottom: 0.2rem !important;
        font-size: 9pt !important;
        line-height: 1.2 !important;
    }

    /* Make icons smaller in print */
    .date-idea-card .bi {
        font-size: 8pt !important;
        margin-right: 0.2rem !important;
    }

    /* Search Results Summary is now handled by no-print class */

    /* Hide specific text content that shouldn't print */
    .card-text:contains("Web search"),
    .card-text:contains("Search Results Summary"),
    small:contains("Web search") {
        display: none !important;
    }

    /* Container adjustments */
    .container {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Page setup */
    body {
        font-size: 12pt !important;
        line-height: 1.4 !important;
        color: black !important;
        background: white !important;
    }

    /* Remove all potential left borders and backgrounds */
    * {
        border-left: none !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    .container, .row, .col, .col-md-4, .col-md-6, .col-lg-4, 
    .d-flex, .card, .card-body, .card-header,
    h1, h2, h3, h4, h5, h6, p, div {
        border-left: none !important;
        background: none !important;
        background-color: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    /* Hide browser's default header/footer URLs and page info */
    @page {
        margin: 0.3in 0.4in;
        size: auto;
        /* Remove browser headers/footers - note: this may not work in all browsers */
        @top-left { content: ""; }
        @top-center { content: ""; }
        @top-right { content: ""; }
        @bottom-left { content: ""; }
        @bottom-center { content: ""; }
        @bottom-right { content: ""; }
    }

    /* Additional attempt to hide page info */
    @page :first {
        @top-left { content: none; }
        @top-center { content: none; }
        @top-right { content: none; }
        @bottom-left { content: none; }
        @bottom-center { content: none; }
        @bottom-right { content: none; }
    }

    /* Headers */
    h1, h2, h3, h4, h5, h6 {
        color: black !important;
        page-break-after: avoid;
        margin-bottom: 0.5rem !important;
    }

    /* Hide the main page title */
    h1.my-4,
    h1.text-4xl,
    [class*="text-4xl"] {
        display: none !important;
    }

    /* Keep the results title styled - visible and prominent */
    h2.print-title,
    h2.text-3xl {
        display: block !important;
        font-size: 18pt !important;
        font-weight: bold !important;
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
        padding: 0.5rem 0 !important;
        border: none !important;
        border-bottom: 2pt solid #333 !important;
        border-left: none !important;
        background: none !important;
        background-color: transparent !important;
        color: black !important;
        page-break-after: avoid !important;
    }

    /* Date idea cards optimized for print - both legacy and new Tailwind-based cards */
    .date-idea-card,
    .backdrop-blur-xl.bg-white\\/90.border.border-white\\/20,
    [class*="backdrop-blur"] {
        display: block !important;
        border: 1pt solid #ccc !important;
        border-radius: 4pt !important;
        margin-bottom: 1.5rem !important;
        padding: 0.75rem !important;
        page-break-inside: avoid !important;
        page-break-after: auto !important;
        background: white !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        min-height: auto !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        position: relative !important;
        clear: both !important;
        width: 100% !important;
    }

    .date-idea-card .card-img-top {
        display: none !important;
    }

    .date-idea-card .card-body,
    .p-6.flex-1,
    [class*="p-6"] {
        padding: 0.5rem !important;
    }

    /* Hide card footers with "Learn More" buttons */
    .bg-gray-50.px-6.py-4,
    [class*="bg-gray-50"],
    .card-footer {
        display: none !important;
    }

    .date-idea-card .card-title {
        font-size: 12pt !important;
        font-weight: bold !important;
        margin-bottom: 0.3rem !important;
        color: black !important;
        line-height: 1.2 !important;
    }

    .date-idea-card .card-text {
        font-size: 10pt !important;
        margin-bottom: 0.5rem !important;
        color: black !important;
        line-height: 1.3 !important;
        word-wrap: break-word !important;
    }

    /* Badge styling for print */
    .badge {
        border: 1pt solid #666 !important;
        background: white !important;
        color: black !important;
        font-weight: bold !important;
        padding: 0.25rem 0.5rem !important;
        font-size: 10pt !important;
        border-radius: 2pt !important;
    }

    /* Match analysis section */
    .match-analysis {
        border-top: 1pt solid #ddd !important;
        padding-top: 0.4rem !important;
        margin-top: 0.4rem !important;
        display: block !important;
    }

    .match-analysis h6 {
        font-size: 10pt !important;
        margin-bottom: 0.3rem !important;
        font-weight: bold !important;
    }

    /* Expandable details - make them always visible in print */
    .expandable-details {
        display: block !important;
        visibility: visible !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Hide the expand/collapse button */
    button[class*="chevron"],
    [class*="bi-chevron"] {
        display: none !important;
    }

    /* Score displays */
    .score-item {
        margin-bottom: 0.2rem !important;
        font-size: 9pt !important;
        line-height: 1.2 !important;
    }

    /* Score dimension styling */
    .score-dimension {
        margin-bottom: 0.15rem !important;
        font-size: 9pt !important;
    }

    /* Overall match score prominent display */
    .card-title + .text-end .badge {
        font-size: 12pt !important;
        padding: 0.25rem 0.5rem !important;
        border: 2pt solid #333 !important;
        font-weight: bold !important;
    }


    /* Grid layout adjustments - CRITICAL for proper display */
    .grid,
    .grid-cols-1,
    .grid-cols-2,
    .grid-cols-3,
    [class*="grid-cols-"] {
        display: block !important; /* Force block layout instead of CSS grid */
        width: 100% !important;
    }

    .row {
        margin: 0 !important;
        page-break-inside: avoid;
    }

    .col-md-4, .col-md-6, .col-lg-4 {
        width: 100% !important;
        padding: 0 !important;
        margin-bottom: 0.5rem !important;
        page-break-inside: avoid;
        overflow: visible !important;
    }

    /* Ensure cards don't overlap */
    .card {
        margin-bottom: 2rem !important;
        overflow: visible !important;
        height: auto !important;
        min-height: auto !important;
        page-break-inside: avoid;
        position: relative !important;
        clear: both !important;
    }


    /* Results header */
    .results-header {
        border: none !important;
        border-bottom: none !important;
        border-left: none !important;
        padding: 0 !important;
        margin-bottom: 0.5rem !important;
        background: none !important;
    }

    .results-count {
        font-weight: bold !important;
        font-size: 11pt !important;
    }

    /* Page breaks */
    .page-break-before {
        page-break-before: always !important;
    }

    .page-break-after {
        page-break-after: always !important;
    }

    .no-page-break {
        page-break-inside: avoid !important;
    }

    /* Footer information */
    .print-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 2rem;
        border-top: 1pt solid #ccc;
        padding: 0.25rem;
        font-size: 8pt;
        text-align: center;
        background: white;
    }

    /* Links */
    a {
        color: black !important;
        text-decoration: none !important;
    }

    /* Don't show URLs in print */
    a[href]:after {
        content: none !important;
    }

    /* Hide Bootstrap icons in print except in cards where we make them smaller */
    .bi {
        display: none !important;
    }

    /* Override to allow smaller icons in date idea cards */
    .date-idea-card .bi {
        display: inline !important;
        font-size: 8pt !important;
        margin-right: 0.2rem !important;
    }

    /* Ensure text is visible */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
}

/* Hide print-only elements on screen */
@media screen {
    .print-only {
        display: none !important;
    }
}