/**
 * Chapter Membership - Frontend Styles
 *
 * @package ChapterMembership
 */

/* Messages */
.cm-notice {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.cm-notice-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.cm-notice-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.cm-notice-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.cm-notice-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Form Errors */
.cm-registration-form .form-group.has-error input,
.cm-registration-form .form-group.has-error select,
.cm-registration-form .form-group.has-error textarea {
    border-color: #dc3545;
}

.cm-registration-form .form-group.has-error label {
    color: #dc3545;
}

.cm-field-error {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

.cm-field-error a {
    color: #dc3545;
    text-decoration: underline;
}

/* Form Loading State */
.cm-registration-form .btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Credential Setup Form */
.cm-credential-form .form-group {
    margin-bottom: 20px;
}

.cm-credential-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.cm-credential-form input[type="text"],
.cm-credential-form input[type="password"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.cm-credential-form input:focus {
    outline: none;
    border-color: #007bff;
}

.cm-password-requirements {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

/* Login Form */
.cm-login-form .form-group {
    margin-bottom: 20px;
}

.cm-login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.cm-login-form input[type="text"],
.cm-login-form input[type="password"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* Profile Form */
.cm-profile-form .form-group {
    margin-bottom: 20px;
}

.cm-profile-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.cm-profile-form input[type="number"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.cm-profile-info {
    margin-bottom: 30px;
}

.cm-profile-info dt {
    font-weight: 600;
    margin-bottom: 5px;
}

.cm-profile-info dd {
    margin-left: 0;
    margin-bottom: 15px;
    color: #555;
}

/* Profile Read-only View */
.share-data-readonly {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.share-data-item {
    flex: 1;
    min-width: 150px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.share-data-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

.share-data-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #F47B20;
}

/* Edit Profile Button */
.member-profile-actions {
    margin-top: 24px;
}

.btn-edit-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #F47B20;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.btn-edit-profile:hover {
    background: #d96a1a;
    color: #fff;
}

.btn-edit-profile img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.btn-edit-profile {
    border: none;
    cursor: pointer;
}

/* Edit Profile Form */
.member-profile-edit {
    padding: 30px 0;
}

.cm-edit-profile-form {
    max-width: 800px;
}

.edit-profile-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.edit-profile-avatar {
    flex-shrink: 0;
    text-align: center;
}

.avatar-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 16px;
    border: 3px solid #f0f0f0;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload {
    text-align: center;
}

.btn-upload-photo {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f0f0;
    color: #333;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-upload-photo:hover {
    background: #e0e0e0;
}

.avatar-upload .description {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #888;
}

.edit-profile-fields {
    flex: 1;
}

.edit-profile-fields .form-row {
    display: flex;
    gap: 20px;
}

.edit-profile-fields .form-row .form-group {
    flex: 1;
}

.edit-profile-fields .form-group {
    margin-bottom: 20px;
}

.edit-profile-fields label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.edit-profile-fields label .required {
    color: #dc3545;
}

.edit-profile-fields input[type="text"],
.edit-profile-fields input[type="email"],
.edit-profile-fields input[type="tel"],
.edit-profile-fields input[type="url"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.edit-profile-fields input:focus {
    outline: none;
    border-color: #F47B20;
}

.edit-profile-fields .form-group.has-error input {
    border-color: #dc3545;
}

.edit-profile-fields .form-group.has-error label {
    color: #dc3545;
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 30px;
}

.form-actions .btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #F47B20;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.form-actions .btn-submit:hover {
    background: #d96a1a;
}

.form-actions .btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-actions .btn-submit img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.btn-cancel {
    padding: 12px 24px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

/* Edit Profile Responsive */
@media (max-width: 768px) {
    .edit-profile-layout {
        flex-direction: column;
        align-items: center;
    }

    .edit-profile-fields {
        width: 100%;
    }

    .edit-profile-fields .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-submit,
    .form-actions .btn-cancel {
        width: 100%;
        justify-content: center;
    }
}

/* Chapter Admin Dashboard */
.cm-admin-dashboard .form-group {
    margin-bottom: 20px;
}

.cm-admin-dashboard label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.cm-admin-dashboard input[type="number"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* Member List */
.member-list-header {
    text-align: center;
    margin-bottom: 40px;
}

.member-list-header h2 {
    margin: 10px 0 5px;
    font-size: 2rem;
}

.member-list-header .member-count {
    color: #666;
    font-size: 1rem;
}

.member-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.member-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border: 1px solid #e8e8e8;
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    color: inherit;
    text-decoration: none;
}

.member-card--current {
    border: 2px solid #F47B20;
    background: linear-gradient(135deg, #fff 0%, #fff8f4 100%);
}

.member-card__avatar {
    position: relative;
    margin-bottom: 16px;
}

.member-card__avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f0f0;
}

.member-card__avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F47B20 0%, #ff9a4d 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
}

.member-card__badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #F47B20;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.member-card__info {
    margin-bottom: 16px;
    flex: 1;
}

.member-card__name {
    margin: 0 0 4px;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
}

.member-card__business {
    margin: 0 0 4px;
    font-size: 0.9rem;
    color: #F47B20;
    font-weight: 500;
}

.member-card__industry {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.member-card__contact {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    width: 100%;
}

.member-card__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff8f4;
    transition: background 0.2s ease;
    cursor: pointer;
}

.member-card__link:hover {
    background: #F47B20;
}

.member-card__link img {
    width: 20px;
    height: 20px;
    transition: filter 0.2s ease;
}

.member-card__link:hover img {
    filter: brightness(0) invert(1);
}

/* Responsive */
@media (max-width: 768px) {
    .member-list-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .member-card {
        padding: 20px;
    }

    .member-card__avatar img,
    .member-card__avatar-placeholder {
        width: 80px;
        height: 80px;
    }

    .member-card__avatar-placeholder {
        font-size: 1.5rem;
    }
}

/* Member List Controls */
.member-list-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.member-search {
    flex: 1;
    min-width: 250px;
}

.member-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.member-search input:focus {
    outline: none;
    border-color: #F47B20;
}

.member-search input::placeholder {
    color: #999;
}

.member-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.member-filters select {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    cursor: pointer;
    min-width: 160px;
    transition: border-color 0.2s ease;
}

.member-filters select:focus {
    outline: none;
    border-color: #F47B20;
}

.member-results-info {
    margin-bottom: 20px;
    color: #666;
    font-size: 0.9rem;
}

.member-results-info #visible-count {
    font-weight: 700;
    color: #F47B20;
}

/* Member Card Chapter Info */
.member-card__chapter {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: #888;
}

.member-card__state {
    color: #aaa;
}

/* No Results */
.member-no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.member-no-results p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* Responsive Controls */
@media (max-width: 768px) {
    .member-list-controls {
        flex-direction: column;
        padding: 16px;
    }

    .member-search {
        min-width: 100%;
    }

    .member-filters {
        width: 100%;
    }

    .member-filters select {
        flex: 1;
        min-width: 0;
    }
}

/* Load More Button */
.member-load-more {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

button.btn-load-more,
.btn-load-more {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 14px 32px !important;
    background: #F47B20 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    font-family: inherit !important;
    line-height: 1.4 !important;
}

button.btn-load-more:hover,
.btn-load-more:hover {
    background: #d96a1a !important;
    color: #fff !important;
}

button.btn-load-more:disabled,
.btn-load-more:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}

.btn-load-more .btn-arrow {
    font-size: 1.2rem;
    margin-left: 4px;
}

/* Loading State */
.member-list-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Chapter Officers Section */
.cm-officers-section {
    margin-top: 40px;
}

/* Subscription Inactive Notice */
.cm-subscription-notice {
    background: #fff3cd;
    border-bottom: 3px solid #D47E2E;
    padding: 20px 0;
    margin-bottom: 20px;
}

.cm-subscription-notice .cm-notice {
    margin-bottom: 0;
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.cm-subscription-notice .cm-notice strong {
    color: #D47E2E;
    font-size: 1rem;
}

.cm-subscription-notice .cm-notice {
    color: #856404;
    font-size: 0.95rem;
}
