@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap');

/* Basic Reset & Global Styles */
:root {
    --primary-color: #d1bc00;
    --secondary-color: #6c757d;
    --background-color: #f8f9fa;
    --text-color: #333;
    --light-color: #fff;
    --dark-color: #343a40;
    --font-family: 'Arial', sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background-image: linear-gradient(rgba(45, 52, 62, 0.6), rgba(9, 23, 43, 0.6)), url('../images/panoramica-podere.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    /* min-height: 100vh; Removed as height: 100% on html/body handles this */
}

body.nav-open {
   overflow: hidden; /* Prevent scrolling when nav is open */
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

ul {
    list-style: none;
}


img {
    max-width: 100%;
}

main {
    flex-grow: 1; /* Pushes footer down */
}

/* Header & Navigation */
header {
    background: rgba(255, 251, 234, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* padding: 1rem 0; */ /* Padding moved to nav items for larger hover area */
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    margin: 0 auto;

}

.nav-links {
    /* flex-grow: 1; */ /* Removed to prevent overlap */
    display: flex;
    justify-content: center;
    /* margin-bottom: 5rem; */
}

.nav-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

nav .logo a {
    display: flex;
    align-items: center;
}

.main-logo {
    height: 50px; /* Adjust height as needed */
    width: auto;
    opacity: 0.8; /* Set logo to 80% opacity */
    transition: opacity 0.3s ease;
}

.logo a:hover .main-logo {
    opacity: 1; /* Make logo fully opaque on hover */
}
/* This container holds the menu and right-aligned items */
.nav-links {
    display: flex;
    align-items: center;
}

nav ul {
    display: flex;
    gap: 1.5rem;
}

nav ul li a {
    color: var(--secondary-color);
    font-weight: bold;
    transition: color 0.3s ease;
    padding: 1.5rem 1rem; /* Increased padding for a larger hover area */
}

nav ul li a:hover {
    color: var(--primary-color);
}

/* Dropdown Menu */
.nav-links .dropdown {
    position: relative;
}

.nav-links .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--light-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 0 0 5px 5px;
    padding: 0.5rem 0;
    margin-top: 5px; /* Small gap between menu and dropdown */
    min-width: 200px;
    z-index: 1001;
}

.nav-links .dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    padding: 0.75rem 1.5rem;
    display: block;
    white-space: nowrap;
}

/* User Actions */
.user-actions {
.nav-links .dropdown.submenu-active > .dropdown-menu {
    display: block;
}

    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-mobile-footer {
    display: none;
}

.welcome-message {
    font-weight: bold;
    color: var(--secondary-color);
}

.logout-button, .login-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}

.logout-button:hover, .login-link:hover {
    text-decoration: underline;
}

/* Language Switcher */
.language-switcher select {
    background-color: var(--light-color);
    border: 1px solid #ccc;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    color: var(--secondary-color);
    font-weight: bold;
    cursor: pointer;
    margin-left: 1rem;
}

/* Hamburger Menu */
.hamburger {
    display: none; /* Hidden on desktop */
    border: none;
    background: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1010; /* Ensure it's above other content */
}

.hamburger-box {
    width: 30px;
    height: 24px;
    position: relative;
    display: inline-block;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 30px;
    height: 3px;
    background-color: var(--dark-color);
    border-radius: 3px;
    position: absolute;
    transition-property: transform;
    transition-duration: 0.22s;
    transition-timing-function: ease;
}

.hamburger-inner {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-inner::before,
.hamburger-inner::after {
    content: '';
    display: block;
}

.hamburger-inner::before {
    top: -10px;
}

.hamburger-inner::after {
    bottom: -10px;
}

.hamburger.is-active .hamburger-inner {
    transform: rotate(45deg);
}

/* Hero Section */
.hero {

    background-image: linear-gradient(rgba(45, 52, 62, 0.6), rgba(9, 23, 43, 0.6)), url('../images/panoramica-podere.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--light-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-content {
    max-width: 600px;
    padding: 0 1rem;
}

.hero h1 {
    font-family: 'Great Vibes', cursive;
    font-size: 5.5rem;
    font-weight: normal; /* Cursive fonts often look better without bolding */
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

/* Countdown Timer */
#countdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.countdown-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 5px;
    min-width: 100px;
}

.countdown-item span {
    display: block;
    font-size: 3rem;
    font-weight: bold;
}

.countdown-label {
    font-size: 1rem;
    text-transform: uppercase;
    color: #ddd;
}


/* Buttons */
.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: var(--light-color);
    padding: 0.8rem 1.6rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cta-button:disabled,
.cta-button[disabled] {
    background: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.cta-button:hover {
    background: #0056b3;
}



/* CTA Section */

/* Generic Container for consistent spacing and width */
.container {
    max-width: 800px;
    margin: 4rem auto;
    padding: 2.5rem;
    background: var(--light-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Generic Page Header */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

/* Generic Form Styling */
.form-container {
    background: #fdfdfd;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
    border: 1px solid #eee;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--secondary-color);
}

.form-errors {
    color: #dc3545;
    font-weight: bold;
    margin-top: 0.5rem;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 1rem;
    min-height: 70vh;
}

.login-box {
    background: var(--light-color);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h2 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.login-form .cta-button {
    width: 100%;
    margin-top: 1rem;
}

.login-error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: .25rem;
}

.section {

    margin: 25px auto 15px;
}

.content {
    position: relative; /* To ensure it's above the background */
    z-index: 1;
    max-width: 800px;
    margin: 0 auto 15px;
    text-align: center;
    background-color: rgba(255, 251, 234, 0.9); /* Semi-transparent background */
    padding: 2.5rem;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.content > *:first-child {
    margin-top: 0;
}

.content h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    font-weight: normal;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.schedule-subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 3rem;
}

.day-schedule {
    margin-top: 4rem;
}

.day-schedule:first-of-type {
    margin-top: 0;
}

.day-schedule h4 {
    font-size: 2rem;
    color: var(--dark-color);
    margin: 0px;
    /* margin-bottom: 1rem; */
}

.timeline {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.timeline-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.timeline-time {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
    flex-basis: 80px; /* Fixed width for time */
    flex-shrink: 0;
}

.timeline-event h3 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
    color: var(--primary-color);
}

.timeline-event p {
    color: var(--secondary-color);
}

/* Leaf Background Styles */


/* Footer */
footer {
    background: var(--dark-color);
    color: var(--light-color);
    text-align: center;
    padding: 1rem; /* Reduced padding to make it less high */
}

/* Responsive Design */
@media (max-width: 1100px) {
    .hamburger {
        display: block;
    }

    .nav-meta {
        display: none;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        z-index: 1001;
        flex-direction: column;
        justify-content: flex-start; /* Align items to the top */
        align-items: center;
        padding-top: 80px; /* Space for header */
        overflow-y: auto;
    }

    .nav-links.is-active {
        display: flex;
    }

    .nav-links > ul {
        flex-direction: column;
        gap: 0.5rem; /* Add a small gap between items */
        text-align: center;
        width: 90%; /* Reduce width to create a box effect */
        margin: 0 auto 5rem;
        background: rgba(255, 255, 255, 0.95); /* Give it a background */
        border-radius: 8px; /* Rounded corners for the box */
        padding: 1rem 0; /* Padding inside the box */
        box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Add a subtle shadow */
    }

    .nav-links > ul > li {
        border-bottom: 1px solid #ccc;
    }

    .nav-links > ul > li:last-child {
        border-bottom: none;
    }

    .nav-links ul li a {
        font-size: 1.3rem; /* Slightly smaller font size */
        color: var(--dark-color);
        padding: 0.8rem 1rem; /* Adjust padding */
        display: block;
        border-radius: 5px; /* Rounded corners for each item */
        margin: 0 0.5rem; /* Margin to keep items from touching the box edges */
        transition: background-color 0.2s ease-in-out;
    }

    .nav-mobile-footer {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 1rem;
        border-top: 1px solid #ccc;
        position: fixed; /* Make it fixed to the viewport */
        bottom: 0; /* Position at the bottom of the viewport */
        left: 0;
        right: 0;
        z-index: 1002; /* Ensure it's above other menu content */
        background: rgba(255, 255, 255, 0.98); /* Match menu background */
    }

    .nav-mobile-footer .welcome-message {
        font-size: 0.9rem;
    }

    .nav-mobile-footer .custom-options {
        bottom: 100%;
        top: auto;
        border-radius: 5px 5px 0 0;
        border-bottom: 1px solid #ccc;
        border-top: 0;
    }

    .hero h1 {
        font-size: 3.5rem; /* Made the main title slightly smaller on mobile */
    }

    .hero p {
        font-size: 1.2rem; /* Scaled down the welcome message text */
    }

    #countdown {
        gap: 0.5rem; /* Further reduced space between items */
        /* flex-wrap is nowrap by default, ensuring a single line */
    }

    .countdown-item {
        padding: 0.6rem; /* Adjusted padding */
        min-width: 75px; /* Adjusted min-width to fit */
    }

    .countdown-item span {
        font-size: 2rem; /* Made the countdown numbers even smaller */
    }

    .countdown-label {
        font-size: 0.7rem; /* Made the countdown labels even smaller */
    }

    /* Mobile Dropdown */
    .nav-links .dropdown-menu {
        position: static;
        display: none; /* Hide by default */
        background: #f0f0f0;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin-top: 0;
        min-width: auto;
        width: 100%;
        text-align: right;
    }


    .nav-links .dropdown.submenu-active > .dropdown-menu {
        display: block;
    }

    .dropdown-menu li {
        border-bottom: 1px solid #e0e0e0;
    }
    .dropdown-menu li:last-child {
        border-bottom: none;
    }

    .dropdown-menu li a {
        padding: 0.75rem 2rem 0.75rem 1.5rem; /* Add more padding to the right */
        font-size: 1.2rem; /* A bit smaller than main nav items */
        color: var(--secondary-color);
    }
}

@media (max-width: 1100px) {
    .table-responsive,
    table {
        overflow-x: auto;
        display: block;
    }
}
.language-switcher select {
    padding-left: 30px; /* space for the flag */
    background-repeat: no-repeat;
    background-position: 5px center;
    background-size: 20px;
}
/* Custom Select Dropdown */
.custom-select-wrapper {
    position: relative;
    display: inline-block;
    user-select: none;
}

.custom-select {
    position: relative;
    display: inline-block;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
}

.flag-icon-wrapper {
    width: 30px;
    height: 20px;
    overflow: hidden; /* This is crucial, it crops the oversized image */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Optional: adds a nice rounded corner to the frame */
    border-radius: 3px; 
}

.flag-icon {
    /* These can be removed or kept, scale is more direct */
    min-width: 40px; 
    min-height: 25px;
    flex-shrink: 0; 
    transform: scale(1); 
}

.custom-options {
    position: absolute;
    display: none;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: 0;
    border-radius: 0 0 5px 5px;
    z-index: 1002;
}

.custom-select.open .custom-options {
    display: block;
}

.custom-option {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    cursor: pointer;
}

.custom-option:hover {
    background-color: #f2f2f2;
}

/* Photo Upload & Gallery Styles */
.gallery-header {
    text-align: center;
    margin-bottom: 2rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-item:hover .photo-caption {
    opacity: 1;
}

.no-photos-message {
    text-align: center;
    padding: 2rem;
}

.messages {
    margin-bottom: 1.5rem;
}

.message {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    color: #fff;
    text-align: center;
}

.message.success {
    background-color: #28a745;
}

.message.error {
    background-color: #dc3545;
}

.upload-form .form-group {
    margin-bottom: 1.5rem;
}

.upload-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.upload-form input[type="file"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.upload-form small {
    display: block;
    margin-top: 0.5rem;
    color: var(--secondary-color);
}

/* Loading Overlay Styles */
#loading-overlay {
    position: fixed; /* Cover the whole screen */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Make sure it's on top of everything */
}

#loading-overlay .upload-status-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark-color);
}

#progress-container {
    width: 80%;
    max-width: 400px;
    background-color: #e9ecef;
    border-radius: 5px;
    margin-top: 1.5rem;
    overflow: hidden;
    border: 1px solid #ced4da;
}

#progress-bar {
    width: 0%;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 4px; /* Slightly smaller to fit inside container */
    transition: width 0.2s ease-in-out;
}

.loading-spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid var(--primary-color); /* Blue */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

#progress-text {
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: bold;
    color: var(--dark-color);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #09f;
    animation: spin 1s ease infinite;
    margin: 20px auto;
}

/* Memories Page Styles */
/* .memory-form-container is now handled by .form-container */

.memories-list h3 {
    text-align: center;
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 1rem;
}

.card {
    background: #ffffff23;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
}

.memory-card {
    display: flex;
    flex-direction: column;
}

.memory-attachment {
    background-color: #000; /* Black background for videos */
}

.memory-attachment img,
.memory-attachment video {
    width: 100%;
    height: auto;
    display: block;
}

.memory-content {
    padding: 1.5rem;
}

.memory-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.memory-text {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-style: italic;
}

.memory-author {
    font-weight: bold;
    color: var(--primary-color);
    text-align: right;
}

.memory-author .memory-date {
    display: block;
    font-weight: normal;
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

.no-memories {
    text-align: center;
    color: var(--secondary-color);
    padding: 2rem;
}

.translate-button {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--secondary-color);
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.translate-button:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
    border-color: #ccc;
    text-decoration: none;
}

/* Delete button for memories (Admin only) */
.delete-memory-form {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.meme-card-with-delete {
    position: relative; /* Ensure this is the positioning context for its children */
}

.meme-image-container {
    position: relative; /* Container for the image and delete button */
    overflow: hidden; /* Ensures button stays within image bounds if positioned outside */
    width: 100%; /* Ensure it takes full width */
    height: 100%; /* Ensure it takes full height of the image */
    display: block; /* Ensure it behaves as a block-level element */
}

.meme-image-container img {
    width: 100%;
    height: 100%; /* Make image fill the container */
    object-fit: cover; /* Cover the area without distorting aspect ratio */
    display: block; /* Remove extra space below image */
}

.delete-meme-form-gallery {
    position: absolute;
    top: 5px; /* Adjust as needed */
    right: 5px; /* Adjust as needed */
    z-index: 100; /* Increased z-index to ensure it's on top */
}

.delete-button {
    background-color: rgba(220, 53, 69, 0.8); /* Semi-transparent red */
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 30px; /* Helps center the '×' vertically */
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
    padding: 0;
}

.delete-button:hover {
    background-color: #dc3545; /* Solid red */
    transform: scale(1.1);
}

/* Meal Selection Form Styles */
.meal-form-container {
    background: #fdfdfd;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #eee;
}

.meal-form .form-fieldset {
    margin-bottom: 2.5rem;
    border: 1px solid #e0e0e0;
    padding: 1.5rem;
    border-radius: 8px;
}

.meal-form .form-fieldset:disabled,
.meal-form .form-fieldset[disabled] {
    opacity: 0.6;
    pointer-events: none; /* Prevents interaction with labels etc. */
}

.meal-form .form-fieldset:last-of-type {
    margin-bottom: 2rem;
}

.meal-form legend {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark-color);
    padding: 0 0.5rem;
    margin-left: -0.5rem;
}

.meal-form .fieldset-instruction {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    margin-top: 0.25rem;
}

.meal-form .choice-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meal-form .choice-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.meal-form input[type="checkbox"],
.meal-form input[type="radio"] {
    transform: scale(1.2);
    accent-color: var(--primary-color);
}

.meal-form label {
    font-size: 1rem;
    color: var(--text-color);
}

.meal-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.form-errors {
    color: #dc3545;
    font-weight: bold;
    margin-bottom: 1rem;
}

.submission-status {
    color: #28a745;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid #28a745;
    padding: 0.75rem;
    border-radius: 8px;
    background-color: #e9f7ef;
    display: inline-block;
}

/* Admin Panel Styles */
.admin-panel-container {
    text-align: center;
    padding: 2rem;
}

/* Admin Data Pages (e.g., Meal Selections) */
.admin-data-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 2.5rem;
    background: var(--light-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.admin-header {
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 2rem;
}

.admin-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.admin-header p {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.admin-summary-container {
    margin-bottom: 3rem;
}

.admin-summary-container h3,
.admin-table-container h3 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.summary-card {
    background: #fdfdfd;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.summary-card h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.summary-card ul {
    list-style-type: none;
    padding-left: 0;
}

.summary-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f1f1;
}

.summary-card li:last-child {
    border-bottom: none;
}

.admin-table-container {
    overflow-x: auto; /* For responsiveness on small screens */
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.admin-table thead th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: var(--secondary-color);
    text-transform: uppercase;
    font-size: 0.85rem;
}

.admin-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

.admin-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Admin Meal Breakdown Styles */
.admin-details-container {
    margin-top: 4rem;
    border-top: 2px solid #e0e0e0;
    padding-top: 2rem;
}

.course-details {
    margin-bottom: 3rem;
}

.course-details:last-child {
    margin-bottom: 0;
}

.course-details h4 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.meal-detail-table {
    margin-bottom: 2.5rem;
}

.meal-detail-table h5 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    border: 1px solid #ddd;
}



/* Song Request Page Styles */
.song-requests-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.song-request-item, .roommate-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.roommate-picture-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin: 20px auto 1rem;
    border: 4px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.roommate-picture-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-details, .card-content {
    padding: 1rem;
    text-align: center;
    flex-grow: 1;
}

.song-title {
    font-weight: bold;
    font-size: 1.2rem;
    display: block;
}

.song-artist {
    font-style: italic;
    color: var(--secondary-color);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    width: 100%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.no-video-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f0f2f5;
    min-height: 180px; /* Same as a 16:9 video on a 320px card */
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
}

.no-video-placeholder .music-icon {
    font-size: 3rem;
    color: var(--secondary-color);
}

.no-video-placeholder p {
    margin-top: 0.5rem;
    color: var(--secondary-color);
    font-weight: bold;
}

.no-video-placeholder .link-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--light-color);
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.no-video-placeholder .link-button:hover {
    background-color: #0056b3;
}

/* Arrival Form Styles */
.arrival-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.arrival-form .form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

@media (max-width: 1100px) {
    .arrival-form .form-grid {
        grid-template-columns: 1fr;
    }
}

.spotify-container {
    margin-top: 1rem;
}

.song-requester {
    display: block;
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

/* Sortable Table Styles */
.sortable th[data-sortable="true"] {
    cursor: pointer;
    position: relative;
}

.sortable th[data-sortable="true"]::after {
    content: ' \\2195'; /* Up-down arrow */
    opacity: 0.3;
}

.sortable th[data-sorted="asc"]::after {
    content: ' \\2191'; /* Up arrow */
    opacity: 1;
}

.sortable th[data-sorted="desc"]::after {
    content: ' \\2193'; /* Down arrow */
    opacity: 1;
}

/* Profile Page Styles */
.profile-view {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding: 2rem;
    margin-bottom: 2rem;
}

.profile-picture-container {
    flex-shrink: 0;
}

.profile-img-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profile-img-placeholder-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--light-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    border: 4px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: 'Arial', sans-serif; /* A more standard font for initials */
}

.profile-info {
    flex-grow: 1;
}

.profile-fullname {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.profile-username {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.profile-bio-section,
.profile-socials-section {
    margin-bottom: 1.5rem;
}

.profile-bio-section h4,
.profile-socials-section h4 {
    font-size: 1.2rem;
    color: var(--dark-color);
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.bio {
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
}

.bio-placeholder,
.socials-placeholder {
    font-style: italic;
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background-color: #f0f2f5;
    color: var(--dark-color);
    font-weight: bold;
    transition: background-color 0.2s, color 0.2s;
}

.social-link:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
    text-decoration: none;
}

/* Responsive adjustments for profile */
@media (max-width: 1100px) {
    .profile-view {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-info {
        width: 100%;
    }

    .social-links {
        justify-content: center;
    }
}

/* General form styling adjustments */
.site-form .form-field {
    margin-bottom: 1.5rem;
}

.site-form .form-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.site-form input[type="text"],
.site-form input[type="url"],
.site-form input[type="file"],
.site-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
}


/* Back to Top Button */
#back-to-top-btn {
    display: none; /* Hidden by default, JS will manage this */
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 18px;
    transition: background-color 0.3s, opacity 0.3s;
}

#back-to-top-btn:hover {
    background-color: #b8a600; /* A darker shade of primary */
}

/* Image Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.profile-img-clickable {
    cursor: pointer;
}

/* FAQ Page Styles */
.faq-accordion {
    text-align: left;
}

.faq-item {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1rem;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 1rem 0;
}

.faq-question h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--dark-color);
}

.faq-toggle {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 1rem;
}

.faq-answer p {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    line-height: 1.7;
}

/* Active state for FAQ item */
.faq-item.active .faq-answer {
    max-height: 500px; /* Adjust as needed, should be larger than any possible answer */
    padding: 1rem;
    transition: max-height 0.4s ease-in, padding 0.4s ease-in;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

/* QR Scanner Styles */
.qr-code-scanner {
    position: relative;
    width: 100%;
    max-width: 500px; /* Limit max width for larger screens */
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background-color: #000; /* Black background for video area */
    display: none; /* Initially hidden */
}

.qr-video {
    width: 100%;
    height: 100%; /* Fill the container */
    display: block;
    object-fit: cover; /* Cover the container, cropping if necessary */
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 5px solid var(--primary-color); /* A border to indicate scan area */
    box-sizing: border-box;
    pointer-events: none; /* Allow clicks to pass through */
}

/* Responsive adjustments for QR scanner */
@media (max-width: 768px) {
    .content {
        padding: 1rem; /* Reduce padding on smaller screens */
    }
    .qr-code-scanner {
        max-width: 100%; /* Allow the scanner to fill the container */
        width: 100%;
    }

    .nav-links > ul {
        margin: 0 auto 10rem;
    }
}

/* Overlay Messages (e.g., Treasure Found, Headshot) */
.overlay-message-background {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Dark overlay */
    z-index: 1000; /* Below the message content */
}

.overlay-message-content {
    display: none; /* Hidden by default */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.95); /* Semi-transparent white background */
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    z-index: 1001; /* Above the background overlay */
    animation: fadeInScale 0.5s ease-out forwards;
    max-width: 90%; /* Responsive width */
}

.message-title {
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.message-text {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 25px;
}

.message-icon {
    width: 100px;
    height: auto;
    animation: bounceIn 0.8s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive adjustments for overlay messages */
@media (max-width: 768px) {
    .overlay-message-content {
        padding: 20px 30px;
    }

    .message-title {
        font-size: 3rem;
    }

    .message-text {
        font-size: 1.2rem;
    }

    .message-icon {
        width: 80px;
    }
}

/* Modal (Background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    padding-top: 100px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}

/* Modal Content (Image) */
.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}

/* Close Button */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
