/* =========================
   General Reset
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =========================
   Variables
   ========================= */
:root {
    /* Colors */
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #1abc9c;
    --error-color: #dc3545;
    --error-bg-color: #f8d7da;
    --light-bg-color: #fff;
    --dark-text-color: #333;
    --light-text-color: #555;

    /* Spacing */
    --padding-small: 10px;
    --padding-medium: 15px;
    --padding-large: 20px;

    /* Breakpoints */
    --breakpoint-small: 480px;
    --breakpoint-medium: 768px;
    --breakpoint-large: 1024px;
}

/* =========================
   Body Styling
   ========================= */
body {
    font-family: 'Open Sans', Arial, sans-serif;
    background-color: #f9f9f9;
    color: var(--dark-text-color);
    line-height: 1.6;
}

/* =========================
   General Header Styling
   ========================= */
header {
    background-color: var(--primary-color);
    color: #fff;
    padding: var(--padding-medium) var(--padding-large);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Logo Styling */
header .logo {
    display: flex;
    align-items: center;
}

header .logo img.icon {
    height: 50px;
    margin-right: var(--padding-small);
}

/* Heading Styling */
header h1 {
    flex: 1; /* Ensure h1 is spaced properly */
    text-align: center;
    margin: 0;
    font-size: 1.8em;
}

/* Update Button Styling - Matches "Return to Landing Page" */
header .update-btn {
    background-color: var(--secondary-color); /* Same as landing-link */
    color: #fff;
    padding: var(--padding-small) var(--padding-medium);
    border-radius: 5px;
    font-weight: bold;
    font-size: 3em;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

header .update-btn:hover {
    background-color: var(--accent-color); /* Same hover effect as landing-link */
    transform: scale(1.05);
}

/* Navigation Link Styling */
header nav a.landing-link {
    background-color: var(--secondary-color);
    color: #fff;
    padding: var(--padding-small) var(--padding-medium);
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

header nav a.landing-link:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

/* Navigation Link Styling */
header nav {
    flex-shrink: 0; /* Ensure nav doesn't shrink */
}

header nav a.landing-link {
    background-color: var(--secondary-color);
    color: #fff;
    padding: var(--padding-small) var(--padding-medium);
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
    display: inline-block;
}

header nav a.landing-link:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

/* Navigation Link Styling */
header nav {
    flex: 1; /* Take up remaining space on the right */
    text-align: right; /* Align link to the right */
}

header nav a.landing-link {
    background-color: var(--secondary-color);
    color: #fff;
    padding: var(--padding-small) var(--padding-medium);
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
    display: inline-block;
}

header nav a.landing-link:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

/* =========================
   Main Content Styling
   ========================= */
main {
    padding: var(--padding-large);
    max-width: 1200px;
    margin: auto;
}

/* =========================
   Gallery Container
   ========================= */
.gallery-container {
    text-align: center;
    margin: var(--padding-large) auto;
}

/* =========================
   Gallery Grid
   ========================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--padding-medium);
}

/* =========================
   Gallery Item
   ========================= */
.gallery-item {
    text-align: center;
    background: var(--light-bg-color);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: var(--padding-medium);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* =========================
   Gallery Item Image
   ========================= */
.gallery-item img {
    max-width: 100%;
    height: 150px;
    border-radius: 5px;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.gallery-item img:hover {
    transform: scale(1.05);
}

/* =========================
   Action Buttons Below Thumbnails
   ========================= */
.thumbnail-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.thumbnail-actions .button {
    display: inline-block;
    padding: 8px 12px;
    font-size: 0.9em;
    font-weight: bold;
    color: white;
    background-color: var(--secondary-color);
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.thumbnail-actions .button:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

.thumbnail-actions .button:active {
    transform: scale(0.95);
}

/* =========================
   Upload Form
   ========================= */
.upload-form {
    margin: var(--padding-large) 0;
}

.upload-form label {
    font-weight: bold;
    margin-right: var(--padding-small);
}

.upload-form select,
.upload-form input[type="file"],
.upload-form button {
    padding: var(--padding-small);
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1em;
}

.upload-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

.upload-form button:hover {
    background-color: var(--accent-color);
}

/* =========================
   Photo Grid for View Folder
   ========================= */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: var(--padding-large) 0;
}

.photo-grid img {
    width: 100%;
    border-radius: 5px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.photo-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* =========================
   Photo Actions Below Grid
   ========================= */
.photo-actions {
    margin-top: 10px;
}

.photo-actions a {
    text-decoration: none;
    color: var(--secondary-color);
    margin-right: 10px;
    font-weight: bold;
    transition: color 0.3s ease-in-out;
}

.photo-actions a:hover {
    color: var(--accent-color);
}

/* =========================
   Lightbox Styling
   ========================= */
body.lb-disable-scrolling {
    overflow: hidden;
}

.lightboxOverlay {
    position: fixed; /* Changed to fixed for better coverage */
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent background */
    display: none;
    justify-content: center;
    align-items: center;
}

.lightbox {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background-color: var(--light-bg-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox .lb-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-bottom: 1px solid #ddd;
}

.lightbox a img {
    border: none;
}

.lb-loader {
    position: absolute;
    top: 43%;
    left: 0;
    height: 25%;
    width: 100%;
    text-align: center;
    line-height: 0;
}

.lb-cancel {
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto;
    background: url('../images/loading.gif') no-repeat;
}

.lb-nav {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 10;
}

.lb-nav a {
    outline: none;
    background-image: url('data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
}

.lb-prev, .lb-next {
    height: 100%;
    cursor: pointer;
    display: block;
}

.lb-nav a.lb-prev {
    width: 34%;
    left: 0;
    float: left;
    background: url('../images/prev.png') left 48% no-repeat;
    opacity: 0;
    transition: opacity 0.6s;
}

.lb-nav a.lb-prev:hover {
    opacity: 1;
}

.lb-nav a.lb-next {
    width: 64%;
    right: 0;
    float: right;
    background: url('../images/next.png') right 48% no-repeat;
    opacity: 0;
    transition: opacity 0.6s;
}

.lb-nav a.lb-next:hover {
    opacity: 1;
}

.lb-dataContainer {
    margin: 0 auto;
    padding-top: 5px;
    width: 100%;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.lb-dataContainer:after {
    content: "";
    display: table;
    clear: both;
}

.lb-data {
    padding: 0 4px;
    color: #ccc;
}

.lb-data .lb-details {
    width: 85%;
    float: left;
    text-align: left;
    line-height: 1.1em;
}

.lb-data .lb-caption {
    font-size: 13px;
    font-weight: bold;
    line-height: 1em;
}

.lb-data .lb-caption a {
    color: #4ae;
}

.lb-data .lb-number {
    display: block;
    clear: left;
    padding-bottom: 1em;
    font-size: 12px;
    color: #999999;
}

.lb-data .lb-close {
    display: block;
    float: right;
    width: 30px;
    height: 30px;
    background: url('../images/close.png') top right no-repeat;
    text-align: right;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lb-data .lb-close:hover {
    cursor: pointer;
    opacity: 1;
}

/* =========================
   Landing Page Link
   ========================= */
.landing-link {
    display: inline-block;
    color: white;
    background-color: var(--primary-color);
    padding: var(--padding-small) var(--padding-medium);
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    margin-top: var(--padding-large);
    transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.landing-link:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

/* =========================
   Footer Styling
   ========================= */
footer {
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: var(--padding-medium);
    position: relative;
    bottom: 0;
    width: 100%;
}

footer p {
    font-size: 0.9em;
}

/* =========================
   Responsive Styling
   ========================= */

/* Tablets and Small Desktops */
@media (max-width: var(--breakpoint-large)) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .upload-form label,
    .upload-form select,
    .upload-form input[type="file"],
    .upload-form button {
        width: 100%;
        margin-bottom: var(--padding-small);
    }
}

/* Phones and Small Tablets */
@media (max-width: var(--breakpoint-medium)) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    header nav {
        margin-top: var(--padding-small);
    }

    .gallery-grid,
    .photo-grid {
        grid-template-columns: 1fr;
    }

    /* Questionnaire and Bios Display Differently */
    .questionnaire-bios-wrapper {
        display: flex;
        flex-direction: column;
        gap: var(--padding-large);
    }

    .questionnaire-container,
    .family-bios-container {
        width: 100%;
    }
}

/* Very Small Screens */
@media (max-width: var(--breakpoint-small)) {
    header h1 {
        font-size: 1.5em;
    }

    .gallery-item img,
    .photo-grid img {
        height: 100px;
    }

    /* Lightbox adjustments */
    .lightbox {
        max-width: 100%;
        max-height: 100%;
    }

    .lightbox .lb-image {
        max-height: 60vh;
    }

    .lb-nav a.lb-prev,
    .lb-nav a.lb-next {
        width: 30px;
        height: 30px;
    }

    .lb-data .lb-close {
        width: 25px;
        height: 25px;
    }
}

/* =========================
   View Questionnaire Section
   ========================= */

/* Table Styling */
.view-questionnaire table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.view-questionnaire table, 
.view-questionnaire th, 
.view-questionnaire td {
    border: 1px solid #aaa;
}

.view-questionnaire th, 
.view-questionnaire td {
    padding: 8px;
    text-align: left;
}

/* Button Styling */
.view-questionnaire .add-row-btn {
    margin-bottom: 10px;
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

.view-questionnaire .add-row-btn:hover {
    background-color: #1abc9c;
}

/* Textarea Styling - UPDATED */
.view-questionnaire textarea {
    width: 100%;
    height: 80px;
    /* Was: resize: vertical; */
    resize: both;       /* Allow both horizontal & vertical resizing */
    overflow: auto;     /* Scrollbars appear if content exceeds box */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Button Group Styling */
.view-questionnaire .button-group {
    margin-top: 20px;
}

.view-questionnaire .button-group button {
    margin-right: 10px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

.view-questionnaire .button-group button:hover {
    background-color: var(--accent-color);
}

/* Landing Link Styling */
.view-questionnaire .landing-link {
    text-decoration: none;
    color: #FFFFFF; /* White color */
    font-weight: bold;
    margin-left: auto;
    transition: color 0.3s ease-in-out;
}

.view-questionnaire .landing-link:hover {
    color: var(--accent-color);
}

.view-questionnaire .logo img {
    max-width: 50px;
}

/* Main Content Styling */
.view-questionnaire main {
    padding: 20px;
}

/* Question Form Fields */
.view-questionnaire .question {
    margin-bottom: 20px;
}

.view-questionnaire .question label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.view-questionnaire .question input[type="text"],
.view-questionnaire .question input[type="date"],
.view-questionnaire .question input[type="time"],
.view-questionnaire .question input[type="number"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* =========================
   Family Biographies Landing Page
   ========================= */

/* Family Bios Container */
.family-bios-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px;
}

/* Family Member Card */
.family-member-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 250px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.family-member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Profile Picture */
.profile-pic {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

/* Card Content */
.card-content {
    padding: 15px;
    text-align: center;
}

.card-content h2 {
    margin: 10px 0 5px;
    font-size: 1.5em;
    color: #333;
}

.preferred-name {
    color: #555;
    margin-bottom: 15px;
}

/* View Bio Button */
.view-bio-button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #007BFF;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.view-bio-button:hover {
    background-color: #0056b3;
}

/* Landing Link Styling for Family Biographies */
.family-bios .landing-link {
    text-decoration: none;
    color: #FFFFFF; /* White color */
    font-weight: bold;
    margin-left: auto;
    transition: color 0.3s ease-in-out;
}

/* Error Message */
.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 5px;
    margin: 20px;
    text-align: center;
}

/* Save Changes Button in Header */
.save-button {
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    padding: var(--padding-small) var(--padding-medium);
    cursor: pointer;
    border-radius: 5px;
    font-size: 1em;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.save-button:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

.save-button:active {
    transform: scale(0.95);
}

/* return to laning page button */
/* Specific styling for "Return to Landing Page" button */
.return-button {
    color: #FFFFFF !important; /* Set text color to white */
    background-color: transparent; /* Optional: Remove background color if needed */
    border: none; /* Optional: Remove border if present */
    /* Retain existing styles or add new ones as needed */
}

.return-button:hover {
    color: var(--accent-color) !important; /* Change text color on hover */
    /* Optional: Add other hover effects if desired */
}

/* fun_stuff.css */

/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body Styling */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Header Styling */
header {
    background-color: #4CAF50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

header h1 {
    font-size: 1.8em;
}

.return-button {
    background-color: #ffffff;
    color: #4CAF50;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s, color 0.3s;
}

.return-button:hover {
    background-color: #e6e6e6;
    color: #388E3C;
}

/* Tiles Container */
.tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* Individual Tile Styling */
.tile {
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.tile h2 {
    color: #4CAF50;
    margin-bottom: 15px;
    font-size: 1.5em;
}

/* Form Styling within Tiles */
.tile form {
    display: flex;
    flex-direction: column;
}

.tile label {
    margin-bottom: 8px;
    font-weight: bold;
}

.tile input[type="date"] {
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

.tile button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
    align-self: flex-start;
}

.tile button:hover {
    background-color: #45a049;
}

/* Result Display Styling */
.tile #tarotResult,
.tile #zodiacResult {
    margin-top: 15px;
    font-weight: bold;
    color: #333;
}

/* Surveys and Things to Read Specific Styling */
.tile ul {
    list-style-type: none;
    padding: 0;
}

.tile ul li {
    margin-bottom: 10px;
}

.tile ul li a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.tile ul li a:hover {
    color: #45a049;
}

/* Footer Styling */
footer {
    background-color: #4CAF50;
    color: white;
    text-align: center;
    padding: 15px 20px;
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* Responsive Styling */
@media (max-width: 768px) {
    .tiles-container {
        padding: 15px;
        gap: 15px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .return-button {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .tile h2 {
        font-size: 1.3em;
    }

    .tile button {
        font-size: 0.9em;
        padding: 8px 12px;
    }

    .tile input[type="date"] {
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    header h1 {
        font-size: 1.3em;
        margin-bottom: 10px;
    }

    .return-button {
        width: 100%;
        text-align: center;
        padding: 10px 0;
        font-size: 1em;
    }

    .tiles-container {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 10px;
    }

    .tile h2 {
        font-size: 1.2em;
    }

    .tile button {
        width: 100%;
    }

    .tile input[type="date"] {
        font-size: 1em;
    }

    .tile #tarotResult,
    .tile #zodiacResult {
        font-size: 1em;
    }

    .tile ul li a {
        font-size: 1em;
    }

    footer {
        position: relative;
    }
}
