.main-content {
    flex-grow: 1;
    display: flex;
    align-items: center; /* Vertically center the login form */
    justify-content: center;
    padding-top: 100px; /* Adjust this value based on your actual header height + some extra space */
                       /* Example: 70px (header) + 30px (breathing room) = 100px */
    padding-bottom: 0px; /* Existing bottom padding */
    padding-left: 0px; /* Add some horizontal padding for smaller screens */
    padding-right: 0px;
    box-sizing: border-box; /* Ensure padding is included in width/height calculations */
    min-height: 100vh;
}

/* ==========================================================================
   Featured Tests Section (Homepage Showcase)
   ========================================================================== */

#featured-tests-section {
    /* This section is hidden by default and shown by JS if content exists */
    /* background-color: #f8f9fa; */ /* Or your .bg-light color */
    padding: 60px 0; /* Standard vertical padding */
}

/* Re-using global .section-title and .section-subtitle if they exist */
#featured-tests-section .section-title {
    text-align: center;
    margin-bottom: 15px;
}
#featured-tests-section .section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 40px auto; /* Center the subtitle */
}


/* --- Grid for the Showcase --- */
/* This reuses the .marketplace-grid class for consistency */
.marketplace-grid {
    display: grid;
    /* Create 2 columns on medium screens, 3 on large, 1 on small */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px; /* Space between cards */
}


/* --- Individual Listing Card (reused from marketplace.css) --- */
/* If these styles are not in a global stylesheet, you need to add them here. */

.listing-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden; /* Ensures image corners are rounded */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.listing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-image-container {
    position: relative;
    height: 180px; /* Fixed height for a uniform look */
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image covers the area without distortion */
}

.price-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    backdrop-filter: blur(4px); /* Frosted glass effect */
}
.price-tag.free {
    background-color: #28a745; /* Green for FREE */
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows content to fill space and push button to bottom */
}

.card-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1.3;
    /* Truncate long titles to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-teacher {
    font-size: 0.9em;
    color: #6c757d;
    margin: 0 0 15px 0;
}

.card-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #495057;
    margin-top: auto; /* Pushes this block down, just above the button */
    padding-top: 10px;
    border-top: 1px solid #f1f3f5;
}

.card-content .btn {
    margin-top: 15px;
    /* Re-use your global .btn and .btn-primary styles */
}


/* --- Section Call to Action (CTA) --- */
.section-cta {
    text-align: center;
    margin-top: 40px;
}

/* Re-use .btn and .btn-secondary from global styles */
.section-cta .btn-secondary {
    /* Example style if not defined globally */
    background-color: transparent;
    color: var(--primary-color, #007bff);
    border: 2px solid var(--primary-color, #007bff);
    font-weight: 500;
}
.section-cta .btn-secondary:hover {
    background-color: var(--primary-color, #007bff);
    color: #ffffff;
}

/* --- Community Section (Notice Board & Gallery) --- */
.community-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 30px;
}

.community-card {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.community-card h3 {
    font-size: 1.5em;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Notice Board */
.notice-board-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.notice-board-content li {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #f1f3f5;
}
.notice-board-content li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.notice-date {
    display: block;
    font-size: 0.8em;
    color: #6c757d;
    margin-bottom: 5px;
}
.notice-title {
    font-weight: 600;
    color: #343a40;
    margin: 0 0 5px 0;
}
.notice-body {
    font-size: 0.95em;
    color: #495057;
    margin: 0;
    white-space: pre-wrap; /* Preserve newlines in the notice content */
}

/* Photo Gallery */
.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.photo-gallery-grid img {
    width: 100%;
    height: 120px; /* Fixed height for consistency */
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.photo-gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .community-grid {
        grid-template-columns: 1fr; /* Stack on mobile */
    }
}

/* --- General Edit Mode Styles --- */
.editable-section .edit-controls-container {
    /* JS will show/hide this based on user role */
}

/* --- Hero Section Edit Controls --- */
.hero-edit-controls {
    position: absolute;
    top: calc(var(--header-height, 70px) + 20px);
    right: 20px;
    z-index: 10;
}
.btn.btn-secondary.btn-sm {
    background-color: #fff;
    color: #212529;
}
#hero h1[contenteditable="true"],
#hero p[contenteditable="true"] {
    outline: 2px dashed var(--primary-color, #007bff);
    padding: 5px;
    border-radius: 5px;
    cursor: text;
}

/* --- Delete (Cross) Button for Cards/Items --- */
.deletable-item {
    position: relative; /* Parent must be relative */
}
.btn-delete-item {
    position: absolute;
    top: 8px;
    right: 8px;
    
    /* Shape and Size */
    width: 28px;
    height: 28px;
    border-radius: 50%;
    
    /* Appearance */
    background-color: #dc3545; /* Solid red background */
    border: 2px solid #ffffff; /* White border to make it pop */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); /* Stronger shadow on dark bg */
    
    /* Icon */
    color: #ffffff; /* Solid white icon */
    font-size: 20px;
    font-weight: bold;
    
    /* Interaction & Layout */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    opacity: 0;
    transform: scale(0.5); /* Start smaller for a pop-in effect */
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy transition */
}

.deletable-item:hover .btn-delete-item {
    opacity: 1;
    transform: scale(1); /* Pop to full size on hover */
}

.btn-delete-item:hover {
    background-color: #c82333; /* Darker red on hover */
    transform: scale(1.15) rotate(90deg); /* Grow and rotate for a playful effect */
}

/* --- Notice Board "Add Notice" --- */
.add-notice-container {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}
#newNoticeInput {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    resize: vertical;
    margin-bottom: 10px;
}
#postNoticeBtn {
    display: block;
    margin-left: auto; /* Align to the right */
}

/* --- Photo Gallery "Add Photo" --- */
.add-photo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 120px; /* Match photo height */
    border: 2px dashed #adb5bd;
    border-radius: 6px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}
.add-photo-box:hover {
    border-color: var(--primary-color, #007bff);
    color: var(--primary-color, #007bff);
    background-color: #e9ecef;
}
.add-photo-box .material-symbols-outlined {
    font-size: 36px;
}

/* --- Floating Save Button --- */
.floating-save-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 25px;
    background-color: #28a745; /* Success green */
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.floating-save-btn.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* You can reuse .modal-overlay and .modal-close-btn from other modals if they are global */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Darker overlay for images */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}
.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.modal-close-btn {
    position: fixed; /* Fixed to the viewport corner */
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 40px;
    line-height: 1;
    color: #ffffff;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2001; /* Above the modal content */
}
.modal-close-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.photo-modal-content {
    position: relative;
    max-width: 90vw; /* Max 90% of viewport width */
    max-height: 90vh; /* Max 90% of viewport height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-overlay.visible .photo-modal-content {
    transform: scale(1);
}

#modalImageView {
    max-width: 100%;
    max-height: 85vh; /* Leave space for caption */
    object-fit: contain; /* Ensure image is not cropped */
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#modalImageCaption {
    margin-top: 15px;
    color: #f1f1f1;
    font-size: 1.1em;
    text-align: center;
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}