﻿html, body {
    height: 100%;
}

/* Base layout */
body {
    margin: 0;
    font-family: var(--font-family);
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: var(--header-bg);
    color: var(--header-text);
    display: flex;
    align-items: center;
    padding-left: 20px;
    font-size: x-large;
    box-shadow: 0 2px 4px var(--shadow);
    z-index: 1000;
}

    header .header-inner {
        max-width: 2200px;
        margin: 0 auto;
        width: 100%;
        display: flex;
        align-items: center;
    }

/* Layout container */
.container {
    display: flex;
    margin-top: 100px;
    flex: 1;
    height: calc(100vh - 100px);
    min-height: 0;
}

/* Navigation */
nav {
    position: fixed;
    top: 100px;
    left: 0;
    width: 200px;
    height: calc(100vh - 100px);
    padding: 24px 16px;
    box-sizing: border-box;
    background: var(--surface);
    color: var(--text);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    font-size: 1rem;
    line-height: 1.4;
}

    nav a {
        display: block;
        padding: 10px 12px;
        color: var(--text);
        text-decoration: none;
        border-radius: 4px;
        transition: background 0.2s ease, color 0.2s ease, border-left 0.2s ease;
        font-weight: 600;
    }

        nav a:hover,
        nav a:focus {
            background: var(--primary);
            color: var(--primary-contrast);
        }

    nav .selected,
    nav .current a {
        background: var(--secondary);
        color: var(--secondary-contrast);
        font-weight: bold;
        border-radius: 4px;
    }

    nav .current a {
        border-left: 4px solid var(--primary);
        padding-left: 8px;
        box-shadow: inset 0 0 4px var(--shadow);
    }

    nav li.static {
        min-height: 40px;
        display: flex;
        align-items: center;
        border-bottom: 1px solid var(--border);
    }

        nav li.static > a {
            display: block;
            width: 100%;
            padding: 10px 12px;
            box-sizing: border-box;
            position: relative !important;
        }

        nav li.static:last-child {
            border-bottom: none;
        }

/* Main content */
main {
    margin-left: 200px;
    height: calc(100vh - 100px);
    overflow-y: auto;
    flex: 1;
    min-width: 0;
    background: var(--surface);
    color: var(--text);
}

.main > * {
    padding: 20px 20px 0 20px;
}

/* Centering helpers */
.main-content-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .main-content-wrapper > * {
        margin: 20px 0;
    }

/* Buttons */
.primary-btn {
    background: var(--primary);
    color: var(--primary-contrast);
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px var(--shadow);
}

    .primary-btn:hover {
        background: var(--secondary);
        color: var(--secondary-contrast);
    }

/* Text inputs */
.text-input {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 8px;
    border-radius: 4px;
}

/* Theme selector */
.theme-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    padding-right: 20px;
    border-left: 1px solid var(--border);
    padding-left: 16px;
    color: var(--header-text);
}

.theme-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-right: 4px;
    color: var(--header-text);
}

.theme-option {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    align-items: center;
    justify-content: center;
}

    .theme-option:focus {
        outline: 3px solid var(--focus-ring);
        outline-offset: 3px;
    }

    .theme-option:hover .swatch {
        outline: 2px solid var(--header-text);
    }

    .theme-option:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: translateY(-1px);
        box-shadow: 0 2px 4px var(--shadow);
    }

    .theme-option.selected {
        background: rgba(255, 255, 255, 0.35);
        outline: 2px solid var(--header-text);
        outline-offset: 2px;
        transform: translateY(-1px);
        box-shadow: 0 2px 6px var(--shadow);
    }

/* Swatches */
.swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid var(--border);
    box-shadow: 0 0 2px var(--shadow);
}

.swatch-group {
    display: flex;
    gap: 2px;
    align-items: center;
    height: 16px;
}

/* Logo */
.logo {
    width: 80px;
    height: 100px;
    object-fit: contain;
    padding-right: 20px;
}

/* Centering helpers */
.center {
    text-align: center;
}

.centered-image {
    text-align: center;
    margin: 20px auto;
}

    .centered-image img {
        display: block;
        margin: 0 auto;
        max-width: 500px;
        height: auto;
        border: 8px solid var(--border);
        border-radius: 18px;
        box-shadow: 0 8px 20px var(--shadow);
    }

    .centered-image figcaption {
        margin-top: 0.5rem;
        font-size: 0.95rem;
        color: var(--text-muted);
        font-weight: 300;
        text-align: center;
    }

/* Home page */
.intro-text {
    max-width: 700px;
    margin: 0 auto 2rem auto;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text);
    font-weight: 500;
}

.home-section {
    margin: 3rem auto;
    max-width: 900px;
}

    .home-section h2 {
        text-align: center;
        margin-bottom: 1rem;
        color: var(--primary);
    }

    .home-section p {
        font-weight: 500;
    }

.home-cards {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.home-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    width: 260px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .home-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 8px var(--shadow);
    }

    .home-card h3 {
        margin-top: 0;
        color: var(--primary);
    }

/* Mobile */
@media (max-width: 768px) {
    .container {
        top: 60px;
        height: calc(100vh - 60px);
        flex-direction: column;
    }

    nav {
        width: 100%;
        height: auto;
    }

    main {
        flex: 1;
        height: calc(100vh - 60px);
    }
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    background: var(--input-bg, var(--surface, #ffffff));
    border: 1px solid var(--border, #ccc);
    padding: 0.5rem;
    border-radius: 6px;
    color: var(--text, #000);
}

.admin-page-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.admin-page-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary, #333);
}

.admin-form-group {
    margin-bottom: 1.25rem;
}

    .admin-form-group label {
        display: block;
        font-weight: 600;
        margin-bottom: 0.4rem;
    }

    .admin-form-group input,
    .admin-form-group textarea {
        width: 100%;
        padding: 0.6rem 0.75rem;
        border: 1px solid #ccc;
        border-radius: 6px;
        font-size: 1rem;
    }

.admin-save-button {
    padding: 0.7rem 1.4rem;
    background: #2a6ebb;
    color: #fff;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

    .admin-save-button:hover {
        background: #1f5a99;
    }

.admin-status {
    margin-top: 1rem;
    font-style: italic;
    color: #666;
}

/* Ensure all admin inputs match width and spacing */
.admin-form-group input,
.admin-form-group textarea,
.admin-form-group select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Add consistent spacing between fields */
.admin-form-group {
    margin-bottom: 1.5rem;
}

    /* Improve label spacing */
    .admin-form-group label {
        margin-bottom: 0.5rem;
        display: block;
        font-weight: 600;
    }

    /* Make the textarea look intentional */
    .admin-form-group textarea {
        min-height: 140px;
        line-height: 1.5;
    }

/* Status message styling */
.admin-status {
    margin-top: 1.5rem;
    font-style: italic;
    color: #555;
}

/* Improve page title spacing */
.admin-page-title {
    margin-bottom: 2rem;
}

.admin-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

    .admin-checkbox-group input[type="checkbox"] {
        width: auto;
        height: auto;
        margin: 0;
    }

    .admin-checkbox-group label {
        margin: 0;
        font-weight: 600;
    }

    .admin-checkbox-group .checkbox-wrapper {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        cursor: pointer;
    }

    .admin-checkbox-group input[type="checkbox"] {
        margin: 0;
        width: auto;
        height: auto;
    }

.spotlight-card {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem 2.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    line-height: 1.6;
}

.spotlight-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #2a2a2a;
}

.spotlight-years {
    font-size: 1.2rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 1.5rem;
}

.spotlight-photo {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.spotlight-summary {
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: #444;
}

.spotlight-fullstory {
    font-size: 1.05rem;
    color: #333;
    white-space: pre-line;
}

.error-message {
    display: block;
    margin-top: 1rem;
    padding: 1rem;
    background: #ffecec;
    border: 1px solid #ffb3b3;
    border-radius: 6px;
    color: #b30000;
    font-weight: 600;
}

.whats-new {
    margin: 3rem auto;
    max-width: 900px;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.whats-new-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.whats-new-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .whats-new-list li {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid #eee;
    }

    .whats-new-list .date {
        font-weight: 600;
        color: #2a6ebb;
        margin-right: 0.5rem;
    }

    .whats-new-list .update {
        color: #333;
    }

/*----------------Directory----------------------*/
.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.directory-card {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    background: #fff;
}

    .directory-card h3 {
        margin-top: 0;
    }

.relationship {
    font-style: italic;
    color: #666;
}

.location {
    margin-bottom: 10px;
    color: #444;
}

.directory-details-card p {
    margin-bottom: 10px;
}

.card {
    border-radius: 8px;
}

.form-label {
    font-weight: 600;
    margin-bottom: 4px;
}

#MainContent_txtSearch,
#MainContent_txtCity,
#MainContent_txtState,
#MainContent_ddlRelationship {
    height: 38px;
}

.search-card {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
}

    .search-card h2 {
        font-size: 1.5rem;
        font-weight: 600;
    }

/* This centers the entire page content area (to the right of the nav) */
.content-inner {
    max-width: 1000px; /* adjust to taste */
    margin: 0 auto; /* centers the content */
}

/* Lightbox Overlay */
.lightbox {
    display: none; /* critical */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    color: white;
    font-size: 40px;
    cursor: pointer;
    user-select: none;
}

.lightbox-close {
    top: 20px;
    right: 30px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

    .lightbox-prev:hover,
    .lightbox-next:hover,
    .lightbox-close:hover {
        color: #ccc;
    }