@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;700;800&display=swap');

:root {
    --primary-color: #0d6efd;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --text-color: #6c757d;
}

body {
    font-family: 'Heebo', sans-serif;
    margin: 0;
    direction: rtl;
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo a { display: flex; align-items: center; }
.logo img { height: 60px; }
.nav-button {
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: opacity 0.3s;
    margin-left: 0.5rem;
}
.nav-button.secondary { background-color: #6c757d; }
.nav-button:hover { opacity: 0.9; }

/* Content Sections */
.content-section { padding: 4rem 0; }
.content-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 3rem;
    color: var(--dark-color);
}

/* Courses Grid */
.courses-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.course-card {
    background-color: white; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex; flex-direction: column; text-decoration: none; color: inherit;
}
.course-image-container { position: relative; height: 200px; background-color: #fff; border-bottom: 1px solid #eee; }
.course-image-container img { width: 100%; height: 100%; object-fit: cover; }
.play-icon {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 4rem; color: rgba(255, 255, 255, 0.8);
    pointer-events: none; transition: transform 0.3s, color 0.3s;
}
.course-image-container:hover .play-icon { transform: translate(-50%, -50%) scale(1.1); color: #fff; }
.course-image-container.has-video { cursor: pointer; }
.course-card-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.course-card-content h3 { margin-top: 0; font-size: 1.25rem; }
.course-card-content p { color: var(--text-color); flex-grow: 1; margin-bottom: 1.5rem; }
.course-pricing { margin-bottom: 1.5rem; }
.price { font-weight: bold; color: var(--dark-color); font-size: 1.2rem; }
.price .sale { color: #198754; margin-right: 0.5rem; }
.price .original { text-decoration: line-through; color: var(--text-color); font-size: 1rem; }
.details-button {
    display: block; background-color: var(--primary-color); color: #fff; text-align: center; padding: 0.75rem;
    border-radius: 5px; text-decoration: none; font-weight: 500; margin-top: auto;
}

/* Video Modal */
.video-modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto; background-color: rgba(0,0,0,0.8);
}
.video-modal-content { position: relative; margin: 5% auto; padding: 20px; width: 90%; max-width: 800px; }
.video-modal .close-btn {
    position: absolute; top: -15px; right: -15px; color: #fff; font-size: 40px;
    font-weight: bold; cursor: pointer;
}
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* TV Component Styles */
.tv-wrapper {
    display: flex;
    direction: rtl; 
    gap: 20px;
    width: 100%;
    margin: 0 auto;
    align-items: flex-start;
}

.tv-container {
    flex-grow: 1;
    min-width: 0;
    padding: 20px;
    background-color: #4a4a4a;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 2px 5px rgba(255,255,255,0.2);
    border: 3px solid #333;
}

.tv-screen {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background-color: #000;
    border-radius: 5px;
    border: 2px solid #111;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}

.tv-screen iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tv-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px 5px 10px;
    color: #f0f2f5;
}
.tv-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tv-btn:hover { background-color: #5a6268; }
.tv-btn:disabled { background-color: #333; opacity: 0.5; cursor: not-allowed; }
#channel-display {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

/* TV Remote Styles */
.tv-remote {
    flex-basis: 300px;
    flex-shrink: 1;
    background-color: #333;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2), inset 0 1px 2px rgba(255,255,255,0.2);
    border: 2px solid #222;
    padding: 20px;
    height: 500px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tv-remote h3 {
    margin-top: 0;
    border-bottom: 2px solid #555;
    padding-bottom: 10px;
    font-size: 1.3rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; 
}

/* Scrollable list with hidden scrollbar */
#channel-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding-right: 5px;
    flex-grow: 1;
    min-height: 0;

    /* Hide scrollbar — Firefox + Edge + Chrome/Safari */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#channel-list::-webkit-scrollbar {
    display: none;
}

#channel-list li {
    padding: 12px 10px;
    cursor: pointer;
    border: 1px solid #666;
    background-color: #555;
    color: #fff;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.2s;
    border-radius: 8px;
    box-shadow: 0 2px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}
#channel-list li:hover { background-color: #666; }
#channel-list li.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0b5ed7;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
#channel-list li:before { content: none; }

/* Footer Styles */
.main-footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 2rem 0;
    margin-top: 2rem;
}
.main-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-links a {
    color: #fff;
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color 0.3s;
}
.footer-links a:hover { color: #aaa; }
.footer-copyright p {
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .courses-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .tv-wrapper {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .tv-remote {
        height: 300px;
        flex-basis: auto;
    }
}

@media (max-width: 768px) {
    .courses-grid {
        display: grid;
        grid-template-columns: 1fr;
    }
}


/* =========================================
   תוספת עבור אנימציית טקסט רץ במובייל - גרסה מתוקנת
   ========================================= */

/* הגדרת התנועה: מתחילים מצד שמאל וזזים ימינה */
@keyframes ticker-scroll-right {
    0% { transform: translateX(-150%); } /* מתחיל מחוץ לגבול השמאלי */
    100% { transform: translateX(100%); } /* מסיים מחוץ לגבול הימני */
}

@media (max-width: 900px) {
    /* נגדיר את הקונטיינר כדי שהטקסט לא יעלים את הכפתורים אלא ירוץ ביניהם */
    .tv-controls {
        overflow: hidden; 
        position: relative;
        display: flex;
        justify-content: space-between; 
        gap: 10px; /* רווח קטן כדי שהטקסט לא יידבק לכפתורים */
    }

    /* עיצוב הטקסט עצמו במצב מובייל */
    #channel-display {
        display: inline-block;
        white-space: nowrap;        /* מונע ירידת שורה */
        overflow: visible;          
        
        /* הפעלת האנימציה: */
        /* infinite = דואג שזה ירוץ בלופ ולא יעצור אחרי פעם אחת */
        /* linear = דואג שהמהירות תהיה אחידה */
        animation: ticker-scroll-right 10s linear infinite; 
        
        flex-grow: 1;
        text-align: center;
    }
}