/* modern_styles.css */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c; /* This is our red color */
    --accent-color: #3498db;
    --light-bg: #f4f6f7;
    --text-color: #333;
    --header-text-color: #ffffff;
    --font-main: 'Assistant', sans-serif;
    --font-hebrew-special: 'Noto Rashi Hebrew', serif;
}

html { height: 100%; }

body {
    font-family: var(--font-main);
    margin: 0; padding: 0; color: var(--text-color); line-height: 1.6; direction: rtl;
    background-image: url('background-main.png');
    background-size: cover; background-attachment: fixed; background-position: center;
    display: flex; flex-direction: column; min-height: 100vh;
}

main.container {
    flex-grow: 1; margin-top: 1em; margin-bottom: 1em;
    border-radius: 8px; box-shadow: 0 0 15px rgba(0,0,0,0.1);
    padding: 2em; display: flex; justify-content: center;
    background-color: rgba(255, 255, 255, 0.70);
}

.container {
    width: 95%; max-width: 1400px; margin-left: auto; margin-right: auto;
    padding-left: 15px; padding-right: 15px;
}

header {
    background-color: var(--primary-color); color: var(--header-text-color);
    padding: 1.2em 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    top: 0; z-index: 100;
}
header .container { display: flex; justify-content: space-between; align-items: center; }
.site-title { font-family: var(--font-hebrew-special); font-size: 3.8em; margin: 0; font-weight: 700; }
.site-title .subtitle { font-family: var(--font-main); font-size: 0.5em; font-weight: 400; display: block; color: #bdc3c7; margin-top: 5px; }
nav ul { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; }
nav ul li { margin-left: 25px; }
nav ul li a { color: var(--header-text-color); text-decoration: none; font-size: 1.8em; font-weight: 600; padding: 8px 15px; border-radius: 6px; transition: all 0.2s ease; }
nav ul li a:hover { color: #fff; background-color: var(--accent-color); }
nav ul li a.active { background-color: var(--secondary-color); color: #fff; pointer-events: none; }

/* Main Page Seder Grid Layout */
.seder-grid-container { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; width: 100%; }
.seder-column { display: flex; flex-direction: column; align-items: center; }
.seder-header { font-family: var(--font-hebrew-special); font-size: 2em; font-weight: 600; color: var(--primary-color); text-align: center; padding-bottom: 10px; margin-bottom: 20px; border-bottom: 3px solid var(--primary-color); width: 100%; }
.masechet-list { display: flex; flex-direction: column; gap: 15px; width: 100%; }
.masechet-card { background-color: #fff; padding: 15px 10px; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); cursor: pointer; transition: all 0.2s ease; min-height: 50px; display: flex; justify-content: center; align-items: center; text-align: center; }
.masechet-card:hover { transform: translateY(-5px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.masechet-card h3 { font-family: var(--font-hebrew-special); font-size: 1.5em; color: var(--primary-color); margin: 0; }

/* Inner Page Layout (Daf Grid and Player) */
#daf-grid-container, #daf-player-container { width: 100%; display: block; }
#current-masechet-title, #current-daf-title { text-align: center; font-family: var(--font-hebrew-special); font-size: 2.5em; color: var(--primary-color); margin-bottom: 1.2em; }
.daf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 12px; margin-top: 20px; }
.daf-item { background-color: #fff; padding: 12px 8px; border: 2px solid #ccc; border-radius: 6px; text-align: center; cursor: pointer; font-size: 1.15em; font-weight: bold; transition: all 0.2s; font-family: var(--font-hebrew-special); }
.daf-item:hover { background-color: var(--accent-color); color: white; transform: scale(1.05); }

/* KEY CHANGE: Updated style for "Today's Daf" */
.daf-item.is-current-daf {
    background-color: var(--secondary-color); /* Solid red background */
    color: white; /* White text */
    border-color: var(--secondary-color); /* Border matches the background */
    font-weight: bold;
}
.daf-item.is-current-daf:hover {
    transform: scale(1.05); /* Keep the hover effect */
    filter: brightness(1.1); /* Make it slightly brighter on hover */
}

.daf-item.unavailable { background-color: #e9ecef; color: #adb5bd; cursor: not-allowed; opacity: 0.8; border-color: #dee2e6; }
.daf-item.unavailable:hover { transform: none; background-color: #e9ecef; color: #adb5bd; }

/* Player Page Modernized Styles */
.player-content { background-color: #fff; padding: 30px 40px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); max-width: 700px; margin: 20px auto; text-align: right; }
.player-content h3 { font-family: var(--font-hebrew-special); font-weight: 600; color: var(--primary-color); font-size: 1.6em; margin-top: 0; margin-bottom: 15px; }
.player-content h3.summary-title { margin-top: 2em; }
audio#daf-audio { width: 100%; border-radius: 50px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.pdf-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background-color: var(--accent-color); color: white; font-size: 1.2em; font-weight: bold; text-decoration: none; padding: 12px 25px; border-radius: 8px; transition: background-color 0.3s ease, transform 0.2s ease; }
.pdf-button:hover { background-color: #2980b9; transform: translateY(-2px); }
.pdf-icon { width: 24px; height: 24px; fill: currentColor; }

/* Content Pages (About, Contact) */
.content-page h2 { font-family: var(--font-hebrew-special); font-size: 3em; color: var(--primary-color); text-align: right; margin-bottom: 0; padding-right: 20px; }
.content-box { background-color: #ffffff; padding: 40px 50px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); font-size: 1.4em; line-height: 1.9; margin-top: 20px; margin-right: 40px; }
.content-box p { margin-bottom: 1.2em; }
.content-box a:not(.button-like) { color: var(--accent-color); text-decoration: underline; font-weight: bold; }
.content-box a:not(.button-like):hover { color: var(--secondary-color); }

/* Other Styles */
footer { background-color: #34495e; color: var(--header-text-color); text-align: center; padding: 1.8em 0; margin-top: auto; font-size: 1.1em; }
.hidden { display: none !important; }
button, .button-like { padding: 10px 18px; background-color: var(--accent-color); color: white !important; text-decoration: none; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-family: var(--font-main); font-weight: bold; transition: background-color 0.3s ease, transform 0.2s ease; margin: 10px 5px; }
#back-to-masechtot, #back-to-daf-grid { background-color: #7f8c8d; display: inline-block; margin-right: auto; margin-left: auto; margin-bottom: 20px; }
#back-to-masechtot:hover, #back-to-daf-grid:hover { background-color: #606c6d; }


/* Responsive Fixes */
@media (pointer: coarse), (max-width: 1024px) { /* Widened the trigger point for better tablet support */
    header {
        position: static;
    }
}
@media (max-width: 1200px) { .seder-grid-container { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
    header .container, footer .container, main.container { width: 100%; padding-left: 10px; padding-right: 10px; }
    main.container { margin-left: 0; margin-right: 0; width: auto; padding-top: 1.5em; padding-bottom: 1.5em; }
    body { padding-left: 5px; padding-right: 5px; }
    header .container { flex-direction: column; text-align: center; }
    .site-title { font-size: 2.5em; }
    nav ul { margin-top: 15px; justify-content: center; flex-wrap: wrap; }
    .seder-grid-container { grid-template-columns: repeat(2, 1fr); }
    .masechet-card h3 { font-size: 1.3em; }
    .seder-header { font-size: 1.8em; }
    .content-page h2 { font-size: 2.5em; text-align: center; padding-right: 0; }
    .content-box { font-size: 1.2em; padding: 20px; margin-right: 0; }
}
@media (max-width: 550px) {
    .seder-grid-container { grid-template-columns: 1fr; }
    .site-title { font-size: 2.2em; }
    nav ul li a { font-size: 1.5em; }
}