/* Print Styles for MeetingApp */
/* Used by: sessions.html, session-details.html, schedule.html */

@media print {
    /* =============================================
       PRINT HEADER (appears only when printing)
       ============================================= */

    .print-header {
        display: block !important;
        padding: 0 0 1rem 0;
        margin-bottom: 1rem;
        border-bottom: 2px solid #333;
    }

    .print-header__title {
        font-size: 1.75rem !important;
        font-weight: bold !important;
        color: #1a5276 !important;
        margin: 0 0 0.25rem 0 !important;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .print-header__meeting {
        font-size: 1.25rem !important;
        font-weight: 600 !important;
        color: #333 !important;
        margin: 0 0 0.75rem 0 !important;
    }

    .print-header__disclaimer {
        font-size: 0.75rem !important;
        color: #666 !important;
        margin: 0 !important;
        line-height: 1.4;
    }

    .print-header__count {
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        color: #333 !important;
        margin: 1rem 0 0 0 !important;
    }

    /* Print date header for sessions list */
    .print-date-header {
        display: block !important;
        font-size: 1.1rem !important;
        font-weight: bold !important;
        color: #1a5276 !important;
        background: white !important;
        padding: 0.75rem 0 0.25rem 0 !important;
        margin-top: 1rem !important;
        border-bottom: 2px solid #333 !important;
        page-break-before: auto !important;
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
    }

    /* First date header - no top margin, no page break before */
    .print-date-header:first-of-type,
    #sessions-content > div:first-child .print-date-header,
    #sessions-content > .print-date-header:first-child,
    #sessions-content .print-date-header:first-of-type {
        margin-top: 0 !important;
        padding-top: 0 !important;
        page-break-before: avoid !important;
    }
    /* =============================================
       GENERAL RESET FOR PRINT
       ============================================= */

    /* Remove backgrounds that waste ink */
    body {
        background: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Reset any body/html margins that could cause whitespace */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Remove shadows */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Ensure text is black for readability */
    body,
    p,
    h1, h2, h3, h4, h5, h6,
    span,
    div {
        color: #000 !important;
    }

    /* Remove transitions and transforms */
    * {
        transition: none !important;
        transform: none !important;
    }

    /* =============================================
       HIDE NON-PRINTABLE ELEMENTS
       ============================================= */

    /* Hide sidebar/navigation menu */
    #side-menu,
    aside {
        display: none !important;
    }

    /* Hide hamburger menu button */
    #menu-toggle {
        display: none !important;
    }

    /* Hide back arrow navigation */
    a[href*="history.go"],
    a[href="JavaScript:history.go(-1);"] {
        display: none !important;
    }

    /* Hide filter button */
    #filter-button {
        display: none !important;
    }

    /* Hide floating NOW button */
    button:has(span:contains("NOW")),
    .fixed.bottom-4.right-4,
    #now-button {
        display: none !important;
    }

    /* Hide calendar button in header */
    button.bg-green-500,
    header button[class*="bg-green"] {
        display: none !important;
    }

    /* Hide print button itself when printing */
    #print-button,
    .print-button,
    button[onclick*="print"] {
        display: none !important;
    }

    /* Hide action buttons (Claim CME, View Map, Add to Schedule) */
    .bg-blue-500 button,
    div.bg-blue-500 .flex.flex-wrap.gap-2 {
        display: none !important;
    }

    /* Hide chevron arrows on clickable items */
    a svg[class*="text-gray-400"],
    a svg[class*="text-blue-500"]:last-child {
        display: none !important;
    }

    /* =============================================
       HEADER STYLING FOR PRINT
       ============================================= */

    /* Completely remove fixed header from layout - keep it fixed/absolute so it takes no space */
    #sessions-fixed-header {
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
        display: none !important;
    }

    /* Hide other fixed elements and navigation */
    .fixed:not(.print-header),
    [class*="fixed"]:not(.print-header),
    nav.flex.overflow-x-auto,
    .no-print {
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
        display: none !important;
    }

    /* But show the print header - it should be the first thing visible */
    .print-header {
        display: block !important;
        position: relative !important;
        visibility: visible !important;
        height: auto !important;
        width: auto !important;
        overflow: visible !important;
        top: 0 !important;
        left: 0 !important;
    }

    .print-header * {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
    }

    /* Inline elements in print header */
    .print-header strong,
    .print-header span {
        display: inline !important;
    }

    header h1 {
        font-size: 1.5rem !important;
        font-weight: bold !important;
        margin: 0 !important;
    }

    /* Ensure the main content container starts at top after print header */
    .print-header + #sessions-fixed-header + #sessions-listing-container,
    .print-header ~ #sessions-listing-container,
    #sessions-listing-container {
        position: relative !important;
        top: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* =============================================
       DATE NAVIGATION (Sessions Page)
       ============================================= */

    /* Hide the date tabs navigation bar on sessions page */
    nav.flex.overflow-x-auto {
        display: none !important;
    }

    /* =============================================
       SESSIONS LIST STYLING
       ============================================= */

    /* Remove padding from content container */
    .pt-32,
    .pt-14 {
        padding-top: 0 !important;
    }

    /* Time block headers - clean divider style */
    .bg-gray-100.text-gray-700.text-sm.font-semibold {
        background: white !important;
        border: none !important;
        border-bottom: 2px solid #333 !important;
        padding: 0.75rem 0 0.25rem 0 !important;
        margin-top: 1rem !important;
        font-weight: bold !important;
        font-size: 0.9rem !important;
        page-break-after: avoid !important;
    }

    /* First time block - no top margin */
    .pt-32 > main > div:first-child .bg-gray-100.text-gray-700.text-sm.font-semibold {
        margin-top: 0 !important;
    }

    /* Session items - clean style without borders */
    a.block.group {
        display: block !important;
        border: none !important;
        border-radius: 0 !important;
        border-bottom: 1px solid #ddd !important;
        padding: 0.75rem 0 !important;
        margin: 0 !important;
        page-break-inside: avoid !important;
        background: white !important;
    }

    /* Remove the left border indicator animation element */
    a.block.group .absolute.inset-y-0.left-0.w-1 {
        display: none !important;
    }

    /* Session card inner layout */
    a.block.group > div {
        border: none !important;
        padding: 0 !important;
    }

    /* Session title - prominent */
    a.block.group .text-base.font-semibold {
        font-weight: bold !important;
        font-size: 1rem !important;
        color: #1a5276 !important;
        margin-bottom: 0.25rem !important;
    }

    /* Session time display */
    .flex-shrink-0.text-center p {
        color: #333 !important;
    }

    /* Room and speaker info */
    .text-sm.text-gray-600 {
        color: #444 !important;
        font-size: 0.85rem !important;
    }

    /* Hide chevron arrows in session list */
    a.block.group > div > svg {
        display: none !important;
    }

    /* =============================================
       TAGS/BADGES - PRINT FRIENDLY
       ============================================= */

    /* Make badges print-friendly - simple text style */
    span[class*="inline-flex"][class*="rounded"],
    .session-type-workshop,
    .session-type-keynote,
    .session-type-panel,
    .session-type-default {
        background: #f3f4f6 !important;
        border: none !important;
        color: #000 !important;
        padding: 0.125rem 0.375rem !important;
        font-size: 0.65rem !important;
    }

    /* CME badges */
    .bg-blue-100.text-blue-800,
    .bg-red-100.text-red-800 {
        background: #f3f4f6 !important;
        border: none !important;
        color: #000 !important;
    }

    /* Category badges */
    .bg-purple-100.text-purple-800 {
        background: #f3f4f6 !important;
        border: none !important;
        color: #000 !important;
    }

    /* =============================================
       SESSION DETAILS PAGE
       ============================================= */

    /* Session header blue section - make print friendly */
    .bg-blue-500.text-white {
        background: white !important;
        color: #000 !important;
        border-bottom: 2px solid #333 !important;
        padding: 1rem 0 !important;
    }

    .bg-blue-500.text-white h2 {
        color: #1a5276 !important;
        font-size: 1.5rem !important;
        font-weight: bold !important;
    }

    .bg-blue-500.text-white .opacity-90 {
        opacity: 1 !important;
        color: #333 !important;
    }

    /* Time and location in header - add labels */
    .bg-blue-500.text-white .flex.items-center svg {
        display: none !important;
    }

    /* Tags in session header */
    .bg-blue-500 span[class*="rounded-full"] {
        background: #f3f4f6 !important;
        border: none !important;
        color: #000 !important;
        font-size: 0.7rem !important;
        padding: 0.125rem 0.5rem !important;
    }

    /* Hide action buttons in session details header */
    .bg-blue-500.text-white .flex.flex-wrap.gap-2:last-child {
        display: none !important;
    }

    /* Section headings */
    section h3.text-xl.font-bold {
        font-size: 1rem !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        border-bottom: 1px solid #999 !important;
        padding-bottom: 0.25rem !important;
        margin-bottom: 0.75rem !important;
        page-break-after: avoid !important;
    }

    /* Description text */
    section p.text-gray-700.leading-relaxed {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }

    /* Learning objectives */
    section .space-y-3 .flex {
        margin-bottom: 0.5rem !important;
    }

    section .space-y-3 .flex .text-blue-500 {
        color: #333 !important;
    }

    /* Schedule timeline items - cleaner look */
    .border-l-4.border-blue-500 {
        border-left: 2px solid #333 !important;
        padding-left: 0.75rem !important;
        margin-bottom: 0.75rem !important;
        page-break-inside: avoid !important;
    }

    .border-l-4 .font-medium.text-blue-500 {
        color: #000 !important;
        font-weight: bold !important;
        font-size: 0.85rem !important;
    }

    .border-l-4 p.mt-1 {
        font-size: 0.9rem !important;
    }

    .border-l-4 .text-sm.text-gray-600 {
        font-size: 0.8rem !important;
        font-style: italic !important;
    }

    /* Speaker items */
    section a.block.bg-gray-100 {
        background: white !important;
        border: none !important;
        border-bottom: 1px solid #ddd !important;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
        page-break-inside: avoid !important;
    }

    /* Hide speaker profile placeholder images for cleaner print */
    .w-12.h-12.bg-gray-300.rounded-full {
        display: none !important;
    }

    /* Speaker name */
    .text-blue-500.font-medium {
        color: #1a5276 !important;
        font-weight: 600 !important;
    }

    /* Speaker affiliation */
    section a.block.bg-gray-100 .text-sm.text-gray-600 {
        font-size: 0.8rem !important;
    }

    /* Hide chevrons in speaker/handout links */
    section a.block.bg-gray-100 svg[class*="w-8"] {
        display: none !important;
    }

    /* Handout items */
    a.block.bg-gray-100 span.text-blue-500.font-medium {
        color: #1a5276 !important;
    }

    /* =============================================
       MY SCHEDULE PAGE
       ============================================= */

    /* Date header */
    .bg-gray-100.px-4.py-3.border-b {
        background: white !important;
        border: none !important;
        border-bottom: 2px solid #333 !important;
        padding: 0.75rem 0 0.25rem 0 !important;
        margin-top: 1.5rem !important;
    }

    .bg-gray-100.px-4.py-3.border-b h2 {
        font-weight: bold !important;
        font-size: 1.1rem !important;
        text-align: left !important;
        color: #000 !important;
    }

    /* First date header - no top margin */
    .schedule-list > div:first-child .bg-gray-100.px-4.py-3.border-b {
        margin-top: 0 !important;
    }

    /* Type badges in schedule */
    .schedule-list span.inline-block {
        background: #f3f4f6 !important;
        border: none !important;
        color: #000 !important;
        font-size: 0.65rem !important;
    }

    /* Status dots - hide for print (not useful) */
    .schedule-list .w-2.h-2.rounded-full {
        display: none !important;
    }

    /* =============================================
       PAGE BREAK CONTROLS
       ============================================= */

    /* Don't force page breaks - let content flow naturally */
    main > div {
        page-break-inside: auto !important;
    }

    /* Keep time headers with their first session */
    .bg-gray-100.text-gray-700.text-sm.font-semibold {
        page-break-after: avoid !important;
    }

    /* Allow page breaks between major sections */
    section {
        page-break-before: auto !important;
        page-break-after: auto !important;
    }

    /* Sessions can break across pages if needed */
    a.block.group {
        page-break-inside: auto !important;
    }

    /* =============================================
       PRINT HEADER/FOOTER
       ============================================= */

    @page {
        margin: 0.75in;
        size: letter;
    }

    /* Add URL after links for reference */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.7rem;
        color: #666;
    }

    /* Don't show URL for internal navigation links */
    a[href^="#"]:after,
    a[href*="session-details"]:after,
    a[href*="speaker-details"]:after,
    a[href*="schedule"]:after,
    a[href*="sessions"]:after {
        content: "" !important;
    }
}

/* =============================================
   PRINT-ONLY ELEMENTS (visible only when printing)
   ============================================= */

.print-only {
    display: none !important;
}

.print-only-inline {
    display: none !important;
}

@media print {
    .print-only {
        display: block !important;
    }

    .print-only-inline {
        display: inline !important;
    }

    /* Description text in schedule - show full text, better spacing */
    .print-description {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        color: #333 !important;
        margin-top: 0.5rem !important;
    }
}

/* =============================================
   NO-PRINT CLASS (hide when printing)
   ============================================= */

@media print {
    .no-print {
        display: none !important;
    }

    /* Additional rules when body has printing class (set via JS beforeprint) */
    body.printing #sessions-fixed-header {
        display: none !important;
        position: absolute !important;
        top: -9999px !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
    }

    body.printing #sessions-listing-container {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    body.printing .print-header {
        display: block !important;
    }
}

/* =============================================
   ADDITIONAL PRODUCTION VIEW STYLES
   ============================================= */

@media print {
    /* Hide loading spinners and overlays */
    #loading-spinner,
    .fixed.inset-0 {
        display: none !important;
    }

    /* Hide sidebar navigation partial */
    #side-menu {
        display: none !important;
    }

    /* Session status indicators - hide for print */
    .w-2.h-2.rounded-full {
        display: none !important;
    }

    /* Type badges in schedule */
    .bg-green-100.text-green-800,
    .bg-purple-100.text-purple-800 {
        background: #f3f4f6 !important;
        border: none !important;
        color: #000 !important;
    }

    /* Action buttons container - hide in session details */
    .bg-white.shadow-sm.border-b.border-gray-200 {
        display: none !important;
    }

    /* Livestream section - hide when printing */
    section:has(#livestreamThumbnail),
    .bg-black.rounded-lg {
        display: none !important;
    }

    /* Location permission modal - hide */
    #locationPermissionModal {
        display: none !important;
    }

    /* Search/filter panel - hide */
    #search-filter-panel,
    .search-filter-panel {
        display: none !important;
    }

    /* Main content padding adjustment - CRITICAL for removing whitespace */
    /* Use multiple selectors for high specificity to override Tailwind */
    div#sessions-listing-container,
    div#sessions-listing-container.pt-\[calc\(8em\+8px\)\],
    body div#sessions-listing-container,
    html body div#sessions-listing-container {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    main#sessions-content,
    body main#sessions-content,
    #sessions-listing-container main#sessions-content {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Target all elements with Tailwind padding classes */
    [class*="pt-["],
    [class*="pt-\["],
    .pt-16,
    .pt-12,
    .pt-32,
    .pt-14 {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* Layout wrapper from _Layout.cshtml */
    body > div.pt-0,
    body > div > main.bg-white {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Content sections in session details */
    .content-section {
        margin: 0.5rem 0 !important;
        padding: 0.5rem !important;
        page-break-inside: avoid !important;
    }

    .content-section-alt {
        margin-top: 0.5rem !important;
    }

    /* Section headings in details view */
    .section-heading {
        font-size: 1rem !important;
        border-bottom: 1px solid #ccc !important;
        padding-bottom: 0.25rem !important;
        margin-bottom: 0.5rem !important;
        page-break-after: avoid !important;
    }

    /* Learning objectives */
    .objective-item {
        page-break-inside: avoid !important;
    }

    .objective-number {
        color: #000 !important;
    }

    /* List items (speakers, handouts) */
    .list-item {
        background: white !important;
        border: none !important;
        border-bottom: 1px solid #ddd !important;
        margin-bottom: 0 !important;
        page-break-inside: avoid !important;
    }

    /* Status badges - ensure visible */
    .status-badge {
        background: #f3f4f6 !important;
        border: none !important;
        color: #000 !important;
    }

    /* Animate-pulse class - disable for print */
    .animate-pulse {
        animation: none !important;
    }

    /* Line clamp text - show full text when printing */
    .line-clamp-2 {
        -webkit-line-clamp: unset !important;
        overflow: visible !important;
    }
}
