/* ============================================
   Munro Tracker — Styles
   ============================================ */

/* Hide theme header/footer on pages containing the tracker (Twenty Twenty-Five FSE) */
body:has(#munro-tracker-wrap) header,
body:has(#munro-tracker-wrap) footer,
body:has(#munro-tracker-wrap) .wp-block-template-part,
body:has(#munro-tracker-wrap) .wp-site-blocks > .wp-block-group:first-child,
body:has(#munro-tracker-wrap) .wp-site-blocks > .wp-block-group:last-child {
    display: none !important;
}

/* Un-hide the main content group (contains the page content) */
body:has(#munro-tracker-wrap) .wp-site-blocks > .wp-block-group:has(#munro-tracker-wrap) {
    display: block !important;
}

body:has(#munro-tracker-wrap) {
    padding: 0 !important;
    margin: 0 !important;
}

body:has(#munro-tracker-wrap) .wp-site-blocks,
body:has(#munro-tracker-wrap) .entry-content,
body:has(#munro-tracker-wrap) .wp-block-post-content,
body:has(#munro-tracker-wrap) .wp-block-post-content > *,
body:has(#munro-tracker-wrap) .is-layout-constrained {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}

#munro-tracker-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #222;
    max-width: 100%;
}

/* ---- Account bar ---- */
#munro-account-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111;
    color: #ccc;
    padding: 0.4rem 1.25rem;
    font-size: 0.82rem;
}

#munro-account-links {
    display: flex;
    gap: 1.25rem;
}

#munro-account-links a {
    color: #aaa;
    text-decoration: none;
}

#munro-account-links a:hover {
    color: #fff;
}

/* ---- Stats bar ---- */
#munro-stats-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #1a3c2e;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 6px 6px 0 0;
    font-size: 1.1rem;
    flex-wrap: wrap;
}

#munro-progress-pct {
    opacity: 0.75;
    font-size: 0.95rem;
}

#munro-filter-wrap {
    margin-left: auto;
    display: flex;
    gap: 1rem;
    font-size: 0.95rem;
}

#munro-filter-wrap label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}

/* ---- Map ---- */
#munro-map {
    height: 550px;
    width: 100%;
    border: 1px solid #ccc;
}

/* ---- Pin icons ---- */
.munro-pin div {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.35);
}

.munro-pin--climbed div {
    background-color: #2e8b57;
}

.munro-pin--not-climbed div {
    background-color: #cc2200;
}

/* ---- Status badges ---- */
.munro-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
}

.munro-status.climbed {
    background: #d4edda;
    color: #155724;
}

.munro-status.not-climbed {
    background: #e9ecef;
    color: #555;
}

/* ---- Popup ---- */
.leaflet-popup-content button.munro-popup-edit {
    margin-top: 8px;
    padding: 4px 10px;
    background: #1a3c2e;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

/* ---- Modal ---- */
#munro-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#munro-modal {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    width: 95%;
    max-width: 520px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    max-height: 90vh;
    overflow-y: auto;
}

#munro-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555;
    line-height: 1;
}

#munro-modal h2 {
    margin: 0 0 0.25rem;
    font-size: 1.4rem;
    color: #1a3c2e;
}

#munro-modal-meta {
    color: #666;
    margin: 0 0 1rem;
    font-size: 0.95rem;
}

#munro-log-form label {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    gap: 0.3rem;
}

#munro-log-form input[type="text"],
#munro-log-form input[type="date"],
#munro-log-form input[type="number"],
#munro-log-form textarea {
    font-size: 0.95rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-weight: normal;
    color: #222;
}

#munro-log-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#munro-log-form > label:first-of-type {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1rem;
}

#munro-modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

#munro-save-status {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #2e8b57;
    min-height: 1.2em;
}

/* ---- Buttons ---- */
.munro-btn {
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
}

.munro-btn-save {
    background: #1a3c2e;
    color: #fff;
}

.munro-btn-save:hover {
    background: #2e8b57;
}

.munro-btn-cancel {
    background: #e9ecef;
    color: #333;
}

.munro-btn-small {
    padding: 0.25rem 0.7rem;
    font-size: 0.82rem;
    background: #1a3c2e;
    color: #fff;
    border-radius: 3px;
}

.munro-btn-small:hover {
    background: #2e8b57;
}

/* ---- Log Table ---- */
#munro-log-wrap {
    margin-top: 2rem;
    padding: 0 1.25rem;
}

#munro-log-wrap h2 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: #1a3c2e;
}

#munro-search {
    width: 100%;
    max-width: 360px;
    padding: 0.4rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    font-family: inherit;
}

#munro-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#munro-log-table th,
#munro-log-table td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

#munro-log-table th {
    background: #1a3c2e;
    color: #fff;
    user-select: none;
    white-space: nowrap;
}

#munro-log-table th:hover {
    background: #2e8b57;
}

#munro-log-table tr.row-climbed td {
    background: #f6fdf8;
}

#munro-log-table tr:hover td {
    background: #edf7f1;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    #munro-map { height: 350px; }
    #munro-stats-bar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    #munro-filter-wrap { margin-left: 0; }
    #munro-log-table th:nth-child(3),
    #munro-log-table td:nth-child(3) { display: none; }
}

/* ============================================
   Auth Pages (login / profile)
   ============================================ */

/* Hide theme chrome on auth pages */
body:has(#munro-auth-wrap) header,
body:has(#munro-auth-wrap) footer,
body:has(#munro-auth-wrap) .wp-block-template-part,
body:has(#munro-auth-wrap) .wp-site-blocks > .wp-block-group:first-child,
body:has(#munro-auth-wrap) .wp-site-blocks > .wp-block-group:last-child {
    display: none !important;
}

body:has(#munro-auth-wrap) .wp-site-blocks > .wp-block-group:has(#munro-auth-wrap) {
    display: block !important;
}

body:has(#munro-auth-wrap) {
    padding: 0 !important;
    margin: 0 !important;
}

body:has(#munro-auth-wrap) .wp-site-blocks,
body:has(#munro-auth-wrap) .entry-content,
body:has(#munro-auth-wrap) .wp-block-post-content,
body:has(#munro-auth-wrap) .wp-block-post-content > *,
body:has(#munro-auth-wrap) .is-layout-constrained {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}

/* Full-viewport wrapper */
#munro-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.55)),
        url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920&q=80')
        center center / cover no-repeat fixed;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

/* Profile page: plain dark background instead of photo */
#munro-auth-wrap.munro-auth-plain {
    background: #0d1f17;
}

/* Card */
#munro-auth-box {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.55);
    color: #fff;
}

/* Logo / icon */
#munro-auth-logo {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #7ec8a4;
}

/* Title */
#munro-auth-title {
    font-size: 1.9rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.2rem;
    color: #fff;
    letter-spacing: -0.02em;
}

/* Subtitle */
#munro-auth-subtitle {
    font-size: 0.9rem;
    text-align: center;
    color: rgba(255,255,255,0.65);
    margin: 0 0 1.5rem;
}

/* Tabs */
#munro-auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}

.munro-auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.55rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    background: transparent;
    transition: background 0.15s, color 0.15s;
}

.munro-auth-tab.active {
    background: #1a3c2e;
    color: #fff;
}

.munro-auth-tab:hover:not(.active) {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

/* Error / success messages */
.munro-auth-error {
    background: rgba(220, 53, 69, 0.25);
    border: 1px solid rgba(220,53,69,0.5);
    color: #ffb3bb;
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.munro-auth-success {
    background: rgba(46, 139, 87, 0.25);
    border: 1px solid rgba(46,139,87,0.5);
    color: #a8f0c6;
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

/* Form */
.munro-auth-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.munro-auth-form label {
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    margin-bottom: 0.9rem;
    gap: 0.3rem;
}

.munro-auth-hint {
    font-weight: 400;
    color: rgba(255,255,255,0.45);
}

.munro-auth-form input[type="email"],
.munro-auth-form input[type="password"],
.munro-auth-form input[type="text"] {
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.munro-auth-form input:focus {
    border-color: #2e8b57;
    background: rgba(255,255,255,0.15);
}

.munro-auth-form input::placeholder {
    color: rgba(255,255,255,0.3);
}

/* Primary button */
.munro-auth-btn {
    display: block;
    width: 100%;
    padding: 0.7rem;
    background: #1a3c2e;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    margin-top: 0.25rem;
    transition: background 0.15s;
}

.munro-auth-btn:hover {
    background: #2e8b57;
    color: #fff;
}

/* Secondary (outline) button variant */
.munro-auth-btn--secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.8);
    margin-top: 0.6rem;
}

.munro-auth-btn--secondary:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Actions row (profile page Save + Back) */
.munro-auth-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

/* Responsive auth card */
@media (max-width: 480px) {
    #munro-auth-box {
        padding: 2rem 1.25rem;
    }
}
