/* ==========================================================================
   Conference agenda — grid and list views, day tabs, personal-agenda filter.

   Extracted verbatim from the inline <style> block in Pages/Content/Agenda.cshtml
   so that My Conference can present the same agenda UI rather than a second,
   divergent one. Both pages link this file; neither owns it.

   Razor's @@media escaping is not needed here: this is a plain stylesheet.
   ========================================================================== */

    /* Agenda Controls Container */
    .agenda-controls {
        text-align: center;
    }

    /* Schedule block pinned to a single room column — reads as a block, not a session card */
    .session-card-mini.service.schedule-block-room-card {
        height: 100%;
        border-left: 3px solid var(--theme-primary, #0d6efd);
    }

    .schedule-block-room-time {
        margin-top: 0.35rem;
        font-size: 0.75rem;
        color: #6c757d;
    }

    /* Star on an admin-managed schedule block. It anchors inside the block's own card rather than
       on a wrapper, because the element the personal-agenda filter hides is the grid cell (or the
       list group) outside it — a wrapper here would be hidden along with the star it holds. */
    .has-schedule-star {
        position: relative;
    }

    .schedule-block-star {
        top: 0.15rem;
        right: 0.15rem;
        width: 24px;
        height: 24px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
        border: 1px solid #e9ecef;
        z-index: 5;
    }

    .schedule-block-star:hover:not(:disabled) {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    .schedule-block-star i {
        font-size: 0.75rem;
    }

    /* Keep the title out from under the star */
    .has-schedule-star .session-title,
    .has-schedule-star .schedule-block-body-name {
        padding-right: 1.75rem;
    }

    .schedule-block-body.has-schedule-star .schedule-block-star {
        top: 0.5rem;
        right: 0.75rem;
    }

    /* A block spanning several rows sits above the full-width bands it passes through, so the
       column reads as one continuous fixture. */
    .agenda-cell-span {
        z-index: 1;
        background: #fff;
    }

    /* Explicit grid placement means DOM order no longer identifies the rightmost cell. */
    .agenda-cell-last {
        border-right: none;
    }

    /* Personal Agenda Empty Banner */
    .personal-agenda-empty-banner {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        background: rgba(13, 110, 253, 0.08);
        border: 1px solid var(--theme-primary, #0d6efd);
        border-radius: 8px;
        color: #555;
        font-size: 0.95rem;
    }

    .personal-agenda-empty-banner i {
        color: var(--theme-primary, #0d6efd);
        font-size: 1.1rem;
    }

    .personal-agenda-empty-banner a {
        color: var(--theme-primary, #0d6efd);
        font-weight: 500;
    }

    .personal-agenda-empty-banner a:hover {
        text-decoration: underline;
    }

    /* Personal Agenda Filter - Custom Toggle */
    .personal-agenda-filter {
        display: flex;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .personal-agenda-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.75rem;
        cursor: pointer;
        user-select: none;
        padding: 0.5rem 1rem;
        background: transparent;
        transition: all 0.2s ease;
    }

    .personal-agenda-toggle:hover {
        opacity: 0.85;
    }

    .personal-agenda-toggle input {
        display: none;
    }

    .toggle-slider {
        position: relative;
        width: 44px;
        height: 24px;
        background: #ccc;
        border-radius: 24px;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }

    .toggle-slider::after {
        content: '';
        position: absolute;
        top: 2px;
        left: 2px;
        width: 20px;
        height: 20px;
        background: #fff;
        border-radius: 50%;
        transition: all 0.3s ease;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .personal-agenda-toggle input:checked + .toggle-slider {
        background: var(--theme-primary, #0d6efd);
    }

    .personal-agenda-toggle input:checked + .toggle-slider::after {
        left: calc(100% - 22px);
    }

    .toggle-label {
        font-weight: 500;
        color: #333;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .toggle-label i {
        color: var(--theme-primary, #0d6efd);
    }

    .personal-agenda-toggle input:checked ~ .toggle-label {
        color: var(--theme-primary, #0d6efd);
    }

    /* Day Tabs */
    .agenda-tabs {
        gap: 10px;
    }

    .agenda-tabs .nav-link {
        background: #fff;
        border: 2px solid #0d6efd;
        border-radius: 12px;
        padding: 15px 25px;
        color: #0d6efd;
        transition: all 0.3s ease;
        text-align: center;
        min-width: 100px;
        text-decoration: none;
    }

    .agenda-tabs .nav-link .tab-day,
    .agenda-tabs .nav-link .tab-date {
        color: #0d6efd;
    }

    .agenda-tabs .nav-link:hover {
        background: rgba(13, 110, 253, 0.1);
    }

    .agenda-tabs .nav-link.active {
        background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
        border-color: #0d6efd;
        color: #fff;
    }

    .agenda-tabs .nav-link.active .tab-day,
    .agenda-tabs .nav-link.active .tab-date {
        color: #fff;
    }

    .tab-day {
        display: block;
        font-family: var(--font-heading);
        font-size: 1.1rem;
        font-weight: 600;
    }

    .tab-date {
        display: block;
        font-size: 0.85rem;
        font-weight: 500;
    }

    /* Print Button */
    .print-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: 1px solid #e9ecef;
        background: #fff;
        color: #666;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .print-btn:hover {
        color: var(--theme-primary);
        border-color: var(--theme-primary);
        background: rgba(var(--theme-primary-rgb, 0, 123, 255), 0.05);
    }

    /* View Toggle */
    .view-toggle {
        display: flex;
        gap: 0.25rem;
        background: #e9ecef;
        padding: 0.25rem;
        border-radius: 8px;
    }

    .view-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: none;
        background: transparent;
        color: #666;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .view-toggle-btn:hover {
        color: var(--theme-primary);
        background: rgba(255, 255, 255, 0.5);
    }

    .view-toggle-btn.active {
        background: #fff;
        color: var(--theme-primary);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    /* Grid View */
    .agenda-grid-wrapper {
        overflow-x: auto;
        overflow-y: visible;
        margin: 0 -1rem;
        padding: 0 1rem 1rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--theme-primary) #e9ecef;
    }

    .agenda-grid-wrapper::-webkit-scrollbar {
        height: 8px;
    }

    .agenda-grid-wrapper::-webkit-scrollbar-track {
        background: #e9ecef;
        border-radius: 4px;
    }

    .agenda-grid-wrapper::-webkit-scrollbar-thumb {
        background: var(--theme-primary);
        border-radius: 4px;
    }

    .agenda-grid-wrapper::-webkit-scrollbar-thumb:hover {
        background: var(--theme-primary-dark);
    }

    .agenda-grid {
        display: grid;
        width: fit-content;
        border: 1px solid #e9ecef;
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
    }

    .agenda-cell {
        padding: 0.75rem;
        border-right: 1px solid #e9ecef;
        border-bottom: 1px solid #e9ecef;
        min-height: 80px;
    }


    .agenda-header-cell {
        background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-dark) 100%);
        color: #fff;
        font-family: var(--font-heading);
        font-weight: 600;
        font-size: 0.85rem;
        text-align: center;
        min-height: auto;
        padding: 1rem 0.5rem;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .time-header {
        position: sticky;
        left: 0;
        z-index: 3;
    }

    .time-cell {
        background: #f8f9fa;
        position: sticky;
        left: 0;
        z-index: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        min-width: 100px;
    }

    .time-display {
        font-family: var(--font-heading);
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--theme-dark);
    }

    .time-end {
        font-size: 0.75rem;
        color: #666;
    }

    .session-cell {
        background: #fff;
        vertical-align: top;
        overflow: visible;
    }

    /* Session Card Mini Wrapper (for star positioning) */
    .session-card-mini-wrapper {
        position: relative;
        height: 100%;
        overflow: visible;
    }

    .session-card-mini-wrapper .star-btn-mini {
        position: absolute;
        top: -0.5rem;
        right: -0.5rem;
        width: 24px;
        height: 24px;
        z-index: 5;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
        border: 1px solid #e9ecef;
        border-radius: 50%;
    }

    .session-card-mini-wrapper .star-btn-mini:hover:not(:disabled) {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    .session-card-mini-wrapper .star-btn-mini i {
        font-size: 0.75rem;
    }

    /* Session Card Mini (Grid) */
    .session-card-mini {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem;
        border-radius: 8px;
        background: #f8f9fa;
        height: 100%;
        text-decoration: none;
        color: inherit;
        transition: all 0.2s ease;
        font-size: 0.8rem;
    }

    .session-card-mini:not(.service):hover {
        background: rgba(var(--theme-primary-rgb, 0, 123, 255), 0.1);
        transform: translateY(-2px);
    }

    .session-card-mini .session-title {
        font-weight: 600;
        color: var(--theme-dark);
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .session-card-mini:not(.service):hover .session-title {
        color: var(--theme-primary);
    }

    .session-card-mini .session-track {
        display: inline-block;
        font-size: 0.6rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        color: #fff;
        background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-dark, #0056b3) 100%);
        padding: 0.15rem 0.4rem;
        border-radius: 10px;
        margin-top: 0.25rem;
    }

    .session-card-mini .session-speaker {
        font-size: 0.75rem;
        color: #666;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .session-card-mini.service {
        background: #e9ecef;
        justify-content: center;
        align-items: center;
        text-align: center;
        cursor: default;
    }

    .session-card-mini.service .session-title {
        color: var(--theme-dark);
        font-weight: 600;
    }

    .service-session {
        background: #f0f0f0;
    }

    /* List View */
    .time-slot-group {
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
        overflow: hidden;
    }

    .time-slot-header {
        background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-dark) 100%);
        color: #fff;
        padding: 1rem 1.5rem;
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .time-range {
        font-family: var(--font-heading);
        font-size: 1.1rem;
        font-weight: 600;
    }

    .time-range .day-label {
        opacity: 0.9;
        margin-right: 0.25rem;
    }

    .service-label {
        font-size: 0.9rem;
        opacity: 0.9;
    }

    .schedule-block-body {
        padding: 0.75rem 1rem;
    }

    .schedule-block-body-name {
        font-weight: 600;
        color: #333;
        font-size: 1rem;
    }

    .schedule-block-body-location {
        font-size: 0.85rem;
        color: #666;
        margin-top: 0.25rem;
    }

    .schedule-block-body-desc {
        font-size: 0.85rem;
        color: #888;
        margin-top: 0.35rem;
    }

    a.schedule-block-title-link {
        color: inherit;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .session-card-mini.service a.session-title:hover,
    a.schedule-block-title-link:hover {
        color: var(--theme-primary, #0d6efd);
    }

    .schedule-block-grid-location {
        display: block;
        font-size: 0.75rem;
        color: #888;
        margin-top: 2px;
    }

    /* Descriptions can run long — lab prerequisites, for one — and a room column is narrow
       enough that the full text swamps the block. Clamp to two lines here; the title
       tooltip and the block's detail page carry the whole thing. */
    .schedule-block-grid-desc {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.75rem;
        color: #888;
        margin-top: 2px;
    }

    /* Secondary link to the block's detail page, where the full description and the registration
       link live. Quieter than Register — this is a "read more", not the action. Only rendered
       when an admin-set external URL has taken the title, leaving the detail page unreachable. */
    .schedule-block-details {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        margin-top: 0.35rem;
        margin-right: 0.75rem;
        font-size: 0.78rem;
        font-weight: 600;
        color: #666;
        text-decoration: none;
    }

    .schedule-block-details:hover,
    .schedule-block-details:focus {
        color: var(--theme-primary, #0d6efd);
        text-decoration: underline;
    }

    /* Registration link on a schedule block. Deliberately louder than the description text —
       it is the one thing on the block an attendee has to act on. */
    .schedule-block-register {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        margin-top: 0.35rem;
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--theme-primary, #0d6efd);
        text-decoration: none;
    }

    .schedule-block-register:hover {
        text-decoration: underline;
        color: var(--theme-primary-dark, #0a58ca);
    }

    .schedule-block-time,
    .schedule-block-row {
        min-height: 40px;
        padding: 0.4rem 0.75rem;
    }

    .schedule-block-time {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .schedule-block-row {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .schedule-block-row .session-card-mini.service {
        flex-direction: column;
        align-items: center;
        padding: 0.35rem 0.5rem;
        min-height: 0;
        height: auto;
    }

    .time-slot-group .row {
        padding: 1.25rem 1.25rem 1rem 1rem;
    }

    /* Scroll hint */
    .scroll-hint {
        opacity: 0.7;
    }

    /* Agenda content transition for AJAX loading */
    #agendaContent {
        transition: opacity 0.15s ease;
    }

    /* Hero description toggle for mobile */
    .hero-desc-mobile {
        display: none;
    }

    /* Responsive - Mobile */
    @media (max-width: 767.98px) {
        /* Show mobile description, hide desktop description */
        .hero-desc-desktop {
            display: none;
        }

        .hero-desc-mobile {
            display: inline;
        }

        /* Hide view toggle and grid view on mobile */
        .view-toggle {
            display: none !important;
        }

        .scroll-hint {
            display: none !important;
        }

        #gridView {
            display: none !important;
        }

        #listView {
            display: block !important;
        }

        /* Center day tabs on mobile */
        .agenda-tabs {
            flex-wrap: nowrap;
            overflow-x: auto;
            padding-bottom: 10px;
            justify-content: center !important;
        }

        .agenda-tabs .nav-link {
            min-width: 80px;
            padding: 12px 15px;
        }

        .tab-day {
            font-size: 1rem;
        }

        .tab-date {
            font-size: 0.75rem;
        }

    }

    /* Ensure parent containers don't block scroll */
    .agenda-section {
        overflow-x: visible;
    }

    .agenda-section .container {
        overflow-x: visible;
    }

    /* Personal agenda print header (hidden by default, shown when printing with filter active) */
    .personal-agenda-print-header {
        text-align: center;
        font-family: var(--font-heading);
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--theme-primary);
        padding: 0.5rem;
        margin-bottom: 1rem;
    }

    .personal-agenda-print-header i {
        margin-right: 0.5rem;
    }

    /* Print styles */
    @media print {
        /* Show the print header only when personal agenda is active */
        .personal-agenda-print-header.print-visible {
            display: block !important;
        }

        /* Hide stars/buttons when printing */
        .star-btn,
        .star-btn-mini,
        .print-btn,
        .view-toggle {
            display: none !important;
        }

        /* Hide chevron arrows when printing */
        .agenda-card-arrow {
            display: none !important;
        }

        /* Hide day tabs when printing */
        .agenda-tabs {
            display: none !important;
        }

        /* Prevent page breaks inside individual session cards only */
        /* Note: Don't apply to .time-slot-group - large groups cause blank pages */
        .agenda-card-wrapper,
        .agenda-card {
            break-inside: avoid;
            page-break-inside: avoid;
        }

        .session-card-mini-wrapper,
        .session-card-mini {
            break-inside: avoid;
            page-break-inside: avoid;
        }

        /* Allow time slot headers to break before if needed */
        .time-slot-header {
            break-after: avoid;
            page-break-after: avoid;
        }
    }
