/* קובץ: styles.css */
/* תיאור: קובץ סגנונות ראשי עבור האתר, כולל עיצוב רספונסיבי למחשבים וטלפונים, תמיכה בפרסומות, ופס התקדמות עם אנימציה */

/* חיבור לפונט מודרני מ-Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;700&display=swap');

/* הגדרות כלליות - איפוס ברירת מחדל והגדרת פונט מודרני */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Rubik', sans-serif;
}

/* בסיס לדף - כיוון RTL ורקע עם שיפוע מודרני */
body {
    direction: rtl;
    background: linear-gradient(135deg, #e0eafc, #cfdef3); /* שיפוע עדין כחול-לבן */
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
}

/* קונטיינר מרכזי - עיצוב מודרני עם אפקט זכוכית (ברירת מחדל לטלפונים) */
.container {
    max-width: 450px; /* מתאים לטלפונים */
    margin: 20px auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9); /* רקע שקוף מעט */
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px); /* אפקט זכוכית */
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding-right: 0;
    padding-left: 15px;
}

/* קונטיינר כניסה - עיצוב דומה עם זכוכית (ברירת מחדל לטלפונים) */
.login-container {
    max-width: 300px;
    margin: 20px auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    direction: rtl;
    text-align: center;
}

/* כותרות - עיצוב מודרני עם צל קל */
h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 700;
    font-size: 1.5em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 500;
}

h3 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 500;
}

/* מידע משתמש - עיצוב מודרני עם שיפוע */
.user-info p {
    font-weight: 500;
    color: #fff;
    background: linear-gradient(90deg, #2c3e50, #4a6278);
    display: inline-block;
    padding: 8px 15px;
    border-radius: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* שדות טופס - תוויות נקיות וברורות */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: center;
    color: #34495e;
}

/* שדות קלט ותפריט נפתח - עיצוב עם אפקט זכוכית */
input, select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    text-align: center;
    color: #2c3e50;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.3);
}

/* קונטיינר לימים */
.days-input-container {
    margin-bottom: 10px;
}

/* קונטיינר לצ'קבוקס - עיצוב מודרני */
.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
    gap: 8px;
    margin-bottom: 30px;
    white-space: nowrap;
}

.checkbox-container input {
    width: 16px;
    height: 16px;
    accent-color: #3498db; /* צבע מודרני לצ'קבוקס */
}

/* קונטיינר להוספה ליומן */
.calendar-option {
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
    gap: 8px;
    margin-bottom: 10px;
    margin-top: 20px;
    white-space: nowrap;
}

.calendar-option input {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
}

/* כפתורים - עיצוב תלת-מימדי מודרני */
.btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    top: 0;
}

.btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f6391);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.6);
    top: -2px;
}

.btn:active {
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.2);
    top: 2px;
}

.logout-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #c0392b, #962d22);
}

.menu-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.menu-btn:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c757d);
}

/* תוצאות - עיצוב מודרני עם צל */
.result-section {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

#resultContainer {
    margin-top: 8px;
    font-weight: 500;
}

/* שגיאות - עיצוב בולט ומודרני */
.error {
    color: #e74c3c;
    text-align: center;
    margin-top: 5px;
    font-weight: 500;
    background: rgba(231, 76, 60, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
}

/* לוח שנה - עיצוב מודרני */
.date-picker {
    position: relative;
    display: inline-block;
    width: 100%;
}

.calendar {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    padding: 10px;
    z-index: 1000;
    width: 100%;
    min-width: 300px;
}

.calendar.active {
    display: block;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.month-year {
    font-weight: 500;
    color: #2c3e50;
}

.calendar button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    color: #3498db;
    transition: color 0.3s ease;
}

.calendar button:hover {
    color: #2980b9;
}

.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    text-align: center;
}

.day {
    padding: 6px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 35px;
}

.day:hover {
    background: rgba(52, 152, 219, 0.2);
}

.day.current {
    background: #3498db;
    color: #fff;
}

.day.selected {
    background: #2c3e50;
    color: #fff;
}

.day.other-month {
    color: #bdc3c7;
}

/* סגנון לימי פגרה */
.day.recess-day {
    background: #e74c3c; /* אדום בולט */
    color: #fff; /* תאריך בלבן */
}

/* סגנון לשישי ושבת */
.day.saturday, .day.friday {
    background: #8e44ad; /* סגול יפה */
    color: #fff;
}

/* סגנון לחגים עבריים */
.day.holiday-day {
    background: #f39c12; /* כתום */
    color: #fff;
}

/* סגנון לתווית שם החג */
.holiday-label {
    font-size: 0.6em;
    color: #2c3e50;
    position: absolute;
    bottom: -10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* סגנון למקרא */
.calendar-legend {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    font-size: 0.8em;
    color: #2c3e50;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-color.recess {
    background: #e74c3c;
}

.legend-color.holiday {
    background: #f39c12;
}

.legend-color.friday-saturday {
    background: #8e44ad;
}

.reset-date {
    display: block;
    margin: 8px auto 0;
    padding: 6px 12px;
    background: linear-gradient(135deg, #bdc3c7, #95a5a6);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.reset-date:hover {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* סגנון לחלון המודאלי - נוסף עבור submit_document.php */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 15px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    text-align: center;
    direction: rtl;
}

.modal-content h3 {
    margin-bottom: 15px;
}

.modal-content p {
    margin: 10px 0;
}

.modal-content button {
    margin: 8px;
    padding: 8px 15px;
    cursor: pointer;
}

.confirm-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
}

.cancel-btn {
    background-color: #f44336;
    color: white;
    border: none;
}

/* סגנון לכפתור הסרת נספח - נוסף עבור submit_document.php */
.remove-btn {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 5px 8px;
    margin: 5px;
    cursor: pointer;
}

/* סגנון לרשימת הנספחים עם גרירה ושחרור - נוסף עבור submit_document.php */
.appendix-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.appendix-list li {
    background: rgba(255, 255, 255, 0.7);
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: move;
    transition: background 0.3s ease;
}

.appendix-list li.dragging {
    opacity: 0.5;
    background: rgba(52, 152, 219, 0.2);
}

/* סגנונות לפרסומות (מוסתרות כברירת מחדל) */
.ad-container {
    display: block; /* שונה ל-block כדי שתראה את המיקומים */
    background-color: #ddd;
    text-align: center;
    padding: 10px;
    margin: 10px auto;
    border: 1px dashed #999;
    max-width: 450px;
}

.ad-container p {
    margin: 0;
    font-size: 14px;
    color: #555;
}

.ad-container.hidden {
    display: none; /* יופעל כשלא תרצה לראות את המיקומים */
}

.ad-side {
    display: none; /* מוסתר בטלפונים */
}

/* סגנונות לפס ההתקדמות */
.progress-bar {
    width: 100%;
    max-width: 300px;
    margin: 10px auto;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress {
    width: 0;
    height: 10px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    animation: progressAnimation 5s linear infinite;
}

@keyframes progressAnimation {
    0% { width: 0; }
    50% { width: 100%; }
    100% { width: 0; }
}

/* ודא ששום פס נוסף לא מופיע */
#modalContent p {
    margin: 10px 0;
}

/* סגנונות למחשבים (רוחב מסך מעל 768px) */
@media (min-width: 769px) {
    .container {
        max-width: 900px; /* רחב יותר למחשבים */
        margin: 50px auto;
        padding: 30px;
        padding-right: 0;
        padding-left: 30px;
    }

    .login-container {
        max-width: 500px;
        margin: 50px auto;
        padding: 30px;
    }

    h1 {
        font-size: 2.5em;
        margin-bottom: 30px;
    }

    h2 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    h3 {
        font-size: 1.4em;
        margin-bottom: 15px;
    }

    .user-info p {
        padding: 10px 20px;
        margin-bottom: 25px;
        font-size: 1.2em;
    }

    input, select {
        padding: 12px;
        margin-bottom: 20px;
        font-size: 1.1em;
    }

    .days-input-container {
        margin-bottom: 20px;
    }

    .checkbox-container {
        gap: 12px;
        margin-bottom: 50px;
    }

    .checkbox-container input {
        width: 20px;
        height: 20px;
    }

    .calendar-option {
        gap: 12px;
        margin-bottom: 20px;
        margin-top: 40px;
    }

    .calendar-option input {
        width: 20px;
        height: 20px;
    }

    .btn {
        width: 50%; /* כפתורים קטנים יותר במחשבים */
        margin: 10px auto;
        padding: 15px;
        font-size: 1.2em;
    }

    .result-section {
        margin-top: 25px;
        padding: 20px;
    }

    #resultContainer {
        margin-top: 15px;
        font-size: 1.1em;
    }

    .error {
        padding: 8px 15px;
        font-size: 1.1em;
    }

    .calendar {
        padding: 20px;
        min-width: 400px;
    }

    .calendar-header {
        margin-bottom: 20px;
    }

    .calendar button {
        font-size: 1.5em;
    }

    .days {
        gap: 10px;
    }

    .day {
        padding: 10px;
        height: 50px;
    }

    .calendar-legend {
        margin-top: 20px;
        gap: 15px;
        font-size: 1em;
    }

    .legend-color {
        width: 15px;
        height: 15px;
    }

    .reset-date {
        margin: 15px auto 0;
        padding: 10px 20px;
        font-size: 1em;
    }

    .modal-content {
        margin: 10% auto;
        padding: 25px;
        width: 60%;
        max-width: 600px;
    }

    .modal-content h3 {
        margin-bottom: 25px;
    }

    .modal-content button {
        margin: 15px;
        padding: 12px 25px;
    }

    .remove-btn {
        padding: 8px 12px;
    }

    .appendix-list {
        margin: 15px 0;
    }

    .appendix-list li {
        padding: 12px;
        margin-bottom: 8px;
    }

    /* פרסומת צדדית (רק במחשבים) */
    .ad-side {
        display: block;
        position: fixed;
        right: 20px;
        top: 100px;
        width: 160px;
        height: 600px;
        background-color: #ddd;
        border: 1px dashed #999;
        text-align: center;
        padding: 10px;
    }

    .ad-side p {
        font-size: 14px;
        color: #555;
    }

    .ad-container {
        max-width: 900px; /* התאמה למחשבים */
    }

    .progress-bar {
        max-width: 500px; /* פס התקדמות רחב יותר במחשבים */
    }
}

/* רספונסיביות לטאבלט (בין 481px ל-768px) */
@media (max-width: 768px) and (min-width: 481px) {
    .container, .login-container {
        margin: 20px;
        padding: 15px;
        max-width: 600px;
    }

    .btn {
        padding: 10px;
    }

    .calendar {
        min-width: 350px;
    }
}

/* רספונסיביות למובייל (עד 480px) */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.2em;
    }

    h3 {
        font-size: 1em;
    }

    input, select {
        padding: 8px;
    }

    .btn {
        padding: 8px;
    }

    .container, .login-container {
        margin: 10px;
        padding: 10px;
        max-width: 350px;
    }

    .calendar {
        min-width: 300px;
    }
}

/* סיום קובץ: styles.css */
/* הערות: נוספו סגנונות רספונסיביים למחשבים (min-width: 769px) עם פריסה מרווחת יותר. נוספו סגנונות לפרסומות (באנר עליון/תחתון ומודעה צדדית למחשבים). נוספו סגנונות לפס התקדמות עם אנימציה. */