/* Members Page Styles */
.members-section {
    padding: 4rem 0;
    min-height: 60vh;
}

/* Login Prompt */
.members-login-prompt {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.members-lock-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.members-login-prompt h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.members-login-prompt p {
    color: var(--color-text-light);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.members-prompt-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.members-prompt-buttons .btn {
    padding: 0.75rem 2rem;
}

/* Profile Card */
.member-profile-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-left: 4px solid #2563eb;
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.member-avatar {
    width: 56px;
    height: 56px;
    background: #e0e7ff;
    color: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.member-info h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.member-email {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.member-badge {
    display: inline-block;
    background: #f0fdf4;
    color: #166534;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 500;
}

/* Posts Section */
.members-posts-section {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.posts-header h2 {
    font-size: 1.4rem;
    margin: 0;
}

/* New Post Form */
.new-post-form {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.new-post-form h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.new-post-form textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: 1rem;
    resize: vertical;
}

.new-post-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.post-form-actions {
    display: flex;
    align-items: center;
    margin-top: 0.75rem;
}

/* Posts List */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.posts-loading {
    text-align: center;
    color: var(--color-text-light);
    padding: 2rem;
}

.post-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: box-shadow 0.2s;
}

.post-item:hover {
    box-shadow: var(--shadow);
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.post-meta-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-delete-btn {
    background: none;
    border: 1px solid #fecaca;
    color: #dc2626;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.post-delete-btn:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.post-author-avatar.admin {
    background: #ede9fe;
    color: #6d28d9;
}

.post-author-avatar.member {
    background: #e0f2fe;
    color: #0369a1;
}

.post-author-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

.post-admin-badge {
    background: #ede9fe;
    color: #6d28d9;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
    margin-left: 0.5rem;
}

.post-date {
    font-size: 0.75rem;
    color: #9ca3af;
}

.post-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--color-text);
}

.post-content {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* Member Benefits */
.member-benefits {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.member-benefits h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.benefit-icon {
    color: #16a34a;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.benefit-item strong {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--color-text);
}

.benefit-item p {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .member-profile-card {
        flex-direction: column;
        text-align: center;
    }

    .posts-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }
}

/* Image previews in post form */
.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Images in posts */
.post-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.post-image-link {
    display: block;
    max-width: 300px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: box-shadow 0.2s;
}

.post-image-link:hover {
    box-shadow: var(--shadow-lg);
}

.post-image {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    display: block;
}
