/* Universal Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* General Body & Typography */
:root {
    --primary-color: #4a5568; /* Slate 600 */
    --accent-color: #4f46e5; /* Indigo 600 */
    --background-color: #f8fafc; /* Slate 50 */
    --surface-color: #ffffff;
    --border-color: #e2e8f0; /* Slate 200 */
    --text-color: #1e293b; /* Slate 800 */
    --muted-text-color: #64748b; /* Slate 500 */
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-weight: 700;
    color: var(--text-color);
}
h4 {
    font-weight: 500;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}
a:hover {
    text-decoration: underline;
}

hr {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 40px 0;
}

/* Header & Navigation */

/* Mobile Toggle Button (Hidden on Desktop strictly by ID) */
#mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 5px;
}


header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    margin-bottom: 40px;
}
header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo:hover { text-decoration: none; }
header nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 25px;
}
header nav ul a {
    color: var(--primary-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.button-register {
    background-color: var(--accent-color);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
}
.button-register:hover {
    text-decoration: none;
    background-color: #4338ca; /* Indigo 700 */
}

/* Minimalist Forms */
.form-container {
    background: var(--surface-color);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-width: 450px;
    margin: 40px auto;
    text-align: center;
}
.form-container h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.75em;
}
.form-container p {
    color: var(--muted-text-color);
    margin-bottom: 30px;
}
.input-group {
    display: flex;
    align-items: center;
    gap: 10px; /* Adds space between items */
    margin-bottom: 20px;
    border: 1px solid var(--border-color); /* Moves border to the container */
    border-radius: 8px;
    background-color: var(--background-color);
    padding: 0 15px; /* Adds padding to the container */
}
.input-group:focus-within { /* Highlights the whole group on focus */
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.input-group i {
    color: var(--muted-text-color);
}


.input-group input {
    width: 100%;
    flex-grow: 1; /* Allows input to fill available space */
    padding: 14px 0;
    border: none;
    background: none;
    font-size: 1em;
    color: var(--text-color);
}


.input-group input:focus {
    outline: none;
}


.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

button[type="submit"] {
    background-color: var(--accent-color);
    color: white;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 700;
    transition: background-color 0.3s;
}
button[type="submit"]:hover {
    background-color: #4338ca; /* Darker Indigo */
}

.form-links {
    margin-top: 25px;
    font-size: 0.9em;
}

/* Messages */
.error-message, .success-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
}
.error-message {
    background-color: #fee2e2;
    color: #991b1b;
}
.success-message {
    background-color: #dcfce7;
    color: #166534;
}

/* Bible Browser */
#navigation-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}
.selector-wrapper {
    position: relative;
}
.selector-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-text-color);
    pointer-events: none; /* Allows click-through */
}
.selector-wrapper select {
    width: 100%;
    padding: 12px 12px 12px 45px;
    font-size: 1em;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    appearance: none;
    background-color: var(--surface-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.7rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}

/* Verse & Comment Display */
#verse-text-container .verse {
    margin-bottom: 12px;
}
#verse-text-container .verse-number {
    font-weight: bold;
    color: var(--accent-color);
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
    display: inline-block;
    margin-right: 8px;
}
#verse-text-container .verse.selected .verse-number {
    background-color: #e0e7ff; /* Indigo 100 */
}
#comment-section h4 {
    display: flex;
    align-items: center;
    gap: 10px;
}
#comment-form textarea {
     width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    background-color: var(--background-color);
    margin-bottom: 15px;
}

/* Comment Indicator Icon */
.comment-indicator {
    color: var(--accent-color);
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.comment-indicator:hover {
    opacity: 1;
}

/* Modal Window Styles */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Slightly less opaque */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 8px; /* Less rounded */
    width: 90%;
    max-width: 500px; /* Slightly narrower */
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* More subtle shadow */
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5em; /* Smaller close button */
    line-height: 1;
    color: var(--muted-text-color);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.modal-close-btn:hover {
    opacity: 1;
}

.modal-overlay.hidden {
    display: none;
}

#modal-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
    color: var(--primary-color);
    text-align: center;
}

#modal-body {
    padding: 0; /* Remove padding */
}


/* The main body of the comment text */
.comment-body {
    padding: 15px;
}

.comment-text {
    margin: 0;
    line-height: 1.6;
    color: var(--text-color);
    white-space: pre-wrap;
}

/* The new shaded footer bar */
.comment-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background-color: var(--background-color); /* Lightly shaded background */
    border-top: 1px solid var(--border-color);
    font-size: 0.85em;
    color: var(--muted-text-color);
}

.comment-author, .comment-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-author {
    font-weight: 500;
    color: var(--primary-color);
}

/* The vertical separator line */
.footer-separator {
    border-left: 1px solid #d1d5db; /* Gray 300 */
    height: 16px;
}

/* Actions (Reply, Edit, Delete) are now in the footer */
/* Wrapper for actions and the reply form */
.comment-interaction-wrapper {
    padding-left: 21px; /* Indent to align with text body */
}
/* Actions (Reply, Edit, Delete) */
.comment-actions {
    display: flex;
    gap: 15px;
    font-size: 0.8em;
    padding-top: 10px; /* Add some space above the buttons */
}

/* Comment Reply Styles */
.comment-replies {
    margin: 15px 0 0 25px;
    padding-left: 15px;
    border-left: 2px solid var(--border-color);
}

.comment-header {
    display: flex; /* Use flexbox for alignment */
    justify-content: space-between; /* Pushes name and date to opposite ends */
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85em; /* Smaller font for header */
    color: var(--muted-text-color);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: var(--primary-color);
}

.comment-meta {
    font-style: italic;
}

.comment-body {
    padding-left: 21px; /* Indent body to align with username */
}

.comment-text {
    margin: 0 0 10px 0;
    line-height: 1.5;
    color: var(--text-color);
    white-space: pre-wrap;
}



/* Comment Action Buttons */
.comment-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    font-size: 0.9em;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-text-color);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
}

.action-btn:hover {
    color: var(--accent-color);
}
.action-btn.delete-btn:hover {
    color: #dc2626; /* Red 600 */
}

/* Edit View Styles */
.edit-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.edit-controls button {
    padding: 5px 10px;
    font-size: 0.9em;
    border-radius: 6px;
    background-color: var(--border-color);
    color: var(--primary-color);
}
.edit-controls button.save-btn {
    background-color: var(--accent-color);
    color: white;
}

/* Page Header for Lists */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}
.page-header h1 {
    margin: 0;
}
.page-header .button {
    background-color: var(--accent-color);
    color: white;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
}
.page-header .button:hover {
    text-decoration: none;
    background-color: #4338ca;
}
.page-header .button i {
    margin-right: 8px;
}

/* List/Card Styles */
.item-list {
    display: grid;
    gap: 20px;
}
.item-card {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.item-card h3 {
    margin-top: 0;
}
.item-card h3 a {
    text-decoration: none;
    color: var(--text-color);
}
.item-card h3 a:hover {
    color: var(--accent-color);
}
.muted-text {
    color: var(--muted-text-color);
    font-size: 0.9em;
    line-height: 1.5;
}
.muted-text i {
    width: 20px;
}

.reference-card a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.1em;
    font-weight: 500;
}
.reference-card a:hover {
    color: var(--accent-color);
}
.reference-card a span {
    flex-grow: 1;
    margin-left: 15px;
}

/* Passage Text Display */
.passage-text strong {
    font-weight: bold;
    color: var(--accent-color);
    margin-right: 8px;
}

/* Secondary Button */
.button-secondary {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 10px;
}
.button-secondary:hover {
    background-color: var(--background-color);
}

/* Verse selection highlight for passage page */
.passage-text .verse.selected {
    background-color: #eef2ff; /* Indigo 50 */
}

/* Styles for Plan Actions */
.plan-actions {
    display: flex;
    gap: 10px;
}
.button-danger {
    background-color: #b91c1c; /* Red 700 */
}
.button-danger:hover {
    background-color: #991b1b; /* Red 800 */
}

/* Style for remove reference button in forms */
.remove-reference-btn {
    background: none;
    border: none;
    color: #9ca3af; /* Gray 400 */
    font-size: 1.5em;
    cursor: pointer;
    padding: 0 10px;
}
.remove-reference-btn:hover {
    color: #dc2626; /* Red 600 */
}
.input-group input:not([type="date"]) {
    flex-grow: 1; /* Allow input to fill space */
}

/* Validation Status Styles */
.validation-status {
    font-size: 0.8em;
    font-weight: 500;
    margin-left: 10px;
    width: 120px; /* Give it a fixed width to prevent layout shifts */
    display: inline-block;
}
.validation-status.checking {
    color: var(--muted-text-color);
}
.validation-status.valid {
    color: #16a34a; /* Green 600 */
}
.validation-status.invalid {
    color: #dc2626; /* Red 600 */
}

/* Comment Reply Styles */


.reply-btn {
    font-size: 0.8em !important;
    font-weight: bold;
    color: var(--muted-text-color) !important;
}

.reply-form {
    margin-top: 15px;
}

.reply-form textarea, #plan-comment-text{
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9em;
}

.reply-form-actions {
    margin-top: 5px;
    display: flex;
    gap: 10px;
}

.reply-form-actions button {
    padding: 5px 10px;
    font-size: 0.9em;
    border-radius: 6px;
    background-color: var(--accent-color);
    color: white;
}
.reply-form-actions button.cancel-reply-btn {
    background-color: var(--border-color);
    color: var(--primary-color);
}



/* Calendar Styles */
#calendar-container {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-nav button {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 500;
}
.calendar-nav button:hover {
    background-color: var(--background-color);
}
.calendar-header {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text-color);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}
.calendar-day-name {
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
    color: var(--muted-text-color);
    font-size: 0.9em;
}
.calendar-day {
    border: 1px solid var(--border-color);
    min-height: 120px;
    padding: 5px;
}
.calendar-day.empty {
    background-color: var(--background-color);
}
.calendar-day.today .day-number {
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.day-number {
    font-size: 0.9em;
    font-weight: 500;
}
.day-events {
    margin-top: 5px;
}
.event-chip {
    display: block;
    font-size: 0.8em;
    padding: 4px 6px;
    background-color: #eef2ff; /* Indigo 50 */
    color: var(--accent-color);
    border-radius: 4px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}
.event-chip:hover {
    background-color: #e0e7ff; /* Indigo 100 */
}

/* Specific override for the plan discussion page */
.comment-section-container .comment-header {
    display: block;
    justify-content: left;
    color: #0080FF;
}


//* --- Facebook-Style Comment Design --- */



/* This is a placeholder for a user avatar */
.comment-avatar-placeholder {
    width: 32px;
    height: 32px;
    background-color: var(--border-color);
    border-radius: 50%;
    font-size: 16px;
    color: var(--muted-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevents shrinking */
}

.comment-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aligns content to the left */
    width: 100%;
}


.comment-author-name {
    font-weight: 700; /* Bolded name */
    color: var(--text-color);
    font-size: 0.9em;
    margin-bottom: 2px;
}

.comment-text {
    margin: 0;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}



/* Comment Reply Styles */
.comment-replies {
    padding-top: 10px;
    width: 100%;
}

/* User Management Table */
.user-table-container {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}
.user-table {
    width: 100%;
    border-collapse: collapse;
}
.user-table th, .user-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.user-table tbody tr:last-child td {
    border-bottom: none;
}
.user-table th {
    font-size: 0.9em;
    color: var(--muted-text-color);
}
.actions-form {
    display: flex;
    gap: 10px;
}
.action-btn-sm {
    width: 32px;  /* Fixed width */
    height: 32px; /* Fixed height */
    font-size: 0.9em;
    border-radius: 50%; /* Makes the button a circle */
    border: none;
    cursor: pointer;
    color: white;
    display: flex; /* Centers the icon inside the button */
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: opacity 0.2s;
}
.action-btn-sm:hover {
    opacity: 0.8;
}
.action-btn-sm.promote { background-color: #16a34a; } /* Green */
.action-btn-sm.demote { background-color: #f59e0b; }  /* Amber */
.action-btn-sm.delete { background-color: #dc2626; }  /* Red */

.plan-context {
    font-size: 0.8em;
    color: var(--muted-text-color);
    margin-bottom: 5px;
    padding-left: 12px;
}

/* Reading Plan Comment Badge */
.plan-context strong {
    font-weight: 700;
    color: #0c4a6e; /* Slightly darker for the title itself */
}

/* Styling for the bottom meta row of comments */


.plan-context-bottom {
    color: #4b5563;
}

/* Grouping the action buttons together */
.action-buttons {
    display: flex;
    gap: 12px;
}

/* Styling the buttons to look like clean icon-links */
.action-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px; /* Space between the icon and the text */
    transition: color 0.2s ease;
}

.action-btn:hover {
    color: #0369a1; /* Changes to blue when hovered */
}

.action-btn i {
    font-size: 0.85rem; /* Makes the icons slightly larger than the text */
}

/* --- Comment Bubble Styling --- */
.comment-author-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0px; /* Tighten space between name and date */
}

.comment-date-time {
    font-size: 0.7rem;
    color: #6b7280;
    margin-bottom: 8px; /* Space before the actual comment text starts */
}

/* --- Bottom Meta Bar --- */


.plan-context-bottom {
    color: #4b5563;
}

.bullet {
    margin: 0 8px;
    color: #d1d5db;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.action-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.action-btn:hover {
    color: #0369a1;
}



/* --- Flat Minimalist Comments --- */

.comment-item {
    margin-bottom: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.c-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Tight vertical rhythm */
}

/* Header: Author, Date, Plan */
.c-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.2;
}

.c-author {
    font-weight: 600;
    color: #111827; /* Dark text for author */
    font-size: 0.9rem;
}

.c-meta {
    font-size: 0.75rem;
    color: #9ca3af; /* Muted text for meta */
    display: flex;
    align-items: center;
    gap: 6px;
}

.c-plan {
    color: #6b7280;
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Body: The Comment */
.c-body {
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 2px 0;
}

.c-text {
    margin: 0; /* Remove default paragraph margins */
    word-break: break-word;
}

/* Footer: Icon Buttons */
.c-footer {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}

.c-action-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.c-action-btn:hover {
    background-color: #f3f4f6;
    color: #111827; /* Darkens on hover */
}

.c-action-btn.delete-btn:hover {
    color: #dc2626; /* Red for delete hover */
    background-color: #fef2f2;
}

/* Nested Replies Threading */
.c-replies {
    margin-top: 12px;
    padding-left: 20px;
    border-left: 2px solid #e5e7eb; /* Clean vertical line */
}

.c-replies .comment-item {
    margin-bottom: 12px; /* Slightly tighter spacing for replies */
}

/* --- Passage Guidance Notes --- */
.passage-guidance-note {
    font-size: 0.85rem;
    color: #6b7280; /* Muted gray text */
    margin-top: 4px;
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 2px solid #e5e7eb; /* Subtle line to indent the note */
    line-height: 1.5;
    font-style: italic;
}

/* --- Admin Form Inputs (Passage Notes) --- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151; /* Dark gray */
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db; /* Light gray border */
    border-radius: 6px; /* Soft rounded corners */
    font-family: inherit;
    font-size: 0.95rem;
    color: #1f2937;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: vertical; /* Lets you drag the box taller, but not wider */
    box-sizing: border-box; /* Ensures padding doesn't break the width */
}

/* Make it look active when clicked */
.form-control:focus {
    outline: none;
    border-color: #3b82f6; /* Blue border on focus */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); /* Soft blue glow */
}

/* Soften the placeholder text */
.form-control::placeholder {
    color: #9ca3af;
}

/* =========================================
   MOBILE RESPONSIVENESS (Max Width: 600px)
   ========================================= */
@media (max-width: 600px) {

    .nav-separator {
        display: none; /* Hides the vertical bars on mobile */
    }
    
    /* 1. Mobile Dropdown Menu */
   /* 1. Mobile Dropdown Menu (Forced via IDs) */
    
    /* Show the hamburger button */
    #mobile-menu-toggle {
        display: block !important; 
    }
    
    /* Hide the horizontal menu and format as a dropdown */
    #nav-menu {
        display: none !important; /* Forces it to hide initially */
        flex-direction: column;
        width: 100%;
        background-color: var(--surface-color);
        position: absolute;
        top: 100%; /* Drops it directly below the nav bar */
        left: 0;
        padding: 10px 0;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        border-top: 1px solid var(--border-color);
        z-index: 1001;
        gap: 0;
    }
    
    /* Reveal the menu when the JS adds the .active class */
    #nav-menu.active {
        display: flex !important; 
    }
    
    /* Format the links for mobile tapping */
    #nav-menu li {
        width: 100%;
    }
    #nav-menu a, #nav-menu span.welcome-user {
        padding: 12px 20px;
        display: block;
        width: 100%;
        border-bottom: 1px solid #f1f5f9;
    }
    
    /* Hide the vertical desktop separators */
    .nav-separator {
        display: none !important; 
    }
    
    /* Remove border from the last item so it looks clean */
    header nav ul li:last-child a, 
    header nav ul a:last-child {
        border-bottom: none;
    }

    /* 2. Fix the Bible Browser Dropdowns */
    #navigation-controls {
        grid-template-columns: 1fr; /* Stacks the dropdowns vertically */
        gap: 10px;
    }

    /* 3. Contain the Modals (Bubbles) */
    .modal-content {
        width: 95%;
        padding: 20px 15px; /* Reduce padding to save screen real estate */
        max-height: 90vh; /* Prevents it from being taller than the screen */
        overflow-y: auto; /* Lets you scroll inside the modal if it's long */
    }

    /* 4. Format the Quick Comment Popup as a Bottom Sheet */
    #quick-comment-popup {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 20px 16px 30px 16px;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    }

    /* 5. Squeeze the Calendar */
    .calendar-day {
        min-height: 80px;
        padding: 2px;
    }
    .calendar-day-name {
        font-size: 0.75em;
        padding: 5px 0;
    }
    .day-number {
        font-size: 0.8em;
    }
    .event-chip {
        font-size: 0.7em;
        padding: 2px 4px;
    }
    .calendar-nav {
        flex-direction: column;
        gap: 15px;
    }

    /* 6. Stack Plan Action Buttons */
    .plan-actions {
        flex-direction: column;
    }
    .plan-actions button, .plan-actions a {
        width: 100%;
        text-align: center;
    }
}