/* 122WH Residents Association – shared styles */
:root {
    --brand-orange: #E67E22;
    --slate-blue: #2C3E50;
    --bg-light: #F9FBFB;
    --white: #FFFFFF;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-light);
    color: var(--slate-blue);
}

/* Header */
header {
    background: var(--white);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 0.75rem;
}

header a {
    color: var(--brand-orange);
    text-decoration: none;
    font-weight: 600;
}
header a:hover {
    text-decoration: underline;
}

/* Nav links block – spacing and separators so each item is distinct */
header .nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
header .nav-links a {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
}
header .nav-links a:hover {
    background: rgba(230, 126, 34, 0.12);
}
header .nav-links span {
    color: var(--slate-blue);
    font-weight: 500;
    padding: 0.4rem 0.25rem 0.4rem 0;
    white-space: nowrap;
}

/* User dropdown (residents header) */
.user-dropdown {
    position: relative;
    display: inline-block;
    border-left: 1px solid #d0d5db;
    margin-left: 0.25rem;
    padding-left: 1rem;
}
.user-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: none;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    color: var(--brand-orange);
    font-weight: 600;
}
.user-dropdown-toggle:hover {
    background: rgba(230, 126, 34, 0.12);
}
.user-dropdown-toggle .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    vertical-align: middle;
    display: block;
}
.user-dropdown-toggle .user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.user-dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.25rem;
    border: 5px solid transparent;
    border-top-color: currentColor;
    vertical-align: middle;
}
.user-dropdown.is-open .user-dropdown-toggle::after {
    border-top-color: transparent;
    border-bottom-color: currentColor;
    margin-top: -3px;
}
/* Dropdown menu: hidden by default, pop-up only when open */
header .user-dropdown .user-dropdown-menu,
header .user-dropdown .user-dropdown-menu[hidden] {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    min-width: 160px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border: 1px solid #e5e7eb;
    padding: 0.25rem 0;
    list-style: none;
    margin: 0;
    z-index: 1001;
    display: none;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}
header .user-dropdown.is-open .user-dropdown-menu {
    display: block;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.user-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--slate-blue);
    text-decoration: none;
    font-weight: 500;
}
.user-dropdown-menu a:hover {
    background: rgba(230, 126, 34, 0.12);
    color: var(--brand-orange);
}
.user-dropdown-menu li + li {
    border-top: 1px solid #eee;
}
/* Separator between items (anchor or span that follows another item) */
header .nav-links a + a,
header .nav-links span + a,
header .nav-links a + span {
    border-left: 1px solid #d0d5db;
    padding-left: 1rem;
    margin-left: 0.25rem;
}

.nav-email {
    background: var(--brand-orange);
    color: white !important;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}
.nav-email:hover {
    opacity: 0.9;
    text-decoration: none !important;
}

/* Hero – compact for form pages */
.hero {
    background: var(--slate-blue);
    color: white;
    padding: 3rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-content-wrapper {
    display: flex;
    align-items: center;
    max-width: 1100px;
    width: 100%;
}

.hero-content-wrapper > a {
    text-decoration: none;
    line-height: 0;
}

.hero-logo {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin-right: 2rem;
    object-fit: contain;
    flex-shrink: 0;
}

.hero-text {
    text-align: left;
    max-width: 600px;
}

.hero h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1rem;
    margin: 0;
    opacity: 0.9;
}

@media (max-width: 900px) {
    .hero {
        padding: 2rem 1rem;
    }
    .hero-content-wrapper {
        flex-direction: column;
        text-align: center;
    }
    .hero-logo {
        margin-right: 0;
        margin-bottom: 1rem;
        width: 100px;
        height: 100px;
    }
    .hero-text {
        text-align: center;
    }
    .hero h1 {
        font-size: 1.35rem;
    }
}

/* Main content */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-card {
    max-width: 520px;
    margin: 0 auto;
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    border-left: 5px solid var(--brand-orange);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.page-card h1 {
    margin-top: 0;
    color: var(--slate-blue);
    font-size: 1.5rem;
}

.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    border-left: 5px solid var(--brand-orange);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.card h3 { margin-top: 0; color: var(--brand-orange); }

/* Forms */
label {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
    color: var(--slate-blue);
}
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    margin-top: 0.25rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}
input:focus {
    outline: none;
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.2);
}
button[type="submit"],
.btn-primary {
    margin-top: 1.25rem;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 20px;
    background: var(--brand-orange);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s;
}
button[type="submit"]:hover,
.btn-primary:hover {
    opacity: 0.9;
}
.btn-secondary {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f5f5f5;
    color: var(--slate-blue);
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 0.25rem;
}
.btn-secondary:hover {
    background: #eee;
    border-color: #aaa;
}

.profile-photo-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0.5rem 0 1rem;
    border: 1px solid #ccc;
    border-radius: 10px;
    overflow: hidden;
    max-width: 28rem;
}
.profile-photo-choice {
    flex: 1;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}
.profile-photo-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.profile-photo-choice span {
    display: block;
    padding: 0.6rem 0.75rem;
    text-align: center;
    font-size: 0.9rem;
    background: #f9f9f9;
    border-right: 1px solid #ccc;
    transition: background 0.15s;
}
.profile-photo-choice:last-child span {
    border-right: none;
}
.profile-photo-choice input:checked + span {
    background: var(--brand-orange);
    color: white;
    font-weight: 500;
}
.profile-photo-choice input:disabled + span {
    opacity: 0.6;
    cursor: not-allowed;
}
.profile-photo-upload-section {
    margin-top: 0.75rem;
}
.profile-photo-current-label,
.profile-photo-preview-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.errors {
    background: #ffe6e6;
    color: #a00;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.errors ul { margin: 0; padding-left: 1.25rem; }
.success {
    background: #e7f6e7;
    color: #206020;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.info {
    background: #e7f2ff;
    color: #204060;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.intro {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.debug {
    background: #f5f5f5;
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.9rem;
}
.smtp-log {
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 0.8rem;
    max-height: 200px;
    overflow: auto;
    margin: 0.5rem 0 0 0;
}

.container a,
.page-card a {
    color: var(--brand-orange);
    font-weight: 600;
}
.container a:hover,
.page-card a:hover {
    text-decoration: underline;
}

footer {
    background: var(--slate-blue);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}
footer a {
    color: var(--brand-orange);
    text-decoration: none;
    font-weight: bold;
}
footer a:hover {
    text-decoration: underline;
}

.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 700px;
}
.admin-table th,
.admin-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}
.admin-table th {
    background: #f5f7f9;
    font-weight: 600;
    color: var(--slate-blue);
}
.admin-table form {
    display: inline;
    margin-right: 0.25rem;
}
.admin-table button {
    padding: 0.25rem 0.6rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}
.btn-approve { background: #2ecc71; color: #fff; }
.btn-disable { background: #e74c3c; color: #fff; }
.btn-pending { background: #f1c40f; color: #fff; }
.tag {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.tag-pending { background: #f1c40f33; color: #7d6608; }
.tag-approved { background: #2ecc7133; color: #145a32; }
.tag-disabled { background: #e74c3c33; color: #7b241c; }

.content-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    border-left: 5px solid var(--brand-orange);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    line-height: 1.6;
}
.content-card h1 { margin-top: 0; color: var(--slate-blue); }
.content-card h2 { color: var(--brand-orange); font-size: 1.15rem; margin-top: 1.5rem; }

@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    header .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    .page-card {
        padding: 1.25rem;
    }
}

/* Message board: submit loading overlay */
.board-submit-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(44, 62, 80, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}
.board-submit-overlay .board-submit-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: board-spin 0.8s linear infinite;
}
.board-submit-overlay .board-submit-text {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
}
@keyframes board-spin {
    to { transform: rotate(360deg); }
}

/* Rooftop garden map: non-plot shapes and plot type fills (override Inkscape inline fill) */
.garden-path { fill: #9ca3af !important; }
.garden-wall { fill: #93c5fd !important; }
.garden-hedge { fill: #86efac !important; }
.garden-plot-plot { fill: #d4a574 !important; }
.garden-plot-raised-planter { fill: #a67c52 !important; }
.garden-plot-accessible-planter { fill: #7dd3fc !important; }
.garden-plot-herb-garden { fill: #4ade80 !important; }
.garden-plot-community { fill: #2dd4bf !important; }
.garden-plot-assigned { fill: var(--brand-orange) !important; }
