/* Global variables for theme colors */
:root {
    --primary: #27ae60;
    --secondary: #3498db;
    --accent: #e67e22;
    --text: #2c3e50;
    --light-bg: #f4f7f6;
}

/* Base body styling */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    background-color: #e9ecef;
    color: var(--text);
    margin: 0;
    padding: 20px;
}

/* Bi-directional text support */
html[dir="rtl"] body { text-align: right; }
html[dir="ltr"] body { text-align: left; }

/* Main content wrapper */
.container {
    max-width: 900px;
    margin: auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

header {
    text-align: center;
    border-bottom: 3px solid var(--primary);
    margin-bottom: 30px;
    padding-bottom: 20px;
}

h1 { color: var(--primary); }
.subtitle { font-size: 1.2em; color: var(--secondary); font-weight: bold; }

.intro-section {
    background: var(--light-bg);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border-inline-start: 5px solid var(--accent);
}

/* Lesson list styling */
.lesson-item {
    background: white;
    border: 2px solid #eee;
    margin-bottom: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    padding: 20px;
}

/* Ensure number and text stay on the same line */
.lesson-item > div:first-child {
    display: flex;
    align-items: center;
    flex-wrap: nowrap; /* Prevents text from wrapping to a new line */
}

.lesson-number {
    background: var(--secondary);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-end: 10px;
    flex-shrink: 0; /* Prevents the circle from squeezing */
}

/* Characters section styling for desktop */
.characters-section {
    display: flex;
    align-items: center;
    gap: 40px;
    margin: 40px 0;
    padding: 40px;
    border-radius: 30px;
    background: linear-gradient(135deg, #f0f4ff 0%, #f9f0ff 100%);
}

.characters-section > div:first-child {
    flex: 0 0 45%;
}

.characters-section > div:last-child {
    flex: 1;
}

.char-img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.char-card {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 12px;
    border-inline-start: 5px solid #00a1ff;
    text-align: start;
}

/* ========== Mobile Responsive Fixes ========== */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        /* The 5% margin is controlled here by the second padding value */
        padding: 20px 5%; 
        border-radius: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .characters-section {
        flex-direction: column;
        padding: 20px 0;
        margin: 20px 0;
        gap: 20px;
    }

    .characters-section > div:first-child,
    .characters-section > div:last-child {
        width: 100%;
    }

    .char-img {
        width: 100%;
        border-radius: 10px;
    }

    .char-card {
        margin-inline: 0;
        width: 100%;
        box-sizing: border-box;
    }

    /* Fix for lesson list item overflow/wrapping */
    .lesson-item {
        padding: 15px 10px;
    }
    
    .lesson-item a {
        white-space: nowrap; /* Forces text to stay on one line */
        overflow: hidden;
        text-overflow: ellipsis; /* Adds dots if text is too long */
        max-width: 200px;
    }
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #ffffff;
    color: var(--secondary);
    border: 2px solid var(--secondary);
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.2);
}


.actions-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}


.btn-copyright {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #7f8c8d; /* צבע אפור מקצועי */
    font-size: 0.85rem;
    padding: 6px 12px;
    border: 1px solid #dcdde1;
    border-radius: 20px;
    transition: all 0.3s ease;
    background-color: transparent;
}

.btn-copyright:hover {
    background-color: #f5f6fa;
    color: #2f3640;
    border-color: #7f8c8d;
    transform: translateY(-1px);
}

.btn-copyright .icon {
    font-size: 0.9rem;
    opacity: 0.8;
}

svg a {
    cursor: pointer;
}
svg a:hover rect, svg a:hover ellipse {
    stroke: white; 
    stroke-width: 2;
}