/* Frontend Styles for Hmeonot Events Calendar */

.hmeonot-calendar-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    direction: rtl;
    width: 100%;
    box-sizing: border-box;
}

.hmeonot-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.hmeonot-calendar-navigation {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hmeonot-calendar-year-input {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px 20px;
    width: 150px;
    transition: all 0.3s ease;
}

.hmeonot-calendar-year-input:hover {
    border-color: #007bff;
}

.hmeonot-calendar-year-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0,123,255,0.3);
}

.hmeonot-nav-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.hmeonot-nav-button:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Calendar Table Styles */
.hmeonot-calendar-wrapper {
    max-width: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.hmeonot-calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px auto;
    direction: rtl;
    font-family: Arial, sans-serif;
    table-layout: fixed;
}

.hmeonot-calendar-row {
    border: 1px solid #333;
}

.hmeonot-month-name {
    background: #e8e8e8;
    border: 1px solid #333;
    padding: 8px 4px;
    text-align: center;
    font-weight: bold;
    font-size: 11px;
    width: 8%;
    vertical-align: middle;
}

.hmeonot-month-name .month-year {
    font-size: 8px;
    font-weight: normal;
    display: block;
    margin-top: 2px;
}

.hmeonot-day-cell {
    border: 1px solid #333;
    padding: 4px 2px;
    text-align: center;
    width: 2.96%;
    min-width: 2.96%;
    max-width: 2.96%;
    height: 90px;
    vertical-align: top;
    position: relative;
    background: white;
    font-size: 9px;
}

.hmeonot-day-cell.empty {
    background: #f5f5f5;
    cursor: default;
    width: 2.96%;
    min-width: 2.96%;
    max-width: 2.96%;
}

.hmeonot-day-cell.has-event {
    cursor: pointer;
    font-weight: bold;
}

.hmeonot-day-cell.has-event:hover {
    background: #fffacd;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

.hmeonot-day-cell:hover:not(.empty):not(.has-event) {
    background: #f8f8f8;
}

.day-of-week {
    font-size: 7px;
    color: #999;
    font-weight: normal;
    display: block;
    line-height: 1;
}

.day-number {
    font-size: 10px;
    font-weight: bold;
    color: #333;
    display: block;
    line-height: 1.2;
    margin: 1px 0;
}

.day-hebrew {
    font-size: 7px;
    color: #666;
    line-height: 1.1;
    display: block;
    margin-top: 2px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .hmeonot-month-name {
        font-size: 9px;
        width: 7%;
    }

    .hmeonot-day-cell {
        width: 3%;
        height: 40px;
        font-size: 8px;
    }

    .day-of-week {
        font-size: 6px;
    }

    .day-number {
        font-size: 9px;
    }

    .day-hebrew {
        font-size: 5px;
    }
}

/* Tablet size - intermediate between desktop and mobile */
@media (min-width: 481px) and (max-width: 768px) {
    .hmeonot-month-name {
        width: 8%;
        min-width: 8%;
        max-width: 8%;
    }

    .hmeonot-day-cell {
        width: 2.96%;
        min-width: 2.96%;
        max-width: 2.96%;
    }

    .hmeonot-day-cell.empty {
        width: 2.96%;
        min-width: 2.96%;
        max-width: 2.96%;
    }

    .day-number {
        font-size: 9px;
    }

    .day-hebrew {
        font-size: 5px;
    }
}

@media (max-width: 768px) {
    .hmeonot-calendar-wrapper {
        padding: 10px 5px;
        margin: 10px auto;
        width: 100%;
        overflow-x: visible;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }

    .hmeonot-calendar-header {
        padding: 15px 10px;
        margin-bottom: 15px;
        box-sizing: border-box;
    }

    .hmeonot-calendar-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .hmeonot-calendar-year-input {
        font-size: 24px;
        width: 100%;
        max-width: 200px;
        padding: 12px;
        margin: 0 auto;
    }

    .hmeonot-nav-button {
        width: 100%;
        max-width: 250px;
        padding: 12px 20px;
        font-size: 16px;
        margin: 0 auto;
    }

    .hmeonot-calendar-table {
        table-layout: fixed;
        width: 100%;
        max-width: 100%;
    }

    .hmeonot-month-name {
        width: 8%;
        min-width: 8%;
        max-width: 8%;
        font-size: 9px;
        padding: 6px 4px;
        border: 1px solid #333;
    }

    .hmeonot-month-name .month-year {
        font-size: 7px;
    }

    .hmeonot-day-cell {
        width: 2.96%;
        min-width: 2.96%;
        max-width: 2.96%;
        height: 90px;
        padding: 4px 2px;
        font-size: 9px;
        border: 1px solid #333;
    }

    .hmeonot-day-cell.empty {
        width: 2.96%;
        min-width: 2.96%;
        max-width: 2.96%;
        border: 1px solid #333;
    }

    .hmeonot-day-cell.has-event {
        cursor: pointer;
    }

    .day-of-week {
        font-size: 6px;
        line-height: 1;
        display: block;
    }

    .day-number {
        font-size: 9px;
        margin: 1px 0;
        line-height: 1.2;
        display: block;
        font-weight: bold;
    }

    .day-hebrew {
        font-size: 6px;
        line-height: 1.1;
        display: block;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Popup adjustments for mobile */
    .hmeonot-popup-content {
        width: 95%;
        max-width: 95%;
        margin: 10px;
    }

    .hmeonot-popup-header {
        padding: 15px 10px;
    }

    .hmeonot-popup-title {
        font-size: 20px;
        padding-left: 45px;
    }

    .hmeonot-popup-body {
        padding: 15px 10px;
    }

    .hmeonot-event-title {
        font-size: 16px;
    }

    .hmeonot-register-button {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 16px;
    }
}

.hmeonot-event-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

/* Popup Modal */
.hmeonot-event-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.hmeonot-event-popup.active {
    display: flex;
}

.hmeonot-popup-content {
    background: white;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    position: relative;
}

.hmeonot-popup-header {
    padding: 20px;
    border-bottom: 2px solid #eee;
    position: relative;
}

.hmeonot-popup-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hmeonot-popup-close:hover {
    background: #c82333;
    transform: rotate(90deg);
}

.hmeonot-popup-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    padding-left: 50px;
}

.hmeonot-popup-date {
    color: #666;
    margin-top: 5px;
    font-size: 14px;
}

.hmeonot-popup-body {
    padding: 20px;
}

.hmeonot-popup-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}

.hmeonot-popup-description {
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
}

.hmeonot-event-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.hmeonot-event-item:last-child {
    border-bottom: none;
}

.hmeonot-event-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.hmeonot-event-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.hmeonot-register-button {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.hmeonot-register-button:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: white;
}

/* Responsive */
@media (max-width: 992px) {
    .hmeonot-calendar-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hmeonot-calendar-grid {
        grid-template-columns: 1fr;
    }

    .hmeonot-calendar-header {
        flex-direction: column;
        gap: 15px;
    }

    .hmeonot-month-days {
        grid-template-columns: repeat(7, 1fr);
    }

    .hmeonot-calendar-day {
        min-height: 50px;
        padding: 4px;
    }

    .hmeonot-day-date {
        font-size: 12px;
    }

    .hmeonot-day-hebrew {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .hmeonot-calendar-wrapper {
        padding: 5px 3px;
        margin: 5px auto;
        width: 100%;
        box-sizing: border-box;
    }

    .hmeonot-calendar-header {
        padding: 10px 5px;
        margin-bottom: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .hmeonot-calendar-year-input {
        font-size: 20px;
        width: 100%;
        max-width: 160px;
        padding: 10px;
    }

    .hmeonot-nav-button {
        font-size: 14px;
        padding: 10px 15px;
    }

    .hmeonot-calendar-table {
        font-size: 8px;
    }

    .hmeonot-month-name {
        width: 8%;
        min-width: 8%;
        max-width: 8%;
        font-size: 8px;
        padding: 4px 2px;
    }

    .hmeonot-month-name .month-year {
        font-size: 6px;
    }

    .hmeonot-day-cell {
        width: 2.96%;
        min-width: 2.96%;
        max-width: 2.96%;
        height: 68px;
        padding: 2px 1px;
    }

    .hmeonot-day-cell.empty {
        width: 2.96%;
        min-width: 2.96%;
        max-width: 2.96%;
    }

    .day-of-week {
        font-size: 5px;
    }

    .day-number {
        font-size: 8px;
    }

    .day-hebrew {
        font-size: 5px;
        line-height: 1.1;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Simplify popup for very small screens */
    .hmeonot-popup-content {
        width: 98%;
        max-height: 90vh;
    }

    .hmeonot-popup-title {
        font-size: 18px;
    }

    .hmeonot-popup-close {
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
}

/* ====================================================
   Calendar Export Buttons
   ==================================================== */

.hmeonot-calendar-export-actions {
    margin-top: 15px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hmeonot-export-dropdown {
    position: relative;
    display: inline-block;
}

.hmeonot-export-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hmeonot-export-button:hover {
    background: #005a87;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.hmeonot-export-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.hmeonot-export-dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 250px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 6px;
    margin-top: 8px;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
}

.hmeonot-export-dropdown.active .hmeonot-export-dropdown-content {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.hmeonot-export-option {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s;
    border-bottom: 1px solid #eee;
}

.hmeonot-export-option:last-child {
    border-bottom: none;
}

.hmeonot-export-option:hover {
    background-color: #f5f5f5;
}

.hmeonot-export-option .dashicons {
    color: #0073aa;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.hmeonot-export-option:hover .dashicons {
    color: #005a87;
}

/* Event Export Button (for individual events) */
.hmeonot-event-export-button {
    margin-top: 8px;
}

.hmeonot-event-export-button .hmeonot-export-button {
    padding: 8px 16px;
    font-size: 14px;
}

.hmeonot-event-export-button .hmeonot-export-dropdown-content {
    min-width: 200px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hmeonot-calendar-export-actions {
        margin-top: 10px;
    }

    .hmeonot-export-button {
        padding: 10px 18px;
        font-size: 14px;
    }

    .hmeonot-export-dropdown-content {
        min-width: 220px;
    }
}

/* ====================================================
   Print Button
   ==================================================== */

.hmeonot-print-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hmeonot-print-button:hover {
    background: #218838;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.hmeonot-print-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ====================================================
   Print Styles for A4 Landscape
   ==================================================== */

@media print {
    @page {
        size: A4 landscape;
        margin: 5mm 8mm;
    }

    /* Hide ALL content before calendar wrapper */
    .hmeonot-calendar-wrapper ~ *,
    .entry-content > *:not(.hmeonot-calendar-wrapper) {
        display: none !important;
    }

    /* Hide unwanted elements including duplicate headers */
    header, footer, nav, aside,
    .site-header, .site-footer, .sidebar,
    .hmeonot-calendar-navigation,
    .hmeonot-calendar-export-actions,
    button, .button,
    #wpadminbar,
    .gtranslate_wrapper,
    [class*="translate"],
    [id*="google_translate"],
    [class*="gtranslate"],
    #site-navigation,
    .entry-header,
    .entry-footer,
    .entry-title,
    .page-header,
    .hmeonot-event-popup,
    .hmeonot-export-dropdown,
    .hmeonot-print-button,
    .hmeonot-export-button,
    h1, h2:not(.hmeonot-academic-year-title h2),
    h3:not(.hmeonot-calendar-wrapper h3),
    h4, h5, h6,
    .page-title,
    p:not(.hmeonot-calendar-wrapper p),
    ul:not(.hmeonot-calendar-wrapper ul),
    .hmeonot-scroll-top,
    body > [class*="scroll"],
    #scroll-to-top,
    .scroll-top-arrow,
    .generate-back-to-top,
    a.generate-back-to-top,
    [class*="back-to-top"],
    [id*="back-to-top"],
    [class*="scroll-top"],
    [id*="scroll-top"] {
        display: none !important;
        visibility: hidden !important;
    }

    /* Show legend - compact */
    .hmeonot-calendar-wrapper h3 {
        display: block !important;
        margin: 1mm 0 0.5mm 0 !important;
        font-size: 11px !important;
        font-weight: bold !important;
        text-align: center !important;
    }

    .hmeonot-calendar-wrapper p,
    .hmeonot-calendar-wrapper ul {
        display: block !important;
        font-size: 9px !important;
        margin: 0.5mm 0 !important;
        text-align: center !important;
        line-height: 1.3 !important;
    }

    .hmeonot-calendar-wrapper li {
        display: inline-block !important;
        margin: 0 2mm !important;
        font-size: 9px !important;
    }

    /* Enable colors */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
    }

    /* Remove all padding/margins from containers */
    body, #page, #content, .site, .site-content,
    main, article, .entry-content,
    div[class*="wrapper"], div[class*="container"] {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
    }

    /* Calendar wrapper - fit to page */
    .hmeonot-calendar-wrapper {
        display: block !important;
        visibility: visible !important;
        max-width: 277mm !important;
        width: 277mm !important;
        height: 190mm !important;
        max-height: 190mm !important;
        margin: 0 auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .hmeonot-calendar-wrapper * {
        visibility: visible !important;
    }

    /* Header with maximum height */
    .hmeonot-calendar-header {
        height: 10mm !important;
        margin: 0 !important;
        padding: 2mm !important;
        background: #f8f9fa !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .hmeonot-calendar-header h2,
    .hmeonot-academic-year-title,
    .hmeonot-academic-year-title h2 {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.2 !important;
        font-size: 18px !important;
        font-weight: bold !important;
        text-align: center !important;
    }

    /* Calendar table - stretched to maximum */
    .hmeonot-calendar-table {
        width: 277mm !important;
        max-width: 277mm !important;
        height: 168mm !important;
        max-height: 168mm !important;
        page-break-inside: avoid !important;
        margin: 0 !important;
        border-spacing: 0 !important;
        border-collapse: collapse !important;
        table-layout: fixed !important;
    }

    .hmeonot-calendar-table tbody {
        height: auto !important;
        max-height: none !important;
    }

    .hmeonot-calendar-table tbody tr {
        height: 14mm !important;
        max-height: 14mm !important;
        line-height: 1 !important;
        page-break-inside: avoid !important;
    }

    .hmeonot-calendar-table td,
    .hmeonot-day-cell {
        height: 14mm !important;
        min-height: 14mm !important;
        max-height: 14mm !important;
        padding: 0.5mm !important;
        line-height: 1.15 !important;
        overflow: visible !important;
        font-size: 8px !important;
        vertical-align: top !important;
    }

    .hmeonot-day-cell div {
        line-height: 1.1 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .day-of-week {
        font-size: 7px !important;
    }

    .day-number {
        font-size: 10px !important;
        font-weight: bold !important;
    }

    .day-hebrew {
        font-size: 7px !important;
    }

    .hmeonot-month-name {
        height: 14mm !important;
        max-height: 14mm !important;
        padding: 0.5mm !important;
        font-size: 10px !important;
        font-weight: bold !important;
        line-height: 1.3 !important;
        overflow: visible !important;
        vertical-align: middle !important;
    }

    .hmeonot-month-name .month-year {
        font-size: 8px !important;
        display: block !important;
        margin-top: 1mm !important;
    }
}
/* Cache bust: 1731950560 - Restored from working backup 2025-11-18 */

/* ========================================
   Gravity Forms Confirmation Styling
   הודעות אישור בולטות וברורות
   ======================================== */

/* Main confirmation message container */
.gform_confirmation_wrapper,
.gform_confirmation_message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
    border: 3px solid #28a745 !important;
    border-radius: 12px !important;
    padding: 30px !important;
    margin: 20px 0 !important;
    text-align: center !important;
    font-size: 18px !important;
    color: #155724 !important;
    position: relative !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3) !important;
    animation: gform-success-appear 0.5s ease-out !important;
}

/* Add checkmark icon before text */
.gform_confirmation_message::before {
    content: "✓" !important;
    display: block !important;
    font-size: 48px !important;
    color: #28a745 !important;
    margin-bottom: 15px !important;
    font-weight: bold !important;
}

/* Make text bold and larger */
.gform_confirmation_message {
    font-weight: 600 !important;
    line-height: 1.6 !important;
}

/* Scroll to confirmation message */
.gform_confirmation_wrapper {
    scroll-margin-top: 100px !important;
}

/* Animation for appearance */
@keyframes gform-success-appear {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Validation errors styling */
.gform_wrapper .validation_error {
    background: #f8d7da !important;
    border: 2px solid #dc3545 !important;
    border-radius: 8px !important;
    padding: 15px !important;
    color: #721c24 !important;
    font-weight: 600 !important;
    margin-bottom: 20px !important;
}

.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error textarea,
.gform_wrapper .gfield_error select {
    border-color: #dc3545 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .gform_confirmation_wrapper,
    .gform_confirmation_message {
        padding: 20px !important;
        font-size: 16px !important;
    }
    
    .gform_confirmation_message::before {
        font-size: 36px !important;
    }
}
