/* עיצוב בסיסי מודרני, מותאם לאתר היכרויות במגזר הדתי */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f5f3f7;
    color: #1f2430;
    filter: var(--a11y-color-filter, none);
    transition: filter 0.2s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Skip link לנגישות מקלדת */
.skip-link {
    position: absolute;
    top: -48px;
    right: 12px;
    z-index: 9999;
    background: #111827;
    color: #ffffff;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.skip-link:focus {
    top: 12px;
}

.home-body {
    min-height: 100vh;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 5vw;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

/* המבורגר + נגישות באותה שורה; בדסקטופ שומרים סדר: לוגו → ניווט → כלי צד */
.header-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (min-width: 769px) {
    .main-header .logo {
        order: 1;
    }
    .main-header .main-nav {
        order: 2;
    }
    .main-header .header-tools {
        order: 3;
    }
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #ffffff;
    background: linear-gradient(135deg, #7b2c6b, #d946ef);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border-right: 4px solid rgba(255, 255, 255, 0.4);
}

.logo:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #6a2560, #c73dd9);
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 2rem;
    height: auto;
}

.logo-text {
    white-space: nowrap;
}

/* כפתור המבורגר – מוסתר בדסקטופ (ב־mobile מוצג ע"י media query) */
.nav-toggle {
    position: relative;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.nav-toggle:hover {
    background: rgba(123, 44, 107, 0.12);
    border-color: rgba(123, 44, 107, 0.5);
}
.nav-toggle-icon {
    width: 24px;
    height: 24px;
}
.nav-toggle-x {
    display: none !important;
}
body.nav-open .nav-toggle-bars {
    display: none !important;
}
body.nav-open .nav-toggle-x {
    display: block !important;
}

.main-nav {
    display: flex;
    gap: 1rem;
    font-size: 0.95rem;
}

.main-nav a {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.main-nav a:hover {
    background: rgba(123, 44, 107, 0.08);
}

.main-nav a.active {
    background: #7b2c6b;
    color: #ffffff;
}

/* שם בברכה (שלום, …) – בערך חצי מגודל טקסט הניווט; מינימום לקריאות */
.main-nav .nav-user-name {
    font-size: max(0.7rem, 0.5em);
    font-weight: 400;
}

/* פוקוס ברור למקלדת */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

/* נגישות */
.accessibility-widget {
    position: relative;
}

.accessibility-toggle {
    white-space: nowrap;
}

.accessibility-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 120;
    min-width: 260px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    padding: 0.8rem;
}

.accessibility-panel h3 {
    margin: 0 0 0.7rem;
    font-size: 0.95rem;
    color: #1f2937;
}

.accessibility-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

/* מצבי נגישות גלובליים */
body.a11y-high-contrast {
    background: #ffffff !important;
    color: #000000 !important;
}

body.a11y-high-contrast .main-header,
body.a11y-high-contrast .form-card,
body.a11y-high-contrast .table-card,
body.a11y-high-contrast .highlight-item,
body.a11y-high-contrast .hero-content {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
}

body.a11y-high-contrast .btn.primary {
    background: #000000 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

body.a11y-high-contrast .btn.secondary {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

body.a11y-underline-links a {
    text-decoration: underline !important;
}

body.a11y-readable-font {
    font-family: Arial, "Segoe UI", sans-serif !important;
}

body.a11y-low-vision {
    line-height: 1.7;
    letter-spacing: 0.01em;
}

body.a11y-low-vision .form-card,
body.a11y-low-vision .table-card,
body.a11y-low-vision .highlight-item,
body.a11y-low-vision .hero-content {
    border: 2px solid rgba(17, 24, 39, 0.25);
}

body.a11y-low-vision input,
body.a11y-low-vision select,
body.a11y-low-vision textarea,
body.a11y-low-vision .btn {
    min-height: 44px;
    font-size: 1rem;
}

body.a11y-color-blind .btn.primary,
body.a11y-color-blind .main-nav a.active,
body.a11y-color-blind .logo {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}

body.a11y-color-blind .btn.secondary.table-action.user-view-toggle.is-active {
    background: #1d4ed8 !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
}

body.a11y-color-blind .section-header--blue,
body.a11y-color-blind .alert.info {
    background: #f59e0b !important;
    color: #111827 !important;
    border-color: #b45309 !important;
}

body.a11y-color-blind .hero-content h1 {
    background: #1e40af !important;
    border-right-color: rgba(255, 255, 255, 0.65) !important;
}

/* מובייל – תפריט המבורגר */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex !important;
    }
    .main-header {
        flex-wrap: wrap;
    }
    .main-nav {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid rgba(15, 23, 42, 0.08);
    }
    .main-nav a,
    .main-nav > span {
        padding: 0.75rem 0.5rem;
        border-radius: 8px;
    }
    body.nav-open .main-nav {
        display: flex;
    }

    .accessibility-panel {
        left: auto;
        right: 0;
        width: min(calc(100vw - 2.5rem), 320px);
        min-width: 0;
    }
}

/* Hero section – רקע זוגות / אווירה חמה מתאימה לאתר היכרויות דתי */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 5vw 5rem;
    min-height: calc(100vh - 70px);
    background-color: #e8e0e8;
    /* תמונת רקע: זוג באווירה חמה (להחלפה: שים hero-bg.jpg בתיקייה assets/images/) */
    background-image: url("https://images.unsplash.com/photo-1522673607200-164d1b6ce486?auto=format&fit=crop&w=1920");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* שכבת כיסוי כהה מעל הרקע – שומרת על קריאות הטקסט */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(40, 28, 50, 0.5);
    opacity: 1;
}

.hero-overlay {
    display: block;
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(123, 44, 107, 0.2) 0%, rgba(50, 35, 70, 0.35) 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 680px;
    text-align: right;
    padding: 2.5rem 2.5rem 2.8rem;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 32px;
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(148, 163, 184, 0.15);
}

.hero-content h1 {
    margin: 0 0 1rem;
    font-size: clamp(1.9rem, 3vw, 2.4rem);
    color: #ffffff;
    background: linear-gradient(135deg, #7b2c6b, #d946ef);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    display: block;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-right: 4px solid rgba(255, 255, 255, 0.4);
}

.hero-content p {
    margin: 0 0 1.6rem;
    line-height: 1.7;
    color: #4b5563;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

.hero-note {
    font-size: 0.9rem;
    color: #6b7280;
    border-right: 3px solid #7b2c6b;
    padding-right: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn.table-action {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

/* View mode toggles above user tables (admin / matchmaker) — align with main nav link styling */
.btn.secondary.table-action.user-view-toggle {
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    min-height: 2.25rem;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn.secondary.table-action.user-view-toggle:not(.is-active) {
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    border-color: rgba(123, 44, 107, 0.12);
}

.btn.secondary.table-action.user-view-toggle:not(.is-active):hover {
    background: rgba(123, 44, 107, 0.08);
    color: #7b2c6b;
}

.btn.secondary.table-action.user-view-toggle.is-active {
    background: #7b2c6b;
    color: #ffffff;
    border-color: #7b2c6b;
}

.btn.secondary.table-action.user-view-toggle.is-active:hover {
    background: #6a2560;
    color: #ffffff;
}

.btn.primary {
    background: linear-gradient(135deg, #7b2c6b, #d946ef);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(148, 27, 118, 0.35);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(148, 27, 118, 0.4);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #7b2c6b;
    border: 1px solid rgba(123, 44, 107, 0.18);
}

.btn.secondary:hover {
    background: #fdf2ff;
}

.accessibility-actions .btn.is-active {
    background: #7b2c6b !important;
    color: #ffffff !important;
    border-color: #7b2c6b !important;
    box-shadow: 0 0 0 2px rgba(123, 44, 107, 0.2);
}

body.a11y-high-contrast .accessibility-actions .btn.is-active {
    background: #111827 !important;
    color: #ffffff !important;
    border: 3px solid #f59e0b !important;
    box-shadow: inset 0 0 0 2px #ffffff !important;
}

.btn.link {
    background: transparent;
    color: #6b21a8;
}

.btn.link:hover {
    text-decoration: underline;
}

/* Highlights */
.section-highlights {
    padding: 3rem 5vw 4rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.highlight-item {
    background: #ffffff;
    border-radius: 20px;
    padding: 1.6rem 1.4rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    border-inline-start: 4px solid rgba(123, 44, 107, 0.6);
}

.highlight-item h2 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    color: #111827;
}

.highlight-item p {
    margin: 0;
    color: #4b5563;
    font-size: 0.95rem;
}

/* Page layout */
.page-container {
    max-width: 960px;
    margin: 2.5rem auto 3rem;
    padding: 0 1.25rem;
}

.page-container h1 {
    margin-top: 0;
    margin-bottom: 0.3rem;
}

.page-subtitle {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #6b7280;
    font-size: 0.95rem;
}

/* כותרות קטעים (למשל: סנן לפי, רשימת משתמשים) */
.section-header {
    margin: 1.25rem 0 0.25rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.section-header--blue {
    background: #1d4ed8;
    color: #ffffff;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
}

/* דף איך זה עובד – מדריך מעוצב */
.page-guide .guide-intro {
    background: linear-gradient(135deg, rgba(123, 44, 107, 0.06), rgba(217, 70, 239, 0.05));
    border-right: 4px solid #7b2c6b;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.page-guide .guide-intro p {
    margin: 0 0 0.5rem;
    line-height: 1.6;
}

.page-guide .guide-intro p:last-child {
    margin-bottom: 0;
}

.page-guide .guide-list {
    list-style: none;
    padding-right: 0;
    counter-reset: guide-1;
}

.page-guide .guide-list > li {
    counter-increment: guide-1;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.page-guide .guide-list > li::before {
    content: counter(guide-1) ". ";
    font-weight: 700;
    color: #7b2c6b;
    margin-left: 0.25rem;
}

.page-guide .guide-list > li > strong {
    color: #1f2430;
}

.page-guide .guide-list > li > ol {
    list-style: none;
    padding-right: 1.5rem;
    margin: 0.75rem 0 0;
    counter-reset: guide-2;
}

.page-guide .guide-list ol ol {
    list-style: none;
    padding-right: 1.5rem;
    margin: 0.5rem 0 0;
    counter-reset: guide-3;
}

.page-guide .guide-list > li > ol > li {
    counter-increment: guide-2;
    margin-bottom: 0.6rem;
    position: relative;
    padding-right: 0.5rem;
}

.page-guide .guide-list > li > ol > li::before {
    content: counter(guide-1) "." counter(guide-2) " ";
    font-weight: 600;
    color: #5a1f4f;
    font-size: 0.9em;
}

.page-guide .guide-list > li > ol > li > ol {
    margin-top: 0.5rem;
    padding-right: 1rem;
}

.page-guide .guide-list > li > ol > li > ol > li {
    counter-increment: guide-3;
    margin-bottom: 0.4rem;
}

.page-guide .guide-list > li > ol > li > ol > li::before {
    content: counter(guide-1) "." counter(guide-2) "." counter(guide-3) " ";
    font-weight: 600;
    color: #7b2c6b;
    font-size: 0.88em;
}

.form-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 1.8rem 1.6rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.form-card.narrow {
    max-width: 420px;
    margin-inline: auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.9rem;
    color: #374151;
}

.form-group label.checkbox-terms-label {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.45;
    cursor: pointer;
}

.form-group label.checkbox-terms-label input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    accent-color: #7b2c6b;
}

.form-group label.checkbox-terms-label a {
    text-decoration: underline;
}

.form-group .input-row {
    display: flex;
    gap: 0.5rem;
}

.form-group .input-row input {
    flex: 1;
    min-width: 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    background: #f9fafb;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #7b2c6b;
    box-shadow: 0 0 0 1px rgba(123, 44, 107, 0.2);
    background: #ffffff;
}

.radio-group {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.multi-select-dropdown {
    position: relative;
}

.multi-select-toggle {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    background: #f9fafb;
    text-align: right;
    cursor: pointer;
}

.multi-select-toggle:focus-visible {
    outline: none;
    border-color: #7b2c6b;
    box-shadow: 0 0 0 1px rgba(123, 44, 107, 0.2);
    background: #ffffff;
}

.multi-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    z-index: 40;
    padding: 0.55rem 0.65rem;
}

.multi-select-hint {
    margin: 0 0 0.35rem 0;
    color: #6b7280;
    font-size: 0.8rem;
}

.multi-select-menu label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.2rem 0;
    cursor: pointer;
}

.multi-select-menu input[type="checkbox"] {
    margin: 0;
    accent-color: #7b2c6b;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.alert {
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

.alert.success {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.alert.info a {
    color: #1e40af;
    text-decoration: underline;
}

/* Tables */
.table-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 1.4rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    padding: 0.6rem 0.5rem;
    text-align: right;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.table-card table tbody tr:nth-child(odd) td {
    background: #ffffff;
}

.table-card table tbody tr:nth-child(even) td {
    background: #fef3c7; /* צהוב עדין */
}

.user-details-row {
    display: none;
    font-size: 0.85rem;
}

.user-table-card.full-view .user-details-row {
    display: table-row;
}

.empty-row {
    text-align: center;
    color: #6b7280;
}

.main-footer {
    margin-top: 2rem;
    padding: 1.2rem 5vw 1.8rem;
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
}

.main-footer .footer-link {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.main-footer .footer-link:hover,
.main-footer .footer-link:focus-visible {
    color: #7b2c6b;
    text-decoration-thickness: 2px;
}

/* Responsive */
@media (max-width: 900px) {
    .section-highlights {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero {
        padding-top: 5rem;
        padding-bottom: 3.2rem;
        align-items: flex-start;
    }

    .hero-content {
        padding: 1.8rem 1.5rem 2rem;
    }

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .main-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .hero-content h1 {
        font-size: 1.6rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

