/* =========================================================
   COMMUNITY MEMBERSHIP SYSTEM — FULL STYLES
   Clean / Neutral / Oxygen-safe
========================================================= */

/* ------------------------------
   VARIABLES (easy edits later)
------------------------------ */
:root {
  --cms-bg: #ffffff;
  --cms-border: #e5e7eb;
  --cms-shadow: 0 10px 30px rgba(0,0,0,0.08);
  --cms-radius: 14px;

  --cms-text: #1f2937;
  --cms-muted: #6b7280;

  --cms-primary: #3b82f6;
  --cms-primary-hover: #2563eb;

  --cms-danger: #dc2626;
  --cms-success: #16a34a;

  --cms-input-bg: #ffffff;
  --cms-input-border: #d1d5db;
}

/* =========================================================
   BASE WRAPPERS
========================================================= */

.cms-card {
  background: var(--cms-bg);
  border-radius: var(--cms-radius);
  box-shadow: var(--cms-shadow);
  padding: 28px;
  margin-bottom: 32px;
  color: var(--cms-text);
}

.cms-card-form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cms-card h2,
.cms-card h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-weight: 600;
  width: 100%;
  max-width: 720px;
}

.cms-section {
  margin-bottom: 28px;
}

.cms-muted {
  color: var(--cms-muted);
  font-size: 14px;
  width: 100%;
  max-width: 720px;
}

/* =========================================================
   FORMS — GENERAL
========================================================= */

form.cms-post {
    width: 100%;
    max-width: 720px;
}

.cms-card label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}

.cms-card input[type="text"],
.cms-card input[type="email"],
.cms-card input[type="password"],
.cms-card textarea,
.cms-card select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--cms-input-border);
  background: var(--cms-input-bg);
  font-size: 15px;
  margin-bottom: 16px;
}

.cms-card textarea {
  min-height: 90px;
  resize: vertical;
}

.cms-card input:focus,
.cms-card textarea:focus {
  outline: none;
  border-color: var(--cms-primary);
}

.cms-checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  margin-bottom: 8px;
}

.cms-checkbox-group input[type="checkbox"] {
  width: 18px!important;
  height: 18px!important;
}

/* =========================================================
   BUTTONS
========================================================= */

.cms-btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
  width:100%;
}

.cms-btn-primary {
  background: var(--cms-primary);
  color: #fff;
}

.cms-btn-primary:hover {
  background: var(--cms-primary-hover);
}

.cms-btn-danger {
  color: var(--cms-danger);
  border: 1px solid var(--cms-danger);
  background: #fff;
}

.cms-btn-danger:hover {
  color: #fff;
  border: 1px solid var(--cms-danger);
  background: var(--cms-danger);
}


.cms-btn-outline {
  background: transparent;
  border: 1px solid var(--cms-input-border);
  color: var(--cms-text);
}

.update-settings-save {
    background-color: #066aab;
    padding: 12px;
    max-width: 150px;
    font-size: 17px;
    margin-top: -20px !important;
    margin-bottom: 35px;
}

/* =========================================================
   APPLICATION FORM (WPFORMS)
========================================================= */

.wpforms-container.cms-application {
  max-width: 720px;
  margin: 0 auto;
}

.wpforms-container.cms-application .wpforms-form {
  background: var(--cms-bg);
  padding: 32px;
  border-radius: var(--cms-radius);
  box-shadow: var(--cms-shadow);
}

.wpforms-container.cms-application .wpforms-field {
  margin-bottom: 18px;
}

.wpforms-container.cms-application .wpforms-error {
  color: var(--cms-danger);
  font-size: 14px;
  margin-top: 6px;
}

/* =========================================================
   ADMIN DASHBOARD — APPLICATIONS
========================================================= */

.community-admin-wrap {
  max-width: 1200px;
  margin: 0 auto;
}

.community-admin-scroll-container {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 20px;
  margin-bottom: 32px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.community-admin-scroll-container::-webkit-scrollbar {
  height: 8px;
}

.community-admin-scroll-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.community-admin-scroll-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.community-admin-scroll-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.community-admin-card {
  background: var(--cms-bg);
  border-radius: var(--cms-radius);
  box-shadow: var(--cms-shadow);
  padding: 24px;
  min-width: 320px;
  max-width: 320px;
  flex-shrink: 0;
}

.community-admin-card h3 {
  margin: 0 0 10px;
}

.community-admin-meta {
  font-size: 14px;
  color: var(--cms-muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.community-admin-actions {
  display: grid;
  grid-template-columns: 58% 38%;
  gap: 12px;
  margin-top: 16px;
}

/* =========================================================
   USER DASHBOARD — DIRECTORY SETTINGS
========================================================= */

.community-user-card {
  background: var(--cms-bg);
  border-radius: var(--cms-radius);
  box-shadow: var(--cms-shadow);
  padding: 28px;
  margin-bottom: 36px;
}

.community-user-card h3 {
  margin-top: 0;
}

.community-user-card h4 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
}

.community-user-card input[type="text"],
.community-user-card input[type="email"],
.community-user-card input[type="tel"] {
  width: 100%;
  display: block;
  box-sizing: border-box;
}

.community-user-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 20px;
}

.community-user-grid > div {
  width: 100%;
}

.community-user-grid input {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .community-user-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   LOGIN FORM
========================================================= */

.cms-login-wrap {
  max-width: 420px;
  margin: 0 auto;
}

/* Dashboard form (wider than login) */
.cms-dashboard-wrap {
  max-width: 100%;
}

.cms-login-wrap .login-remember {
  margin-bottom: 16px;
}

.cms-login-wrap .login-submit {
  margin-top: 12px;
}

.cms-login-wrap .forgot-link {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  text-align: center;
}

/* Dashboard-specific styling */
.cms-dashboard-wrap .cms-section {
  margin-bottom: 28px;
}

.cms-dashboard-wrap .cms-section h4 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--cms-text);
}

.cms-dashboard-wrap .cms-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cms-dashboard-wrap .cms-checkbox-group label {
  display: flex;
  align-items: center;
  font-weight: normal;
  cursor: pointer;
}

.cms-dashboard-wrap .cms-checkbox-group input[type="checkbox"] {
  margin-right: 8px;
}

/* =========================================================
   FORGOT PASSWORD
========================================================= */

.cms-forgot-wrap {
  max-width: 420px;
  margin: 0 auto;
}

.cms-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: var(--cms-success);
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.cms-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--cms-danger);
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 20px;
}

/* =========================================================
   RESPONSIVE SAFETY
========================================================= */

@media (max-width: 480px) {
  .cms-card,
  .community-admin-card,
  .community-user-card {
    padding: 20px;
  }
}

/* =========================================================
   MEMBER DIRECTORY
========================================================= */

.community-directory-wrap {
  max-width: 1200px;
  margin: 0 auto;
}

.community-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

/* Custom scrollbar styling */
.community-directory-grid::-webkit-scrollbar {
  width: 8px;
}

.community-directory-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.community-directory-grid::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.community-directory-grid::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.community-directory-card {
  background: var(--cms-bg);
  border-radius: var(--cms-radius);
  box-shadow: var(--cms-shadow);
  padding: 24px;
  min-height: 200px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.community-directory-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.12);
}

.community-directory-card h3,
.community-directory-card h4 {
  margin: 0 0 16px;
  font-weight: 600;
  font-size: 17px;
}

.community-directory-meta {
  font-size: 14px;
  line-height: 1.6;
}

.directory-contact-item {
  margin-bottom: 12px;
}

.directory-contact-item:last-child {
  margin-bottom: 0;
}

.directory-contact-item strong {
  color: var(--cms-text);
  display: block;
  margin-bottom: 4px;
}

.directory-contact-item a {
  color: #1456c1;
  text-decoration: none;
}

.directory-contact-item a:hover {
  text-decoration: underline;
}

#directory-grid::-webkit-scrollbar {
  width: 8px;
}

#directory-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#directory-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

#directory-grid::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}


@media (max-width: 1024px) {
  .community-directory-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .community-directory-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   STYLED ALERTS
========================================================= */

.cms-alert {
    position: fixed !important;
    top: 65px !important;
    right: 20px !important;
    z-index: 99999999999999999999999999999999999999999999999999999999;
    min-width: 300px;
    max-width: 500px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
    opacity: 1;
    transition: opacity 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cms-alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}

.cms-alert-icon {
    font-size: 24px;
    line-height: 1;
}

.cms-alert-message {
    flex: 1;
    font-size: 15px;
    color: #374151;
    line-height: 1.4;
}

.cms-alert-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.cms-alert-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.cms-alert-error {
    border-left: 4px solid #dc2626;
}

.cms-alert-error .cms-alert-icon {
    color: #dc2626;
}

.cms-alert-success {
    border-left: 4px solid #10b981;
}

.cms-alert-success .cms-alert-icon {
    color: #10b981;
}

.cms-alert-info {
    border-left: 4px solid #2d7ef7;
}

.cms-alert-info .cms-alert-icon {
    color: #2d7ef7;
}

/* =========================================================
   STYLED CONFIRMATION DIALOG
========================================================= */

.cms-confirm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999999999999999999999999999999999999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cms-confirm-content {
    background: #fff;
    border-radius: 14px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.cms-confirm-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.cms-confirm-message {
    font-size: 16px;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 24px;
    text-wrap: balance;
}

.cms-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.cms-confirm-btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cms-confirm-yes {
    background: #2d7ef7;
    color: #fff;
}

.cms-confirm-yes:hover {
    background: #1d6de8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 126, 247, 0.3);
}

.cms-confirm-no {
    background: #f3f4f6;
    color: #374151;
}

.cms-confirm-no:hover {
    background: #e5e7eb;
}

/* =========================================================
   LIVE VALIDATION STYLES
========================================================= */

.cms-validation-error {
    color: #dc2626;
    font-size: 14px;
    margin-top: 8px;
    animation: errorSlideIn 0.3s ease;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cms-checkbox-group label.error {
    color: #dc2626 !important;
}

.cms-checkbox-group input[type="checkbox"].error {
    border-color: #dc2626;
    outline: 2px solid rgba(220, 38, 38, 0.2);
}

/* =====================================================
   SCROLL HEADER & ARROWS
===================================================== */
.cms-scroll-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.cms-scroll-header h2,
.cms-scroll-header h3 {
  margin: 0;
  flex: 1;
  text-wrap: balance;
}

.cms-scroll-arrows {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cms-scroll-arrows button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #566d8f;
  background: #fff;
  color: #566d8f;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1;
   touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.cms-scroll-arrows button:hover {
  background: #f1f5f9;
  border-color: #3d5070;
  color: #3d5070;
}

.cms-scroll-arrows button.cms-scroll-arrow-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}


@media (max-width: 768px) {
  .cms-scroll-prev span, .cms-scroll-next span,
  .mnb-scroll-prev span, .mnb-scroll-next span,
  .cal-scroll-prev span, .cal-scroll-next span {
    display: none;
  }
  .cms-scroll-prev::after, .mnb-scroll-prev::after, .cal-scroll-prev::after {
    content: '◀';
  }
  .cms-scroll-next::after, .mnb-scroll-next::after, .cal-scroll-next::after {
    content: '▶';
  }
}
/* =========================================================
   MEMBER DIRECTORY — FILTER BAR
========================================================= */

.community-directory-filters {
    width: 100%;
    margin-bottom: 8px;
}

.community-directory-filters input[type="text"],
.community-directory-filters select {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* Cat dropdown + print button row */
.directory-cat-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.directory-cat-row #directory-cat {
    flex: 1;
    min-width: 0;
}

#directory-print-btn {
    flex-shrink: 0;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--cms-border);
    background: #fff;
    color: var(--cms-text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: background 0.15s, border-color 0.15s;
    margin-bottom: 24px;
}

#directory-print-btn:hover {
    background: var(--cms-surface, #f8fafc);
    border-color: var(--cms-primary);
    color: var(--cms-primary);
}

/* =========================================================
   DIRECTORY CATEGORY FILTER DROPDOWN
========================================================= */

#directory-cat {
    padding: 14px 18px;
    width: 100%;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    cursor: pointer;
    background-color: #ffffff;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23757575' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    font-weight: 500;
    font-size: 17px;
    color: #757575;
    box-sizing: border-box;
}

#directory-cat,
#directory-cat::picker(select) {
    appearance: base-select !important;
}

#directory-cat::picker(select) {
    cursor: pointer;
    background-color: #ffffff;
    border-radius: 8px 8px 12px 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border: none;
    color: #757575;
    font-weight: 500;
    font-size: 17px;
}

#directory-cat::picker-icon {
    display: none;
}

#directory-cat option {
    font-size: 17px;
    color: #757575;
    padding: 8px 15px;
}

/* =========================================================
   DIRECTORY ENTRIES — CATEGORY BADGE
========================================================= */

.cms-de-badge {
    display:        inline-block;
    float:          right;
    margin:         -4px -4px 10px 8px;
    padding:        3px 10px;
    border-radius:  999px;
    font-size:      11px;
    font-weight:    600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color:          #fff;
    background:     var(--cms-primary);
    white-space:    nowrap;
}

/* =========================================================
   DIRECTORY ENTRIES — ADMIN FORM
========================================================= */

.cms-de-card {
    position: relative;
}

/* Cancel button */
.cms-btn-secondary {
    background:  transparent             !important;
    color:       var(--cms-text)         !important;
    border:      1px solid var(--cms-border) !important;
}
.cms-btn-secondary:hover {
    background:  var(--cms-border)       !important;
}

/* Edit form — full width, below scroll container */
.cms-de-edit-form {
    width:      100%;
    margin-top: 16px;
}

/* Form grid layout */
.cms-de-form-grid {
    display:               grid;
    grid-template-columns: 1fr 1fr;
    gap:                   16px;
}

.cms-de-field-full {
    grid-column: 1 / -1;
}

/* Phone / Email rows: label + value side by side */
.cms-de-phone-row {
    display:               grid;
    grid-template-columns: 1fr 1.5fr;
    gap:                   10px;
    grid-column:           1 / -1;
    align-items:           end;
}

/* Form labels */
.cms-de-form label {
    display:       block;
    font-size:     13px;
    font-weight:   600;
    color:         var(--cms-text);
    margin-bottom: 5px;
}

/* Inputs, selects, textareas */
.cms-de-form input[type="text"],
.cms-de-form input[type="url"],
.cms-de-form input[type="email"],
.cms-de-form select,
.cms-de-form textarea {
    width:         100%;
    padding:       9px 12px;
    border:        1px solid var(--cms-border);
    border-radius: 8px;
    font-size:     14px;
    font-family:   inherit;
    color:         var(--cms-text);
    background:    var(--cms-bg);
    box-sizing:    border-box;
    font-weight:   600;
}

.cms-de-form input[type="text"]::placeholder,
.cms-de-form input[type="url"]::placeholder,
.cms-de-form input[type="email"]::placeholder,
.cms-de-form select::placeholder,
.cms-de-form textarea::placeholder {
    font-weight:   200;
}


.cms-de-form input:focus,
.cms-de-form select:focus,
.cms-de-form textarea:focus {
    outline:      none;
    border-color: var(--cms-primary);
}

@media (max-width: 600px) {
    .cms-de-form-grid,
    .cms-de-phone-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   DIRECTORY ENTRIES — ADD / TOGGLE BUTTONS  (from OB)
========================================================= */

.cms-de-toggle-add-btn {
    background:    var(--cms-primary) !important;
    border-color:  var(--cms-primary) !important;
    color:         #fff               !important;
    margin-left:   25%;
    margin-right:  25%;
    width:         50%;
    text-wrap:     balance;
    font-size:     18px;
}

.add-entry {
    background:    var(--cms-primary) !important;
    border-color:  var(--cms-primary) !important;
    color:         #fff               !important;
    text-wrap:     balance;
    margin-left:   25%;
    margin-right:  25%;
    width:         50%;
}

form.cms-de-form {
    width: 100%;
}
