/**
 * P4U Members — Public Styles
 */

.p4u-login-form-wrap,
.p4u-reset-form-wrap {
    max-width: 420px;
    margin: 2em auto;
    padding: 2em;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.p4u-form-field {
    margin-bottom: 1.2em;
}

.p4u-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4em;
    font-size: 14px;
    color: #333;
}

.p4u-form-field input[type="text"],
.p4u-form-field input[type="password"],
.p4u-form-field input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.p4u-form-field input[type="text"]:focus,
.p4u-form-field input[type="password"]:focus,
.p4u-form-field input[type="email"]:focus {
    outline: none;
    border-color: #9ba88d;
    box-shadow: 0 0 0 2px rgba(155, 168, 141, 0.2);
}

.p4u-form-remember label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    font-size: 14px;
}

.p4u-login-button {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    background: #9ba88d;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.p4u-login-button:hover {
    background: #6b7b5e;
}

.p4u-form-links {
    margin-top: 1em;
    text-align: center;
    font-size: 13px;
}

.p4u-form-links a {
    color: #a04060;
    text-decoration: none;
}

.p4u-form-links a:hover {
    text-decoration: underline;
}

.p4u-login-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 1.2em;
    font-size: 14px;
}

.p4u-reset-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 1.2em;
    font-size: 14px;
}

.p4u-restricted-message {
    max-width: 600px;
    margin: 3em auto;
    padding: 2em;
    text-align: center;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    font-size: 16px;
}

.p4u-logged-in {
    text-align: center;
    padding: 1em;
    font-size: 15px;
}

.p4u-logged-in a {
    color: #a04060;
}

.p4u-subscribe-form-wrap {
    max-width: 640px;
    margin: 2em auto;
    padding: 2em;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.p4u-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.2em;
}

.p4u-form-grid .p4u-form-field-full {
    grid-column: 1 / -1;
}

.p4u-form-field input[type="date"],
.p4u-form-field input[type="tel"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.p4u-form-field input[type="date"]:focus,
.p4u-form-field input[type="tel"]:focus {
    outline: none;
    border-color: #9ba88d;
    box-shadow: 0 0 0 2px rgba(155, 168, 141, 0.2);
}

@media (max-width: 480px) {
    .p4u-form-grid {
        grid-template-columns: 1fr;
    }
}

.p4u-subscribe-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 14px 18px;
    border-radius: 4px;
    font-size: 15px;
}

.p4u-required {
    color: #a04060;
}

.p4u-form-note {
    margin-top: 0.8em;
    color: #666;
    text-align: center;
}

/* ── Category Posts Shortcode ── */

.p4u-category-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

.p4u-post-card {
    display: flex;
    flex-direction: row;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s, transform 0.2s;
}

.p4u-post-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
}

.p4u-post-thumb {
    flex: 0 0 280px;
    overflow: hidden;
    display: block;
}

.p4u-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.p4u-post-card:hover .p4u-post-image {
    transform: scale(1.04);
}

.p4u-post-content {
    flex: 1;
    padding: 1.5em;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.p4u-post-title {
    margin: 0 0 0.4em;
    font-size: 1.3em;
    line-height: 1.3;
}

.p4u-post-title a {
    color: #333;
    text-decoration: none;
}

.p4u-post-title a:hover {
    color: #a04060;
}

.p4u-post-meta {
    display: flex;
    gap: 1em;
    font-size: 0.85em;
    color: #888;
    margin-bottom: 0.6em;
}

.p4u-post-excerpt {
    font-size: 0.95em;
    color: #555;
    line-height: 1.6;
    margin-bottom: 0.8em;
}

.p4u-read-more {
    display: inline-block;
    font-size: 0.9em;
    font-weight: 600;
    color: #a04060;
    text-decoration: none;
}

.p4u-read-more:hover {
    text-decoration: underline;
}

/* Restricted post cards */
.p4u-post-restricted {
    background: #fafafa;
    border-left: 4px solid #9ba88d;
}

.p4u-post-restricted .p4u-post-title {
    color: #666;
}

.p4u-lock-icon {
    font-size: 0.9em;
}

.p4u-restricted-notice {
    font-size: 0.85em;
    color: #888;
    margin: 0.3em 0 0;
}

.p4u-restricted-notice a {
    color: #a04060;
    font-weight: 600;
    text-decoration: none;
}

.p4u-restricted-notice a:hover {
    text-decoration: underline;
}

.p4u-no-posts {
    text-align: center;
    color: #888;
    font-size: 1em;
    padding: 2em 0;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .p4u-post-card {
        flex-direction: column;
    }
    .p4u-post-thumb {
        flex: 0 0 auto;
        max-height: 220px;
    }
}

/* ══════════════════════════════════════
   Members Dashboard
   ══════════════════════════════════════ */

.p4u-dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1em 0;
}

/* Welcome Section */
.p4u-dash-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5em;
    background: linear-gradient(135deg, #9ba88d 0%, #6b7b5e 100%);
    color: #fff;
    padding: 2em 2.5em;
    border-radius: 12px;
    margin-bottom: 2em;
}

.p4u-dash-welcome h2 {
    margin: 0 0 0.3em 0;
    font-size: 1.6em;
    color: #fff !important;
}

.p4u-dash-welcome p {
    margin: 0;
    opacity: 0.92;
    font-size: 1.05em;
    line-height: 1.5;
    color: #fff;
}

.p4u-dash-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.p4u-dash-btn-outline {
    border: 2px solid rgba(255,255,255,0.8);
    color: #fff !important;
    background: transparent;
}

.p4u-dash-btn-outline:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
    color: #fff !important;
}

/* Quick Links */
.p4u-dash-quicklinks {
    margin-bottom: 2.5em;
}

.p4u-dash-quicklinks h3 {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 0.8em;
    font-weight: 700;
}

.p4u-dash-links-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 1em;
}

.p4u-dash-link-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    gap: 0.5em;
    padding: 1.4em 1em;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    text-decoration: none !important;
    color: #333 !important;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.p4u-dash-link-card:hover {
    border-color: #9ba88d;
    box-shadow: 0 4px 14px rgba(155,168,141,0.18);
    transform: translateY(-2px);
    color: #333 !important;
}

.p4u-dash-link-icon {
    font-size: 2em;
    line-height: 1;
}

.p4u-dash-link-label {
    font-size: 0.9em;
    font-weight: 600;
    text-align: center;
}

/* Groups Section */
.p4u-dash-groups h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 1.2em;
    font-weight: 700;
}

.p4u-dash-group-section {
    margin-bottom: 2.5em;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.p4u-dash-group-header {
    padding: 1.4em 1.8em;
    border-left: 5px solid #9ba88d;
    background: #f8f6f3;
    display: flex;
    align-items: center;
    gap: 0.8em;
    flex-wrap: wrap;
}

.p4u-dash-group-icon {
    font-size: 1.6em;
    line-height: 1;
}

.p4u-dash-group-name {
    margin: 0 !important;
    font-size: 1.15em;
    font-weight: 700;
    color: #333;
    padding: 0 !important;
}

.p4u-dash-group-desc {
    flex-basis: 100%;
    margin: 0.3em 0 0 0;
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

/* Posts Grid - 3 columns side by side */
.p4u-dash-posts-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1em !important;
}

.p4u-dash-post-card {
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    color: #333 !important;
    transition: background 0.2s;
    border-radius: 8px;
    overflow: hidden;
}

.p4u-dash-post-card:hover {
    background: #f8f6f3;
    color: #333 !important;
}

.p4u-dash-post-thumb {
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.p4u-dash-post-thumb img,
.p4u-dash-post-img {
    width: 100% !important;
    height: 140px !important;
    object-fit: cover !important;
    display: block;
}

.p4u-dash-post-thumb-placeholder {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    height: 140px;
}

.p4u-dash-post-info {
    padding: 1em 1.2em;
}

.p4u-dash-post-date {
    display: block;
    font-size: 0.75em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4em;
}

.p4u-dash-post-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.95em !important;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
}

.p4u-dash-post-card:hover .p4u-dash-post-title {
    color: #6b7b5e;
}

.p4u-dash-no-posts {
    padding: 1.5em;
    text-align: center;
    color: #999;
    font-size: 0.9em;
}

/* Group Footer */
.p4u-dash-group-footer {
    padding: 0.8em 1.8em;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.p4u-dash-view-all {
    font-size: 0.85em;
    font-weight: 600;
    color: #a04060 !important;
    text-decoration: none !important;
}

.p4u-dash-view-all:hover {
    text-decoration: underline !important;
    color: #7d2e48 !important;
}

/* Responsive */
@media (max-width: 900px) {
    .p4u-dash-posts-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .p4u-dash-post-card:nth-child(2) {
        border-right: none;
    }
    .p4u-dash-post-card:nth-child(3) {
        grid-column: 1 / -1;
        border-right: none;
        border-top: 1px solid #f0f0f0;
    }
}

@media (max-width: 600px) {
    .p4u-dash-welcome {
        flex-direction: column;
        text-align: center;
        padding: 1.5em;
    }
    .p4u-dash-links-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .p4u-dash-posts-grid {
        grid-template-columns: 1fr !important;
    }
    .p4u-dash-post-card {
        border-right: none !important;
        border-bottom: 1px solid #f0f0f0;
    }
    .p4u-dash-post-card:last-child {
        border-bottom: none;
    }
    .p4u-dash-group-header {
        padding: 1em 1.2em;
    }
}

/* ── Menu user indicator ── */
.p4u-menu-user-item {
    position: relative;
}

.p4u-menu-user-link {
    display: flex !important;
    align-items: center;
    gap: 0.3em;
}

.p4u-menu-user-icon {
    font-size: 1.1em;
    line-height: 1;
}

/* ── Carousel for group posts ── */
.p4u-dash-carousel-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.p4u-dash-posts-carousel {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
}

.p4u-dash-posts-carousel::-webkit-scrollbar {
    display: none;
}

.p4u-dash-posts-track {
    display: flex !important;
    gap: 1em;
    padding: 1em 1.2em;
}

.p4u-dash-carousel-wrap .p4u-dash-post-card {
    flex: 0 0 calc(33.333% - 0.75em) !important;
    min-width: calc(33.333% - 0.75em) !important;
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    color: #333 !important;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #eee;
    transition: box-shadow 0.2s, transform 0.2s;
}

.p4u-dash-carousel-wrap .p4u-dash-post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* Arrow buttons */
.p4u-dash-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 1.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #333;
    line-height: 1;
    padding: 0;
}

.p4u-dash-arrow:hover {
    background: #6b7b5e;
    color: #fff;
    box-shadow: 0 3px 12px rgba(107,123,94,0.3);
}

.p4u-dash-arrow-left {
    left: 6px;
}

.p4u-dash-arrow-right {
    right: 6px;
}

/* Responsive carousel */
@media (max-width: 900px) {
    .p4u-dash-carousel-wrap .p4u-dash-post-card {
        flex: 0 0 calc(50% - 0.5em) !important;
        min-width: calc(50% - 0.5em) !important;
    }
}

@media (max-width: 600px) {
    .p4u-dash-carousel-wrap .p4u-dash-post-card {
        flex: 0 0 85% !important;
        min-width: 85% !important;
    }
    .p4u-dash-arrow {
        width: 30px;
        height: 30px;
        font-size: 0.9em;
    }
}

/* ══════════════════════════════════════
   Member Profile Page
   ══════════════════════════════════════ */

.p4u-profile {
    max-width: 750px;
    margin: 0 auto;
    padding: 1em 0;
}

.p4u-profile-header {
    display: flex;
    align-items: center;
    gap: 1.2em;
    margin-bottom: 2em;
    padding-bottom: 1.5em;
    border-bottom: 1px solid #e8e8e8;
}

.p4u-profile-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 3px solid #9ba88d;
}

.p4u-profile-intro h2 {
    margin: 0 0 0.2em 0;
    font-size: 1.4em;
    color: #333;
}

.p4u-profile-meta {
    margin: 0;
    font-size: 0.9em;
    color: #777;
}

.p4u-profile-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.p4u-profile-status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.p4u-profile-status-pending {
    background: #fff3e0;
    color: #e65100;
}

/* Notices */
.p4u-profile-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1.5em;
    font-size: 0.95em;
}

.p4u-profile-notice-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.p4u-profile-notice-error {
    background: #fbe9e7;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Form Sections */
.p4u-profile-section {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 1.5em 1.8em;
    margin-bottom: 1.5em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.p4u-profile-section h3 {
    margin: 0 0 0.8em 0;
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
}

.p4u-profile-hint {
    margin: -0.4em 0 1em 0;
    font-size: 0.85em;
    color: #999;
}

.p4u-profile-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1em;
    margin-bottom: 0.8em;
}

.p4u-profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}

.p4u-profile-field label {
    font-size: 0.85em;
    font-weight: 600;
    color: #555;
}

.p4u-profile-field input {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.p4u-profile-field input:focus {
    outline: none;
    border-color: #9ba88d;
    box-shadow: 0 0 0 3px rgba(155,168,141,0.15);
}

.p4u-profile-field input:disabled {
    background: #f5f5f5;
    color: #888;
    cursor: not-allowed;
}

.p4u-profile-readonly {
    background: #fafafa;
}

/* Actions */
.p4u-profile-actions {
    text-align: right;
}

.p4u-profile-btn {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, #9ba88d 0%, #6b7b5e 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.p4u-profile-btn:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(107,123,94,0.3);
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 600px) {
    .p4u-profile-header {
        flex-direction: column;
        text-align: center;
    }
    .p4u-profile-row {
        grid-template-columns: 1fr;
    }
    .p4u-profile-section {
        padding: 1.2em;
    }
    .p4u-profile-actions {
        text-align: center;
    }
}

/* ── Menu login button for non-logged-in users ── */
.p4u-menu-login-item {
    margin-left: 0.5em !important;
}

.p4u-menu-login-btn {
    display: inline-block !important;
    background: linear-gradient(135deg, #9ba88d 0%, #6b7b5e 100%) !important;
    color: #fff !important;
    padding: 8px 18px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
    line-height: 1.4 !important;
}

.p4u-menu-login-btn:hover {
    opacity: 0.9 !important;
    box-shadow: 0 3px 10px rgba(107,123,94,0.3) !important;
    transform: translateY(-1px) !important;
    color: #fff !important;
}

/* Hide Divi default logo in mobile view */
@media (max-width: 980px) {
    #main-header .logo_container,
    #main-header #logo,
    #main-header .logo_helper {
        display: none !important;
    }
}
