/**
 * Committee Management Styles
 */

.cm-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.cm-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
}

.cm-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Committee Cards */
.cm-committees {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cm-committee {
    border: 1px solid #ddd;
    background: #fff;
    padding: 20px;
}

.cm-committee-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.cm-committee-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.cm-btn {
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.cm-btn-primary {
    background: #3498db;
    color: #fff;
}

.cm-btn-primary:hover {
    background: #2980b9;
}

.cm-btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.cm-btn-secondary:hover {
    background: #7f8c8d;
}

.cm-btn-danger {
    background: #e74c3c;
    color: #fff;
}

.cm-btn-danger:hover {
    background: #c0392b;
}

.cm-btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* Committee Info */
.cm-committee-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cm-info-row {
    display: flex;
    gap: 10px;
}

.cm-info-label {
    font-weight: 600;
    color: #666;
    min-width: 80px;
}

.cm-info-value {
    color: #333;
}

.cm-info-value.empty {
    color: #999;
    font-style: italic;
}

.cm-members-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cm-member-tag {
    background: #ecf0f1;
    padding: 4px 10px;
    font-size: 13px;
    color: #2c3e50;
}

/* Modal */
.cm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.cm-modal.open {
    display: flex;
}

.cm-modal-content {
    background: #fff;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.cm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.cm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.cm-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.cm-modal-close:hover {
    color: #333;
}

.cm-modal-body {
    padding: 20px;
}

.cm-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Form Elements */
.cm-section {
    margin-bottom: 25px;
}

.cm-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cm-current-chair {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
}

#cm-current-chair-name {
    flex: 1;
}

.cm-search-wrapper {
    position: relative;
}

.cm-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    font-size: 14px;
    box-sizing: border-box;
}

.cm-search-input:focus {
    outline: none;
    border-color: #3498db;
}

.cm-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.cm-search-results.open {
    display: block;
}

.cm-search-result {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.cm-search-result:last-child {
    border-bottom: none;
}

.cm-search-result:hover {
    background: #f0f0f0;
}

.cm-search-result-name {
    font-weight: 500;
    color: #333;
}

.cm-search-result-email {
    font-size: 12px;
    color: #888;
}

.cm-no-results {
    padding: 10px 12px;
    color: #888;
    font-style: italic;
}

/* Members List in Modal */
.cm-members-list {
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.cm-member-item {
    padding: 10px;
    background: #f8f9fa;
    margin-bottom: 8px;
}

.cm-member-item:last-child {
    margin-bottom: 0;
}

.cm-member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cm-member-info-row {
    display: flex;
    gap: 8px;
}

.cm-member-info-input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #ddd;
    font-size: 13px;
}

.cm-member-name {
    font-size: 14px;
    color: #333;
}

.cm-no-members {
    padding: 10px;
    color: #888;
    font-style: italic;
    text-align: center;
}

/* Chair Info */
.cm-info-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.cm-info-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    font-size: 13px;
}

/* ===================================
   PUBLIC DISPLAY STYLES
   =================================== */

.cm-display-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.cm-display-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: left;
}

.cm-display-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.cm-display-committee {
    background: #fff;
    border: 1px solid #e0e0e0;
    margin-bottom: 25px;
    padding: 20px;
}

.cm-display-header {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.cm-display-left {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.cm-display-image {
    width: 150px;
}

.cm-display-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Hide images if desired - add class to container */
.cm-display-container.hide-images .cm-display-image {
    display: none;
}

.cm-display-header-content {
    flex: 1;
}

.cm-display-committee-title {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.cm-display-chair {
    margin-top: 10px;
}

/* Person (chair/member) styling */
.cm-person {
    padding: 8px 0;
}

.cm-person-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

.cm-person-location {
    color: #666;
    font-size: 13px;
    margin-top: 2px;
}

.cm-person-club {
    color: #888;
    font-size: 13px;
    margin-top: 2px;
}

.cm-person-info {
    display: inline-block;
    background: #e9ecef;
    color: #6c757d;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    margin-top: 5px;
}

/* Members section */
.cm-display-members {
    border-top: 1px solid #eee;
    padding-top: 5px;
    margin-top: 10px;
}

.cm-display-members-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.cm-display-member {
    padding: 10px;
    background: #f8f9fa;
}

/* About accordion */
.cm-about-toggle {
    color: #999;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

.cm-about-toggle:hover {
    color: #666;
}

.cm-about-toggle.open {
    color: #666;
}

.cm-about-content {
    display: none;
    padding: 15px;
    margin: 15px 0;
    background: #f0f0f0;
    color: #555;
    line-height: 1.6;
}

/* Section labels */
.cm-display-section-label {
    font-weight: 600;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    margin-top: 15px;
}

/* Responsive */
@media (max-width: 600px) {
    .cm-container {
        padding: 10px;
    }
    
    .cm-committee {
        padding: 15px;
    }
    
    .cm-committee-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .cm-info-row {
        flex-direction: column;
        gap: 3px;
    }
    
    .cm-info-label {
        min-width: auto;
    }
    
    .cm-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .cm-display-header {
        flex-direction: column;
    }
    
    .cm-display-left {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }
    
    .cm-display-image {
        width: 100px;
    }
    
    .cm-display-members-list {
        grid-template-columns: 1fr;
    }
}
