/**
 * Mailman Management Styles
 * 
 * Styles for the Mailman subscriber management interface
 * Aligns with existing CP Committee plugin design patterns
 * 
 * @package CP_Committee
 * @since 1.0.0
 */

/* Main container */
.cp-mailman-manager {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header section */
.cp-mailman-header {
    background: #f8f9fa;
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 20px;
}

.cp-mailman-header h3 {
    margin: 0 0 15px 0;
    color: #741f11; /* Primary theme color */
    font-size: 1.4em;
    font-weight: 600;
}

.cp-mailman-list-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.cp-mailman-list-selector label {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.cp-mailman-list-selector select {
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.cp-mailman-list-selector .button {
    background: #741f11;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.cp-mailman-list-selector .button:hover {
    background: #5a180d;
}

/* Content area */
.cp-mailman-content {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0;
    overflow: hidden;
}

/* Loading state */
.cp-mailman-loading {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Error messages */
.cp-mailman-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-left: 4px solid #dc3545;
    margin: 0;
}

/* Subscribers table */
.cp-mailman-subscribers {
    padding: 20px;
}

.cp-mailman-subscribers h4 {
    margin: 0 0 15px 0;
    color: #741f11;
    font-size: 1.2em;
    font-weight: 600;
}

.subscribers-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.subscribers-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.subscribers-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.subscribers-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.subscribers-table tr:hover {
    background: #f8f9fa;
}

.subscribers-table tr:last-child td {
    border-bottom: none;
}

/* Forms */
.cp-mailman-add-form,
.cp-mailman-remove-form {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.cp-mailman-add-form h4,
.cp-mailman-remove-form h4 {
    margin: 0 0 15px 0;
    color: #741f11;
    font-size: 1.1em;
    font-weight: 600;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.form-group input {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #741f11;
    box-shadow: 0 0 0 2px rgba(116, 31, 17, 0.25);
}

/* Buttons */
.button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    line-height: 1.4;
}

.button-primary {
    background: #741f11;
    color: white;
}

.button-primary:hover {
    background: #5a180d;
    color: white;
}

.button-secondary {
    background: #6c757d;
    color: white;
}

.button-secondary:hover {
    background: #545b62;
    color: white;
}

.button-danger {
    background: #dc3545;
    color: white;
    font-size: 12px;
    padding: 6px 12px;
}

.button-danger:hover {
    background: #c82333;
    color: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .cp-mailman-list-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cp-mailman-list-selector select {
        min-width: auto;
        width: 100%;
    }
    
    .subscribers-table-container {
        font-size: 14px;
    }
    
    .subscribers-table th,
    .subscribers-table td {
        padding: 8px 10px;
    }
    
    .form-group input {
        max-width: 100%;
    }
}

/* Success messages */
.cp-mailman-success {
    background: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border-left: 4px solid #28a745;
    margin: 0 0 15px 0;
    border-radius: 0 4px 4px 0;
}

/* Admin page styles */
.mailman-test-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 20px;
    margin-top: 30px;
}

.mailman-test-section h3 {
    margin: 0 0 10px 0;
    color: #741f11;
}

.mailman-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.mailman-list-item input {
    flex: 1;
    max-width: 300px;
}

/* Loading spinner */
.cp-mailman-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #741f11;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
