/* Member dashboard-specific styles only — global body/box-sizing/font
   rules are handled by the real theme (theme.css / custom.css), which
   load before this file, so this file doesn't fight with them. */

/* --- Login page --- */
body.member-login-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.login-box { background: white; padding: 2.5rem; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); width: 320px; }
.login-box h1 { font-size: 1.3rem; margin-top: 0; }
.login-box label { display: block; margin-top: 1rem; font-size: 0.9rem; font-weight: 600; }
.login-box input { width: 100%; padding: 0.6rem; margin-top: 0.3rem; border: 1px solid #ccc; border-radius: 4px; }
.login-box button { margin-top: 1.5rem; width: 100%; padding: 0.7rem; background: #3d7ab5; color: white; border: none; border-radius: 4px; font-weight: 600; cursor: pointer; }
.login-box .error { color: #b00020; background: #fdecea; padding: 0.6rem; border-radius: 4px; font-size: 0.9rem; }

/* --- Dashboard layout --- */
.member-page { display: flex; max-width: 1100px; margin: 2rem auto; gap: 2rem; padding: 0 1.5rem; align-items: flex-start; }
.member-sidebar { background: #3d7ab5; color: white; border-radius: 10px; padding: 1.8rem 1.5rem; width: 220px; flex-shrink: 0; }
.member-sidebar-header { display: flex; align-items: center; justify-content: space-between; }
.member-sidebar h2 { font-size: 1.2rem; margin: 0 0 0.2rem; color: white !important; font-weight: 700; }
.member-sidebar-paid-until { margin: 0 0 1.2rem; font-size: 0.85rem; color: white; }
.member-nav-toggle {
    display: none; background: none; border: none; color: white; font-size: 1.3rem;
    cursor: pointer; padding: 0.3rem 0.5rem;
}
.member-sidebar nav { display: flex; flex-direction: column; gap: 0.2rem; }
.member-sidebar nav a { color: white; text-decoration: none; padding: 0.6rem 0.7rem; border-radius: 6px; font-weight: 500; }
.member-sidebar nav a:hover { background: rgba(255,255,255,0.12); }
.member-sidebar nav a.active { background: rgba(0,0,0,0.2); font-weight: 700; }
.member-content { flex: 1; background: white; border-radius: 10px; padding: 1.8rem 2rem 2rem; }
.member-content h1 { margin: -0.3rem 0 1rem; line-height: 1; padding-top: 0; }

/* --- Forms --- */
.member-form label { display: block; margin-top: 1rem; font-weight: 600; font-size: 0.9rem; }
.member-form input, .member-form textarea {
    width: 100%; padding: 0.6rem; margin-top: 0.3rem; border: 1px solid #ccc; border-radius: 4px; font-family: inherit;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.hint { color: #666; font-size: 0.85rem; }
.errors { background: #fdecea; color: #b00020; padding: 0.8rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
.success { background: #e3f5e6; color: #1a7a2e; padding: 0.8rem 1rem; border-radius: 4px; }
.notice { background: #fff3cd; color: #8a6500; padding: 0.8rem 1rem; border-radius: 4px; }

.profile-photo-row { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 1.5rem; }
.profile-photo { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; }
.profile-photo-placeholder { display: flex; align-items: center; justify-content: center; background: #eee; color: #999; font-size: 0.8rem; }

/* --- Buttons --- */
.button, button {
    background: #3d7ab5; color: white; border: none; padding: 0.6rem 1.3rem; border-radius: 4px;
    cursor: pointer; text-decoration: none; display: inline-block; font-size: 0.9rem; font-weight: 600; margin-top: 1.2rem;
}
.button-cancel {
    background: #3d7ab5; color: white; border: none; padding: 0.4rem 1rem; border-radius: 4px;
    cursor: pointer; font-size: 0.85rem; font-weight: 600; margin-top: 0;
}

/* --- My Events table --- */
.member-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.member-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.member-table th { text-align: left; padding: 0.6rem 0; border-bottom: 2px solid #eee; font-size: 0.85rem; color: #666; text-transform: uppercase; white-space: nowrap; }
/* vertical-align: top (rather than the default middle) so the Cancel
   button's top edge lines up with the event name and first line of
   date/time, instead of centering against whatever the tallest
   wrapped cell in the row happens to be. */
.member-table td { padding: 0.9rem 0.5rem 0.9rem 0; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.member-table td .btn { margin-top: 0; }

/* --- Event attendee list (public-facing event-detail.php) --- */
.attendee-box { margin-top: 1.5rem; padding: 1.2rem; background: #f4f5f7; border-radius: 8px; }
.attendee-box h2 { font-size: 1.1rem; margin-top: 0; }
.attendee-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.4rem; }
.attendee-list li { background: white; padding: 0.4rem 0.7rem; border-radius: 4px; font-size: 0.9rem; }

/* ============================================================
   RESPONSIVE — tablets and phones. This is the main fix for
   pages being cut off on iPad/iPhone: the dashboard layout was
   a fixed-width flex row (sidebar + content) with no way to
   shrink or stack, which forces horizontal overflow on narrow
   screens. Below ~900px the sidebar moves above the content
   instead of sitting beside it.
   ============================================================ */
@media (max-width: 900px) {
    .member-page { flex-direction: column; padding: 0 1rem; gap: 1rem; }
    .member-sidebar { width: 100%; box-sizing: border-box; }
    .member-nav-toggle { display: block; }
    .member-sidebar h2 { margin-bottom: 0; }
    .member-sidebar nav {
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        margin-top: 0;
        transition: max-height 0.2s ease, margin-top 0.2s ease;
    }
    .member-sidebar.member-nav-open nav { max-height: 300px; margin-top: 1rem; }
    .member-content { width: 100%; box-sizing: border-box; padding: 1.5rem; }
}

@media (max-width: 600px) {
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .profile-photo-row { flex-direction: column; align-items: flex-start; }
    .login-box { width: 100%; max-width: 320px; }
    .member-content h1 { font-size: 1.6rem; }

    /* Tighter padding on My Events so the Action column (the Cancel
       button) isn't pushed past the edge of the screen on phones. */
    .member-content { padding: 1rem; }
    .member-table td { padding: 0.7rem 0.3rem 0.7rem 0; font-size: 0.9rem; }
    .member-table td .btn { padding: 0.3rem 0.55rem; font-size: 0.78rem; }
}
