/* 
 * סגנונות ראשיים לאתר "דרכו של זה"
 * עיצוב מינימליסטי בהשראת ZEN
 * גרסה מתוקנת לוולידטור CSS שמרני
 */

/* איפוס וערכים בסיסיים */
* {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.6;
    color: rgb(10, 70, 70);
    overflow-x: hidden;
}

body {
    background-color: #F9F6F0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 130px); 
    padding: 0;
    overflow: visible;
    min-height: 600px;
    padding-bottom: 20px; /* הוסף מרווח לפוטר */
}

main .container {
    height: 100%;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* קישורים וכפתורים */
/* החלת הצבע על כפתורי הניווט */
.nav-button {
    color: rgb(10, 70, 70);
    border-color: rgb(10, 70, 70);
}

a {
    color: rgb(10, 70, 70);
    text-decoration: none;
    -webkit-transition: color 0.3s ease;
    -moz-transition: color 0.3s ease;
    -o-transition: color 0.3s ease;
    transition: color 0.3s ease;
}

a:hover {
    color: rgba(10, 70, 70, 0.8);
}

/* כותרות */
h1, h2, h3, h4, h5, h6 {
    color: rgb(10, 70, 70);
}

/* אלמנטי טקסט */
.total-pages {
    color: rgb(10, 70, 70);
}

/* תפריט ניווט וקישורים */
.main-menu a, .footer-links a {
    color: rgb(10, 70, 70);
}

.page-indicator input {
    color: rgb(10, 70, 70);
}

button, .button, input[type="submit"] {
    cursor: pointer;
    border: none;
    padding: 0.625rem 0.9375rem;
    border-radius: 0.25rem;
    -webkit-transition: background-color 0.3s ease, transform 0.2s ease;
    -moz-transition: background-color 0.3s ease, transform 0.2s ease;
    -o-transition: background-color 0.3s ease, transform 0.2s ease;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover, .button:hover, input[type="submit"]:hover {
    -webkit-transform: translateY(-0.125rem);
    -moz-transform: translateY(-0.125rem);
    -ms-transform: translateY(-0.125rem);
    -o-transform: translateY(-0.125rem);
    transform: translateY(-0.125rem);
}

button:active, .button:active, input[type="submit"]:active {
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translateY(0);
}

.primary-button {
    background-color: transparent;
    color: rgb(10, 70, 70);
    border: 1px solid rgba(10, 70, 70, 0.7);
    padding: 8px 16px;
    font-size: 1rem;
    font-family: 'Times New Roman', serif;
    cursor: pointer;
    min-width: 100px;
    height: auto;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    display: inline-block;
    text-align: center;
    font-weight: bold;
    position: relative;
    z-index: 102;
    pointer-events: auto;
}

.primary-button:hover {
    background-color: rgba(249, 246, 240, 0.7);
    color: rgba(10, 70, 70, 0.7);
    border-color: rgb(10, 70, 70);
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    -o-transform: translateY(-2px);
    transform: translateY(-2px);
}

.secondary-button {
    background-color: #6c6c6c;
    color: white;
}

.secondary-button:hover {
    background-color: #9c9c9c;
}


/* כותרת עליונה */
header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    height: 100%;
}

header .container {
    position: relative;
    height: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* לוגו */
.logo {
    position: absolute;
    left: 5%;
    top: 0;
    z-index: 10;
}

.logo img {
    height: 175px;
    background-color: transparent !important;
    opacity: 1; /* במקום mix-blend-mode */
}

/* תפריט ניווט */
nav {
    position: absolute;
    right: 5%;
    top: 15px;
    display: flex;
    align-items: center;
}

/* תפריט ראשי */
.main-menu {
    list-style: none;
    display: flex;
    margin-left: 1.25rem;
}

.main-menu li {
    margin-left: 0.9375rem;
}

/* בורר שפה */
.language-selector {
    margin-right: 15px;
}

/* בורר מגדר */
.gender-selector-icons {
    margin-right: 0px;
}

.language-selector .current-language {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.3125rem 0;
    border: none;
    background: none;
}

.language-selector .current-language::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.375rem;
    border-left: 0.3125rem solid transparent;
    border-right: 0.3125rem solid transparent;
    border-top: 0.3125rem solid rgb(10, 70, 70);
}

.current-language img {
    width: 1.25rem;
    margin-right: 0.3125rem;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 7.5rem;
    background-color: #F9F6F0;
    border: 1px solid #e0e0e0;
    -webkit-box-shadow: 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.1);
    box-shadow: 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
    padding: 0.3125rem 0;
}

.language-selector:hover .language-dropdown {
    display: block;
}

.language-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.language-dropdown li {
    padding: 0.3125rem 0.625rem;
}

.language-dropdown li:hover {
    background-color: #f0ece4;
}

.language-dropdown a {
    display: flex;
    align-items: center;
}

.language-dropdown img {
    width: 1.25rem;
    margin-right: 0.3125rem;
}

.gender-icon {
    cursor: pointer;
    -webkit-transition: opacity 0.3s ease;
    -moz-transition: opacity 0.3s ease;
    -o-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
    vertical-align: middle;
}

.gender-icon:first-child {
    margin-right: 0.375rem;
}

.gender-icon:not(.active) {
    opacity: 0.5;
}

.gender-icon:hover {
    opacity: 0.8;
}

.gender-icon.active:hover {
    opacity: 1;
}

/* סידור האלמנטים בשורה אחת */
.language-selector, .gender-selector-icons, .main-menu {
    display: flex;
    align-items: center;
}

/* יישור האייקונים */
.gender-icon[alt="Male"] {
    width: 1.125rem;
    height: 1.1875rem;
}

.gender-icon[alt="Female"] {
    width: 0.875rem;
    height: 1.3125rem;
}

/* כותרת תחתונה */
footer {
    position: fixed;
    bottom: 0.3125rem;
    left: 0;
    right: 0;
    width: 100%;
    background: transparent;
    z-index: 100;
    padding: 0.625rem 0;
    pointer-events: none; /* הוסף זה */
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 5%;
    pointer-events: auto; /* אפשר קליקים רק על התוכן */
}

.copyright {
    font-size: 0.875rem;
    color: rgb(10, 70, 70);
    text-align: left;
    text-transform: capitalize;
}


/* מרווח עליון לדף זכויות היוצרים */
.copyright-page {
    margin-top: 100px; /* מרווח מהחלק העליון של הדף */
    padding: 20px;     /* ריפוד פנימי לתוכן */
}

/* סגנון נוסף לתוכן כדי שייראה טוב יותר */
.copyright-content {
    max-width: 800px;  /* הגבלת רוחב מקסימלי */
    margin: 0 auto;    /* מרכוז אופקי */
    line-height: 1.5;  /* מרווח בין שורות */
}

.footer-links {
    text-align: right;
}

.footer-links a {
    margin-left: 0.9375rem;
    font-size: 0.875rem;
    color: rgb(10, 70, 70);
}

.footer-links a:hover {
    color: rgba(10, 70, 70, 0.8);
}

/* טפסים */
form {
    margin: 1.25rem 0;
}

.form-group {
    margin-bottom: 0.9375rem;
}

label {
    display: block;
    margin-bottom: 0.3125rem;
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.25rem;
    font-family: 'Times New Roman', serif;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #9c9c9c;
}

.form-help {
    font-size: 0.9em;
    color: #6c6c6c;
    margin-top: 0.3125rem;
}

/* סגנון לעמודי פרטיות */
.privacy-policy-container, 
.privacy-center-container,
.copyright-page {
    margin-top: 150px;
    margin-bottom: 100px;
    padding: 20px;
    max-width: 1000px;
    max-height: 60vh; /* הגבלת הגובה ל-60% מגובה החלון */
    overflow-y: auto; /* הוספת סרגל גלילה אנכי כשנדרש */
    margin-left: auto;
    margin-right: auto;
    border: 1px solid #e0e0e0; /* מסגרת עדינה להדגשת הגבולות */
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.5); /* רקע קלות שקוף */
}

/* פופ-אפ */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: red;
    padding: 1.875rem;
    border-radius: 0.25rem;
    width: 90%;
    max-width: 31.25rem;
    position: relative;
    overflow: visible !important; /* במקום auto */
    max-height: none !important; /* במקום הגבלת גובה */
    overflow-y: visible !important; /* למקרה ש-overflow-y מוגדר בנפרד */
}

.close-popup {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    font-size: 1.5em;
    cursor: pointer;
}


/* הודעות */
.error-message,
.success-message {
    padding: 0.9375rem;
    margin-bottom: 0.9375rem;
    border-radius: 0.25rem;
}

.error-message {
    color: #F44336;
    background-color: rgba(244, 67, 54, 0.1);
    border-left: 0.1875rem solid #F44336;
}

.success-message {
    color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 0.1875rem solid #4CAF50;
}

/* מדיה קוורי */
@media screen and (max-width: 48rem) { /* 768px */
    html {
        font-size: 14px;
    }
    
    header {
        padding: 0.9375rem 0;
    }
    
    header .container {
        flex-direction: column;
        height: auto;
        padding-bottom: 1.25rem;
    }
    
    .logo {
        margin: 0 auto 1.25rem auto;
    }
    
    nav {
        margin: 0.9375rem auto 0 auto;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .language-selector,
    .gender-selector-icons,
    .main-menu {
        margin: 0 0.9375rem;
    }
    
    /* סדר האלמנטים */
    .language-selector {
        -webkit-order: 1;
        -ms-order: 1;
        order: 1;
    }
    
    .gender-selector-icons {
        -webkit-order: 2;
        -ms-order: 2;
        order: 2;
    }
    
    .main-menu {
        -webkit-order: 3;
        -ms-order: 3;
        order: 3;
        margin-top: 0.9375rem;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 0.625rem;
    }
    
    .copyright,
    .footer-links {
        text-align: center;
    }
    
    .popup-content {
        padding: 1.25rem;
    }
}

@media screen and (max-width: 30rem) { /* 480px */
    .logo img {
        height: 7.5rem;
    }
    
    .footer-links a {
        margin: 0 0.5rem;
    }
}

/* עבור כפתור הורדה - תיקונים ספציפיים */
.book-actions {
    position: relative;
    z-index: 101;
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 0.5rem auto 1rem auto;
    pointer-events: auto;
}

.action-button {
    background-color: rgb(249, 246, 240); /* רקע שקוף */
    color: rgb(10, 70, 70); /* טקסט בצבע טורקיז */
    border: 1px solid rgba(10, 70, 70, 0.7); /* מסגרת בצבע טורקיז עם שקיפות קלה */
    padding: 8px 16px;
    font-size: 1rem;
    font-family: 'Times New Roman', serif;
    cursor: pointer;
    min-width: 180px;
    height: auto;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    border-radius: 0.5rem; /* פינות מעוגלות יותר */
    display: inline-block;
    text-align: center;
    font-weight: bold;
    position: relative;
    z-index: 102;
    pointer-events: auto;
}

.action-button:hover {
    background-color: rgba(249, 246, 240, 0.7); /* רקע קרם עם שקיפות */
    color: rgba(10, 70, 70, 0.7); /* טקסט טורקיז מעומעם */
    border-color: rgb(10, 70, 70); /* מסגרת בצבע טורקיז מלא */
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    -o-transform: translateY(-2px);
    transform: translateY(-2px);
}

.action-button:active {
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translateY(0);
}

#download-form .button-container {
    display: flex;
    justify-content: flex-end; /* ימין ב-LTR */
    margin-top: 20px;
}

.rtl #download-form .button-container {
    justify-content: flex-start; /* שמאל ב-RTL */
}

#download-form button[type="submit"] {
    float: right; /* ימין ב-LTR */
}

.rtl #download-form button[type="submit"] {
    float: left; /* שמאל ב-RTL */
}

/* ספציפיות גבוהה יותר למיקום X */
html[dir="rtl"] .popup .close-popup,
body.rtl .popup .close-popup,
.rtl .popup .close-popup {
    right: auto !important;
    left: 0.625rem !important;
}

/* ספציפיות גבוהה יותר למיקום כפתור */
html[dir="rtl"] #download-form button[type="submit"],
body.rtl #download-form button[type="submit"],
.rtl #download-form button[type="submit"] {
    float: left !important;
    margin-right: auto !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .button-container,
body.rtl .button-container,
.rtl .button-container {
    justify-content: flex-start !important;
    text-align: left !important;
}

/* עיצוב ספציפי לכפתור ההורדה - להוסיף בסוף קובץ style.css */
.book-display-container .book-actions div .action-button,
#download-book {
    background-color: rgb(249, 246, 240);
    color: rgb(10, 70, 70);
    border: 1px solid rgba(10, 70, 70, 0.7);
    padding: 8px 16px;
    font-size: 1rem;
    font-family: 'Times New Roman', serif;
    cursor: pointer;
    min-width: 180px;
    height: auto;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    display: inline-block;
    text-align: center;
    font-weight: bold;
    position: relative;
    z-index: 102;
}

.book-display-container .book-actions div .action-button:hover,
#download-book:hover {
    background-color: rgba(249, 246, 240, 0.7);
    color: rgba(10, 70, 70, 0.7);
    border-color: rgb(10, 70, 70);
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    -o-transform: translateY(-2px);
    transform: translateY(-2px);
}

/* סגנונות לטופס הורדה */
.form-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.form-column {
    flex: 1;
}

.form-column .form-group {
    margin-bottom: 0;
}
