/* base-styles.css - סגנונות בסיס וכלליים (Mobile-First בלבד) */

/* ====== CSS VARIABLES ====== */
:root {
    /* צבעים */
    --primary-color: #012E4A;
    --secondary-color: #036280;
    --header-color: #053959;
    --background-color: #E8EDE7;
    --text-color: #012E4A;
    --sidebar-bg: #F2F5F0;
    --transcript-bg: #F7F9F5;
    --hover-color: #81BECE;
    --accent-color: #475569;
    --focus-color: #0066cc;
    
    /* גדלים */
    --header-padding: 15px;
    --content-padding: 15px;
    --sidebar-width-desktop: 300px;
    --search-width-desktop: 400px;
    --container-max-width: 1200px;
    --border-radius: 8px;
    --video-aspect-ratio: 56.25%; /* 16:9 */
    
    /* צללים */
    --box-shadow-light: 0 2px 4px rgba(0,0,0,0.08);
    --box-shadow-medium: 0 4px 8px rgba(0,0,0,0.12);
    --box-shadow-heavy: 0 8px 15px rgba(0,0,0,0.2);
    
    /* מעברים */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* גדלי טקסט */
    --font-size-small: 0.85em;
    --font-size-normal: 1em;
    --font-size-large: 1.1em;
    --font-size-xlarge: 1.2em;
    
    /* נגישות */
    --touch-target-size: 48px;
    --focus-outline-width: 2px;
}

/* ====== RESET ====== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ====== BODY וגופנים ====== */
body {
    font-family: 'Assistant', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    direction: rtl;
    overflow-x: hidden;
}

/* ====== כותרות ====== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Assistant', sans-serif;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    line-height: 1.3;
}

h1 { font-size: 1.3em; font-weight: 600; }
h2 { font-size: 1.2em; font-weight: 600; }
h3 { font-size: 1.1em; font-weight: 500; }
h4 { font-size: 1.05em; font-weight: 500; }

/* ====== פסקאות ====== */
p {
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 400;
    margin-bottom: 1em;
}

/* ====== קישורים ====== */
a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover, a:focus {
    color: var(--hover-color);
}

/* ====== כפתורים כלליים ====== */
button {
    font-family: 'Assistant', sans-serif;
    cursor: pointer;
    border: none;
    transition: all var(--transition-normal);
    min-height: var(--touch-target-size);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

button:hover, button:focus {
    transform: translateY(-2px);
}

/* ====== שדות טופס ====== */
input, textarea, select {
    font-family: 'Assistant', sans-serif;
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius);
    transition: all var(--transition-normal);
    font-size: var(--font-size-normal);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.3);
}

/* ====== רשימות ====== */
ul, ol {
    list-style-type: none;
    padding: 0;
}

/* ====== תמונות ====== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ====== LAYOUT COMPONENTS (Mobile-First בלבד) ====== */

/* Header */
.site-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--header-padding);
    background-color: var(--header-color);
    color: white;
    text-align: center;
}

.logo-link {
    display: inline-block;
    margin-right: 20px;
    margin-left: 20px;
    text-decoration: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 50%;
    outline: none !important;
}

.logo-link:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.logo-link:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px var(--hover-color);
}

.logo-link:active {
    transform: scale(0.98);
}

/* הסרת outline ברירת מחדל */
.logo-link:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px var(--hover-color);
}

.rabbi-image {
    width: 60px;  /* התחל מ-60px במובייל */
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
    object-fit: cover;
    object-position: center;
}

.header-content {
    flex-grow: 1;
}

.header-content h1 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    line-height: 1.3;
}

.header-content p {
    font-family: 'Assistant', sans-serif;
    margin: 0 0 15px 0;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Navigation */
.header-nav ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-nav li {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color var(--transition-normal);
}

.header-nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color var(--transition-normal);
}

.header-nav a:hover, .header-nav a:focus {
    color: var(--hover-color);
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Content */
.content {
    flex-grow: 1;
    padding: var(--content-padding);
    background-color: white;
    order: 1;
    overflow-y: auto;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: var(--content-padding);
    box-shadow: var(--box-shadow-medium);
    order: 2;
}

.sidebar h2 {
    font-size: var(--font-size-xlarge);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--secondary-color);
    text-align: center;
}

.sidebar ul {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.sidebar ul li a {
    text-decoration: none;
    color: white;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.9em;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    min-height: var(--touch-target-size);
}

.sidebar ul li a:hover, 
.sidebar ul li a:focus {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
    box-shadow: var(--box-shadow-light);
}

/* Search */
.search-container {
    margin-bottom: 20px;
    margin-top: 10px;
}

#searchBar {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--accent-color);
    border-radius: 25px;
    font-size: var(--font-size-normal);
    font-family: 'Assistant', sans-serif;
    box-sizing: border-box;
}

#searchBar:focus {
    border-color: var(--secondary-color);
}

/* Video Container */
#videoContainer {
    margin: 20px 0;
    background-color: #f0f4f8;
    border-radius: 12px;
    box-shadow: var(--box-shadow-light);
    overflow: hidden;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: var(--video-aspect-ratio);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-title-container {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    gap: 10px;
}

.video-title {
    margin: 0;
    font-size: var(--font-size-large);
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1.4;
    text-align: center;
}

.share-button {
    background-color: var(--transcript-bg);
    color: var(--primary-color);
    border: 1px solid rgba(1, 46, 74, 0.2);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-family: 'Assistant', sans-serif;
    font-size: 0.95em;
    font-weight: 500;
    width: 100%;
    min-height: var(--touch-target-size);
    gap: 8px;
    white-space: nowrap;
    min-width: fit-content;
}

.share-button:hover, .share-button:focus {
    background-color: var(--sidebar-bg);
    box-shadow: var(--box-shadow-medium);
}

.video-description {
    padding: 15px;
    font-size: var(--font-size-normal);
    font-weight: bold;
    color: var(--secondary-color);
    text-align: center;
    background-color: #fff;
}

/* Transcript */
#transcriptContainer {
    background-color: var(--transcript-bg);
    padding: 20px;
    border-radius: 15px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    font-size: var(--font-size-large);
    line-height: 1.6;
    margin-top: 20px;
    margin-bottom: 0;
}

/* Search Results */
.searchResults {
    width: 100%;
    background-color: var(--sidebar-bg);
    padding: 15px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
    z-index: 1000;
}

.searchResults.show {
    transform: translateX(0);
}

.searchResults h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-size: var(--font-size-xlarge);
    text-align: center;
}

.search-results-count {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
    text-align: center;
    font-style: italic;
}

.search-result {
    background: white;
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 15px;
    border-right: 4px solid var(--secondary-color);
    box-shadow: var(--box-shadow-light);
    transition: all var(--transition-normal);
    cursor: pointer;
    min-height: var(--touch-target-size);
}

.search-result:hover, .search-result:focus {
    background: #f8fffe;
    box-shadow: var(--box-shadow-medium);
    transform: scale(1.02);
}

.search-result-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: var(--font-size-normal);
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.3;
}

.search-result-bullet {
    width: 8px;
    height: 8px;
    background: var(--secondary-color);
    border-radius: 50%;
    flex-shrink: 0;
}

.search-result-content {
    margin-right: 18px;
    font-size: 0.9em;
    line-height: 1.5;
    color: #555;
    font-family: 'Frank Ruhl Libre', serif;
}

.search-result-content .highlight,
.search-result-title .highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.closeButton {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: var(--font-size-normal);
    font-weight: 600;
    min-height: var(--touch-target-size);
    min-width: var(--touch-target-size);
}

.closeButton:hover, .closeButton:focus {
    background-color: var(--hover-color);
}

/* Messages */
.no-results-message {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    border: 2px dashed #ddd;
}

.loading-indicator {
    text-align: center;
    color: var(--primary-color);
    margin-top: 20px;
    font-weight: 600;
    font-size: var(--font-size-large);
}

.loading-indicator::after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

/* Share Notification */
.share-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--secondary-color);
    color: white;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-medium);
    z-index: 10000;
    font-family: 'Assistant', sans-serif;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-20px);
    transition: all var(--transition-normal);
    pointer-events: none;
    max-width: 280px;
    font-size: var(--font-size-small);
    line-height: 1.4;
}

.share-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* ====== נגישות ====== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

*:focus-visible {
    outline: var(--focus-outline-width) solid var(--focus-color);
    outline-offset: 2px;
}

/* הפחתת אנימציות למי שצריך */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ====== אנימציות ====== */
@keyframes loading-dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* ====== Utility Classes ====== */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-column { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.gap-small { gap: 10px; }
.gap-medium { gap: 20px; }
.gap-large { gap: 30px; }

.hidden { display: none; }
.visible { display: block; }

.order-first { order: -1; }
.order-last { order: 999; }

.margin-bottom-small { margin-bottom: 10px; }
.margin-bottom-medium { margin-bottom: 20px; }
.margin-bottom-large { margin-bottom: 30px; }

.padding-small { padding: 10px; }
.padding-medium { padding: 20px; }
.padding-large { padding: 30px; }

.highlight {
    background-color: #fef3c7;
    padding: 1px 2px;
    border-radius: 2px;
}

/* הסתרת scrollbar במובייל */
.sidebar::-webkit-scrollbar,
.content::-webkit-scrollbar,
.searchResults::-webkit-scrollbar {
    display: none;
}

.sidebar,
.content,
.searchResults {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* כפתור עלון PDF - סגנונות בסיס (מובייל) */
.pdf-button {
    background-color: var(--accent-color) !important;
    color: white !important;
    border: 1px solid rgba(71, 85, 105, 0.2);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-normal);
    border-radius: var(--border-radius);
    font-family: 'Assistant', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    min-width: fit-content;
    width: 100%;
    margin-bottom: 5px;
    justify-content: center;
    padding: 12px 20px;
    font-size: 0.95em;
    min-height: var(--touch-target-size);
}

.pdf-button:hover,
.pdf-button:focus {
    background-color: var(--primary-color) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-medium);
}