:root {
    --primary-font: 'David', serif;
    --base-font-size: 12pt;
}

body {
    font-family: var(--primary-font); background-color: #f4f4f9;
    margin: 0; padding: 0; direction: rtl; position: relative; min-height: 100vh;
}

.decorations { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; opacity: 0.15; font-size: 100px; }
.icon-plane { position: absolute; top: 10%; left: 5%; transform: rotate(-20deg); }
.icon-camper { position: absolute; bottom: 10%; left: 10%; }
.icon-hiker { position: absolute; top: 40%; right: 5%; }

#dashboard-view, #editor-view {
    max-width: 1100px; margin: 20px auto; background: rgba(255,255,255,0.95);
    padding: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); border-radius: 8px;
}

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); justify-content: center; align-items: center; z-index: 2000; }
.modal-box { background: white; padding: 30px; border-radius: 8px; width: 400px; display: flex; flex-direction: column; gap: 15px; }
.modal-box label { display: flex; justify-content: space-between; align-items: center; font-weight: bold; }
.modal-box input { padding: 5px; width: 60%; }

.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.trip-card { border: 1px solid #ccc; padding: 15px; border-radius: 8px; background: #fafafa; }
.trip-actions { margin-top: 15px; display: flex; gap: 5px; }
.trip-actions button { flex: 1; padding: 8px; cursor: pointer; border-radius: 4px; border: 1px solid #ccc; }

header button { padding: 6px 10px; cursor: pointer; border-radius: 4px; border: 1px solid #ccc; background: white; }
.primary-btn { background-color: #0056b3; color: white; border: none !important; font-weight: bold; }
.secondary-btn { background-color: #28a745; color: white; border: none !important; font-weight: bold; }
.danger-btn { background-color: #dc3545; color: white; border: none !important; }
.undo-btn { background-color: #fd7e14; color: white; border: none !important; font-weight: bold; }

/* בעורך הבלוקים עדיין רגילים כדי שלא יהיה סלט בעיניים */
.content-block { padding: 5px 0; margin-bottom: 5px; position: relative; clear: both; }
.block-metadata { display: flex; justify-content: space-between; align-items: center; background: #ddd; padding: 5px; font-size: 0.9em; margin-bottom: 5px; }

.mini-toolbar { background: #eee; padding: 5px; border: 1px solid #aaa; border-bottom: none; border-radius: 4px 4px 0 0; display: flex; gap: 5px; align-items: center; }
.mini-toolbar button { padding: 4px 8px; font-family: Arial, sans-serif; cursor: pointer; border: 1px solid #ccc; border-radius: 3px; background: white; }
.mini-toolbar select { padding: 4px; font-family: Arial; }

.text-editor-area { 
    min-height: 50px; background: white; padding: 10px; border: 1px dashed #aaa; 
    font-family: var(--primary-font); font-size: var(--base-font-size); color: black;
    text-align: justify; line-height: 1.6; outline: none; margin-bottom: 10px;
}
.daily-subtitle-editor { font-size: 18pt; font-weight: bold; color: #0056b3; border-bottom: 2px solid #0056b3; padding-bottom: 5px; outline: none; margin-bottom: 10px; }

/* התמונות מוגדרות לצד שמאל */
.img-s { max-width: 50%; float: left; margin: 0 15px 15px 0; } 
.img-m { max-width: 75%; float: left; margin: 0 15px 15px 0; }
.img-l { max-width: 100%; display: block; margin: 15px auto; clear: both; }

#print-container { display: none; }

@media print {
    @page { size: A4 portrait; margin: 15mm; }
    body { background-color: #fff; counter-reset: page-num; }
    .no-print { display: none !important; }
    #print-container { display: block; width: 100%; font-size: var(--base-font-size); }
    
    /* בהדפסה - בלוק הטקסט מאפשר לתמונות שמעליו לזרום פנימה ללא הפרעה (clear: none) */
    .text-print-box { 
        font-family: var(--primary-font); font-size: var(--base-font-size); color: black;
        text-align: justify; line-height: 1.6; margin-bottom: 10px; clear: none; display: block;
    }
    
    .print-daily-subtitle { clear: both; font-size: 18pt; color: #0056b3; border-bottom: 2px solid #0056b3; padding-bottom: 5px; margin-top: 20px; page-break-before: always; }
    .force-page-break { page-break-before: always; clear: both; }

    .fixed-print-header { position: fixed; top: 0; left: 0; width: 100%; display: flex; justify-content: space-between; border-bottom: 1px solid #000; padding-bottom: 5px; font-weight: bold; font-size: 14pt; background: white; z-index: 1000; }
    .fixed-print-footer { position: fixed; bottom: 0; left: 0; width: 100%; text-align: center; border-top: 1px solid #000; padding-top: 5px; font-size: 10pt; background: white; z-index: 1000; }
    
    .print-page-number::after { content: counter(page-num); counter-increment: page-num; }

    table.print-content-table { width: 100%; border-collapse: collapse; border: none; }
    .header-space { height: 40px; }
    .footer-space { height: 40px; }

    h1, h2, h3 { page-break-after: avoid; }
    .print-content p { orphans: 3; widows: 3; }
    .print-content img { page-break-inside: avoid; }
}