/* responsive.css - כל ה-Media Queries + תיקונים (Mobile-First) */

/* ====== TABLET - 768px ומעלה ====== */
@media (min-width: 768px) {
    
    /* Header */
    .site-header {
        flex-direction: row;
        align-items: center;
        padding: 20px;
        text-align: right;
    }
    
    .logo-link {
        margin-bottom: 0;
        margin-right: 15px;
        margin-left: 15px;
    }
    
    .rabbi-image {
        width: 70px;
        height: 70px;
    }
    
    .header-content h1 {
        font-size: 1.5em;
    }
    
    .header-content p {
        font-size: var(--font-size-normal);
    }
    
    /* Navigation */
    .header-nav ul {
        flex-direction: row;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .header-nav li {
        font-size: 1.2em;
        white-space: nowrap;
    }
    
    /* Sidebar */
    .sidebar {
        padding: 20px;
    }
    
    .sidebar ul {
        grid-template-columns: 1fr 1fr; /* שתי עמודות בטאבלט */
        gap: 10px;
    }
    
    .sidebar ul li a {
        font-size: var(--font-size-small);
        padding: 10px 12px;
    }
    
    /* Video - תיקון כפתור השיתוף */
    .video-title-container {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 15px 20px;
        gap: 20px;
    }
    
    .video-title {
        text-align: right !important;
        font-size: var(--font-size-xlarge);
        flex: 1;
        margin: 0;
    }
    
    .share-button {
        width: auto !important;
        padding: 10px 15px;
        margin: 0;
        flex-shrink: 0;
    }
    
    .video-description {
        padding: 15px 20px;
		font-size: var(--font-size-xlarge);
        text-align: left;
    }
    
    /* Transcript */
    #transcriptContainer {
        padding: 25px;
        font-size: var(--font-size-xlarge);
    }
    
    /* Search Results */
    .searchResults {
        width: 350px;
        position: fixed;
        right: auto;
        left: 0;
    }
    
    .searchResults.show {
        transform: translateX(0);
    }
    
    /* התאמת margin לתוכן כשיש חיפוש פתוח */
    .searchResults.show ~ .container .content {
        margin-left: 350px;
        transition: margin-left var(--transition-normal);
    }
}

/* ====== DESKTOP - 1024px ומעלה ====== */
@media (min-width: 1024px) {
    
    /* Header - גדלי גופן משופרים */
    .site-header {
        padding: 25px;
    }
	
	.logo-link {
        margin-right: 20px;
        margin-left: 20px;
    }
    
    .rabbi-image {
        width: 90px;
        height: 90px;
    }
    
    .header-content h1 {
        font-size: 2.2em;
        margin-bottom: 15px;
    }
    
    .header-content p {
        font-size: 1.1em;
        line-height: 1.6;
        margin-bottom: 18px;
    }
    
    .header-nav li {
        font-size: 1em;
		font-weight: 600;
    }
    
    .header-nav a {
        font-size: 1em;
		font-weight: 600;
    }
    
    /* Layout מעבר לדסקטופ */
    .container {
        flex-direction: row;
        overflow: hidden;
    }
    
    /* Sidebar */
    .sidebar {
        width: var(--sidebar-width-desktop);
        min-width: var(--sidebar-width-desktop);
        height: 100vh;
        overflow-y: auto;
        order: 0; /* חזרה לסדר המקורי */
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    }
    
    .sidebar h2 {
        font-size: 1.7em;
        margin-bottom: 25px;
        padding-bottom: 10px;
        text-align: right;
    }
    
    .sidebar ul {
        grid-template-columns: 1fr; /* עמודה אחת בדסקטופ */
        gap: 10px;
    }
    
    .sidebar ul li a {
        text-align: right;
        font-size: 1em;
        padding: 14px 18px;
        line-height: 1.4;
        justify-content: flex-start;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .sidebar ul li a:hover,
    .sidebar ul li a:focus {
        transform: translateX(5px);
    }
    
    /* Content */
    .content {
        flex-grow: 1;
        padding: 20px;
        padding-bottom: 30px;
        overflow-y: auto;
        height: 100vh;
        order: 1;
    }
    
    /* Search */
    .search-container {
        margin-bottom: 30px;
        margin-top: 15px;
    }
    
    #searchBar {
        width: calc(100% - 24px);
        padding: 18px 25px;
        font-size: 1.1em;
        border-radius: 30px;
    }
    
    /* Video */
    #videoContainer {
        margin: 40px auto;
        max-width: 90%;
        box-shadow: var(--box-shadow-heavy);
        transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    }
    
    #videoContainer:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    }
    
    .video-title-container {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 20px 25px;
    }
    
    .video-title {
        font-size: 1.5em;
        text-align: right !important;
    }
    
    .share-button {
        font-size: 1em;
        padding: 12px 18px;
        transition: transform var(--transition-normal);
    }
    
    .share-button:hover {
        transform: translateX(5px);
    }
    
    .video-description {
        font-size: 1.5em;
        padding: 20px 25px;
    }
    
    /* Transcript */
    #transcriptContainer {
        font-size: 1.2em;
        line-height: 1.7;
        padding: 35px;
        margin-top: 30px;
    }
    
    #transcriptContainer h1 { font-size: 2em; }
    #transcriptContainer h2 { font-size: 1.7em; }
    #transcriptContainer h3 { font-size: 1.5em; }
    #transcriptContainer h4 { font-size: 1.3em; }
    #transcriptContainer p { font-size: 1.2em; }
    
    /* Search Results */
    .searchResults {
        width: var(--search-width-desktop);
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .searchResults h2 {
        text-align: right;
    }
    
    .search-results-count {
        text-align: right;
    }
    
    /* התאמת margin לתוכן */
    .searchResults.show ~ .container .content {
        margin-left: var(--search-width-desktop);
        transition: margin-left var(--transition-normal);
    }
    
    /* Scrollbar styling לדסקטופ */
    .sidebar::-webkit-scrollbar,
    .content::-webkit-scrollbar {
        width: 8px;
        display: block;
    }
    
    .sidebar::-webkit-scrollbar-track,
    .content::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .sidebar::-webkit-scrollbar-thumb,
    .content::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 4px;
    }
    
    .sidebar::-webkit-scrollbar-thumb:hover,
    .content::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }
    
    .sidebar,
    .content {
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
    }
}

/* ====== LARGE DESKTOP - 1440px ומעלה ====== */
@media (min-width: 1440px) {
    
    /* מגביל רוחב מקסימלי */
    .content {
        max-width: var(--container-max-width);
        margin: 0 auto;
        padding: 30px;
    }
    
    #videoContainer {
        max-width: 90%;
        margin: 40px auto;
    }
    
    #transcriptContainer {
        max-width: 90%;
        margin: 40px auto 0;
        padding: 40px;
        font-size: 1.3em;
    }
    
    /* גדלי גופן משופרים */
    .header-content h1 {
        font-size: 2.5em;
    }
    
    .header-content p {
        font-size: 1.2em;
    }
    
    .header-nav a {
        font-size: 1.1em;
    }
	
	.header-nav li {
		font-size: 1.1em;
	}
    
    .sidebar h2 {
        font-size: 1.8em;
    }
    
    .sidebar ul li a {
        font-size: 1.1em;
        padding: 16px 20px;
    }
    
    .video-title {
        font-size: 1.7em;
    }
	
	.video-description {
        font-size: 1.7em;
    }
    
    .share-button {
        font-size: 1.1em;
    }
    
    #searchBar {
        font-size: 1.2em;
    }
    
    .rabbi-image {
        width: 100px;
        height: 100px;
    }
}

/* ====== EXTRA LARGE DESKTOP - 1920px ומעלה ====== */
@media (min-width: 1920px) {
    
    .content {
        max-width: 90%;
    }
    
    #videoContainer {
        max-width: 1200px;
    }
    
    #transcriptContainer {
        max-width: 1200px;
        font-size: 1.4em;
    }
    
    /* גדלי גופן למסכים ענקיים */
    .header-content h1 {
        font-size: 2.8em;
    }
    
    .header-content p {
        font-size: 1.3em;
    }
    
    .header-nav a {
        font-size: 1.2em;
    }
	
	.header-nav li {
		font-size: 1.2em;
	}
    
    .sidebar {
        width: 350px;
        min-width: 350px;
    }
    
    .sidebar h2 {
        font-size: 2em;
    }
    
    .sidebar ul li a {
        font-size: 1.2em;
        padding: 18px 22px;
    }
    
    .video-title {
        font-size: 1.9em;
    }
    
    .share-button {
        font-size: 1.2em;
        padding: 14px 20px;
    }
    
    .rabbi-image {
        width: 110px;
        height: 110px;
    }
    
    .searchResults {
        width: 450px;
    }
    
    .searchResults.show ~ .container .content {
        margin-left: 450px;
    }
}

/* ====== LANDSCAPE MOBILE - גובה קטן ====== */
@media (max-height: 500px) and (orientation: landscape) {
    
    .site-header {
        padding: 10px 15px;
    }
    
    .header-content h1 {
        font-size: 1.1em;
        margin-bottom: 5px;
    }
    
    .header-content p {
        font-size: 0.8em;
        margin-bottom: 10px;
    }
    
    .rabbi-image {
        width: 50px;
        height: 50px;
    }
    
    .header-nav ul {
        gap: 5px;
    }
    
    .header-nav li {
        font-size: 0.75em;
    }
}

/* ====== HIGH DPI DISPLAYS ====== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* אופטימיזציות למסכי רטינה */
    .search-result-bullet {
        transform: scale(0.8);
    }
    
    .closeButton {
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
}

/* ====== PREFER DARK COLOR SCHEME ====== */
@media (prefers-color-scheme: dark) {
    /* תמיכה בסיסית בדארק מוד */
    .searchResults {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .search-result {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .no-results-message {
        background-color: #2d2d2d;
        color: #ffffff;
        border-color: #555;
    }
}

/* ====== PRINT STYLES ====== */
@media print {
    
    .site-header,
    .sidebar,
    .searchResults,
    .share-button,
    .video-wrapper,
    .closeButton {
        display: none !important;
    }
    
    .container {
        flex-direction: column;
    }
    
    .content {
        padding: 0;
        margin: 0;
        max-width: none;
        order: initial;
    }
    
    #transcriptContainer {
        box-shadow: none;
        background: white;
        padding: 20px 0;
        font-size: 12pt;
        line-height: 1.4;
        margin: 0;
    }
    
    .video-title {
        font-size: 16pt;
        margin-bottom: 10pt;
        color: black;
        text-align: right;
    }
    
    .video-description {
        font-size: 14pt;
        margin-bottom: 15pt;
        color: black;
        text-align: right;
    }
    
    /* הסתרת אלמנטים אינטראקטיביים */
    .search-container {
        display: none;
    }
    
    /* אופטימיזציה לדפוס */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a {
        color: black;
    }
    
    .highlight {
        background-color: #f0f0f0;
        color: black;
    }
}

/* כפתור עלון PDF - התאמות רספונסיביות */
@media (min-width: 768px) {
    .pdf-button {
        width: auto !important;
        margin-bottom: 0;
        margin-right: 10px;
        padding: 10px 15px;
        font-size: 0.9em;
    }
}

@media (min-width: 1024px) {
    .pdf-button {
        font-size: 1em;
        padding: 12px 18px;
    }
    
    .pdf-button:hover {
        transform: translateX(5px);
    }
}

@media (min-width: 1440px) {
    .pdf-button {
        font-size: 1.1em;
        padding: 14px 20px;
    }
}

@media (min-width: 1920px) {
    .pdf-button {
        font-size: 1.2em;
        padding: 16px 22px;
    }
}