/* Print Styles for MyRaceHub */
@media print {
    /* Hide non-essential elements */
    header,
    .controls,
    .month-nav-sidebar,
    .my-calendar-sidebar,
    .export-section,
    .btn-add-calendar,
    .race-actions,
    .race-gap,
    .parkrun-section,
    .auth-section,
    footer,
    #loading,
    .month-nav-list,
    .view-toggle,
    .filters,
    .race-modal,
    .login-modal,
    button,
    .btn {
        display: none !important;
    }

    /* Reset page layout */
    body {
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
        font-size: 11pt;
        line-height: 1.4;
        color: #000;
        background: white;
        margin: 0;
        padding: 0;
    }

    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .main-layout {
        display: block;
    }

    .main-content {
        width: 100%;
        padding: 0;
    }

    /* Print-only header */
    .main-content::before {
        content: 'My Running Calendar';
        display: block;
        font-size: 24pt;
        font-weight: bold;
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #333;
    }

    /* Month section styling */
    .month-section {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    .month-header {
        font-size: 14pt;
        font-weight: bold;
        color: #333;
        border-bottom: 1px solid #ccc;
        padding-bottom: 5px;
        margin-bottom: 10px;
    }

    /* Race card styling for print */
    .race-card {
        page-break-inside: avoid;
        border: 1px solid #ddd;
        border-radius: 0;
        padding: 10px;
        margin-bottom: 10px;
        box-shadow: none;
        background: white;
    }

    .race-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }

    .race-date {
        font-weight: bold;
        color: #333;
    }

    .race-name {
        font-size: 12pt;
        font-weight: 600;
    }

    .race-details {
        margin-top: 8px;
    }

    .detail-row {
        margin-bottom: 4px;
    }

    .detail-icon {
        display: none;
    }

    .detail-label {
        font-weight: bold;
        margin-right: 5px;
    }

    .distance-badge {
        display: inline-block;
        border: 1px solid #333;
        padding: 2px 8px;
        margin-right: 5px;
        font-size: 9pt;
    }

    .race-organizer-logo {
        display: none;
    }

    .race-image {
        display: none;
    }

    .notes {
        font-style: italic;
        font-size: 9pt;
        color: #666;
    }

    /* Page breaks */
    h2.month-header {
        page-break-after: avoid;
    }

    /* Calendar events (My Calendar sidebar content when printed) */
    .calendar-event-card {
        page-break-inside: avoid;
        border: 1px solid #ddd;
        padding: 10px;
        margin-bottom: 8px;
    }

    .event-name {
        font-weight: bold;
    }

    .event-date {
        color: #666;
    }

    .event-distance {
        font-size: 9pt;
    }

    .event-gap {
        font-size: 9pt;
        color: #666;
    }

    /* Footer with print date */
    @page {
        margin: 1.5cm;
    }

    /* Add generated date at bottom */
    .main-content::after {
        content: 'Printed from MyRaceHub';
        display: block;
        margin-top: 30px;
        padding-top: 10px;
        border-top: 1px solid #ccc;
        font-size: 9pt;
        color: #666;
        text-align: center;
    }

    /* Ensure links are visible in print */
    a {
        color: #000;
        text-decoration: none;
    }

    a[href]::after {
        content: none; /* Don't show URLs after links */
    }
}

/* Screen-only utility class */
@media screen {
    .print-only {
        display: none !important;
    }
}
