/* Council Directory Plugin - Frontend Styles */

/* Grid Styles */
.cd-filters {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 8px;
}

.cd-filter-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Taxonomy Filters Row */
.cd-taxonomy-filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.cd-taxonomy-filters .cd-filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

/* Search and Sort Row */
.cd-search-sort-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    align-items: center;
}

#cd-search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
}

.cd-sort-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cd-sort-wrapper select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    width: 100%;
}

.cd-filter-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

#cd-filter-btn,
#cd-reset-btn {
    border: 1px solid #0073aa;
    background: #0073aa;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

#cd-reset-btn {
    background: #666;
    border-color: #666;
}

#cd-filter-btn:hover {
    background: #005a87;
}

#cd-reset-btn:hover {
    background: #444;
}

/* Council Grid */
.cd-councils-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.cd-council-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.cd-council-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.cd-council-logo {
    margin-bottom: 15px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cd-council-logo img {
    max-height: 100%;
    max-width: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
}

.cd-council-content {
    text-align: center;
}

.cd-council-title {
    font-size: 20px;
    margin: 0 0 15px 0;
    color: #333;
}

.cd-council-meta {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.cd-council-meta span {
    display: block;
    margin-bottom: 5px;
}

.cd-council-type {
    font-weight: bold;
    color: #0073aa;
}

.cd-view-council {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.cd-view-council:hover {
    background: #005a87;
    color: #fff;
}

.cd-suggest-update {
    display: inline-block;
    background: #f0b849;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    margin-left: 10px;
    transition: background 0.3s ease;
}

.cd-suggest-update:hover {
    background: #d69e2e;
    color: #fff;
}

/* Pagination */
.cd-pagination {
    margin-top: 40px;
    text-align: center;
}

.cd-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.cd-pagination .page-numbers:hover {
    background: #f5f5f5;
}

.cd-pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Single Council Styles */
.cd-single-council-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.cd-single-council-content {
    display: grid;
    grid-template-columns: 9fr 3fr;
    gap: 40px;
}

.cd-main-column {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cd-main-column h1 {
    margin-top: 0;
    color: #333;
    font-size: 32px;
    margin-bottom: 20px;
}

.cd-council-details {
    line-height: 1.6;
    color: #666;
}

.cd-council-details h2,
.cd-council-details h3,
.cd-council-details h4 {
    color: #333;
    margin-top: 25px;
}

.cd-field-group {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.cd-field-group:last-child {
    border-bottom: none;
}

.cd-field-row {
    display: flex;
    margin-bottom: 15px;
}

.cd-field-label {
    font-weight: bold;
    min-width: 180px;
    color: #333;
}

.cd-field-value {
    flex: 1;
    color: #666;
}

/* Back to Directory Button */
.cd-back-button {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.cd-back-link {
    display: inline-block;
    background: #666;
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
    font-size: 16px;
}

.cd-back-link:hover {
    background: #444;
    color: #fff;
}

/* Sidebar */
.cd-sidebar-column {
    background: #f8f8f8;
    padding: 25px;
    border-radius: 8px;
    height: fit-content;
}

.cd-sidebar-logo {
    margin-bottom: 30px;
    text-align: center;
}

.cd-sidebar-logo img {
    max-width: 100%;
    height: auto;
}

.cd-sidebar-item {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.cd-sidebar-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cd-sidebar-item h3 {
    font-size: 16px;
    margin: 0 0 10px 0;
    color: #333;
}

.cd-sidebar-item p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Update Suggestion Form */
.cd-update-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.cd-update-form h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.cd-update-form .form-field {
    margin-bottom: 20px;
}

.cd-update-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.cd-update-form input[type="text"],
.cd-update-form input[type="email"],
.cd-update-form input[type="url"],
.cd-update-form input[type="number"],
.cd-update-form select,
.cd-update-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cd-update-form textarea {
    min-height: 100px;
    resize: vertical;
}

.cd-update-form .submit-button {
    background: #0073aa;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cd-update-form .submit-button:hover {
    background: #005a87;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .cd-councils-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Stack taxonomy filters on tablets */
    .cd-taxonomy-filters {
        grid-template-columns: 1fr;
    }
    
    /* Stack search/sort/buttons on tablets */
    .cd-search-sort-row {
        grid-template-columns: 1fr;
    }
    
    .cd-filter-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .cd-councils-grid {
        grid-template-columns: 1fr;
    }
    
    .cd-single-council-content {
        grid-template-columns: 1fr;
    }
    
    .cd-sidebar-column {
        margin-top: 20px;
    }
    
    /* Mobile filter layout */
    .cd-filter-controls {
        gap: 15px;
    }
    
    .cd-taxonomy-filters {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cd-search-sort-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cd-sort-wrapper {
        width: 100%;
    }
    
    .cd-filter-buttons {
        justify-content: stretch;
        width: 100%;
    }
    
    .cd-filter-buttons button {
        flex: 1;
    }
    
    .cd-field-row {
        flex-direction: column;
    }
    
    .cd-field-label {
        margin-bottom: 5px;
    }
}

@media (max-width: 576px) {
    .cd-council-card {
        padding: 15px;
    }
    
    .cd-main-column {
        padding: 20px;
    }
    
    .cd-main-column h1 {
        font-size: 24px;
    }
}

/* Loading State */
.cd-loading {
    text-align: center;
    padding: 40px;
}

.cd-loading:after {
    content: "";
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: cd-spin 1s linear infinite;
}

@keyframes cd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.cd-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.cd-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cd-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cd-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}