/**
 * Natura 2000 Lists Styles - WordPress Plugin
 * Entity lists component styles with namespacing
 */

/* Lists Container */
.natura-lists-container {
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.natura-entity-lists {
    padding: 20px;
}

/* Tabbed Layout */
.natura-tabs {
    width: 100%;
}

.natura-tab-headers {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
    overflow-x: auto;
}

.natura-tab-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.natura-tab-header:hover {
    background: #f8f9fa;
    color: #333;
}

.natura-tab-header.active {
    color: #2c5530;
    border-bottom-color: #2c5530;
    background: #f8f9fa;
}

.natura-tab-icon {
    font-size: 16px;
}

.natura-tab-count {
    background: #e9ecef;
    color: #666;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.natura-tab-header.active .natura-tab-count {
    background: #2c5530;
    color: white;
}

.natura-tab-panel {
    display: none;
}

.natura-tab-panel[x-show="true"] {
    display: block;
}

/* Sectioned Layout */
.natura-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.natura-section {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.natura-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c5530;
}

.natura-section-icon {
    font-size: 18px;
}

.natura-section-count {
    background: #2c5530;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: auto;
}

.natura-section-content {
    padding: 15px 20px;
}

/* Combined Layout */
.natura-combined h3 {
    margin: 0 0 20px 0;
    color: #2c5530;
    font-size: 18px;
    font-weight: 600;
}

/* Entity Panel */
.natura-entity-panel {
    width: 100%;
}

/* Entity Search */
.natura-entity-search {
    margin-bottom: 15px;
}

.natura-entity-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.natura-entity-search-input:focus {
    outline: none;
    border-color: #2c5530;
    box-shadow: 0 0 0 2px rgba(44, 85, 48, 0.1);
}

/* Entity Filters */
.natura-entity-filters {
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.natura-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.natura-filter-group {
    flex: 1;
    min-width: 150px;
}

.natura-filter-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    font-size: 13px;
}

.natura-filter-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

/* Entity List */
.natura-entity-list {
    min-height: 200px;
}

.natura-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
}

.natura-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2c5530;
    border-radius: 50%;
    animation: natura-spin 1s linear infinite;
    margin-bottom: 12px;
}

.natura-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.natura-no-results p {
    margin: 0;
    font-size: 14px;
}

/* Entity Items */
.natura-entity-items {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-top: 20px;
}

/* Card-based layout for trail items */
.natura-trails-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.natura-trails-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Card image section */
.natura-card-image {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.natura-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.natura-trails-item:hover .natura-card-image img {
    transform: scale(1.05);
}

.natura-card-image-placeholder {
    color: #999;
    font-size: 48px;
    text-align: center;
}

/* Card content section */
.natura-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.natura-card-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c5530;
    line-height: 1.3;
}

.natura-card-meta {
    margin-bottom: 15px;
    flex: 1;
}

.natura-card-meta-item {
    display: flex;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.natura-card-meta-label {
    font-weight: 600;
    color: #333;
    min-width: 80px;
    margin-right: 8px;
}

.natura-card-meta-value {
    color: #666;
    flex: 1;
}

.natura-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

/* Default styling for non-trail items (producers, lodging) */
.natura-entity-item:not(.natura-trails-item) {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    transition: all 0.2s ease;
    background: #fff;
}

.natura-entity-item:not(.natura-trails-item):hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.natura-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.natura-item-icon {
    font-size: 18px;
}

.natura-item-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c5530;
    flex: 1;
}

.natura-item-details {
    margin-bottom: 12px;
}

.natura-item-details p {
    margin: 4px 0;
    font-size: 14px;
    color: #666;
}

.natura-item-products {
    background: #f8f9fa;
    border-left: 3px solid #ff6b35;
    padding: 8px 12px;
    margin: 8px 0;
    border-radius: 0 4px 4px 0;
}

.natura-item-products strong {
    color: #2c5530;
    font-weight: 600;
}

.natura-item-location {
    font-weight: 500;
    color: #333;
}

.natura-item-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ffc107;
    font-size: 14px;
}

/* Action Buttons */
.natura-item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.natura-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.natura-action-btn:hover {
    background: #f8f9fa;
    border-color: #2c5530;
    transform: translateY(-1px);
}

/* Card-specific action buttons */
.natura-card-actions .natura-action-btn {
    flex: 1;
    min-width: 0;
}

.natura-card-actions .natura-action-btn:first-child {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.natura-card-actions .natura-action-btn:first-child:hover {
    background: #e55a2b;
    border-color: #e55a2b;
}

.natura-card-actions .natura-action-btn:nth-child(2) {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.natura-card-actions .natura-action-btn:nth-child(2):hover {
    background: #e55a2b;
    border-color: #e55a2b;
}

.natura-card-actions .natura-action-btn:last-child {
    background: #5cb85c;
    color: white;
    border-color: #5cb85c;
}

.natura-card-actions .natura-action-btn:last-child:hover {
    background: #4cae4c;
    border-color: #4cae4c;
}

.natura-center-map {
    background: #2c5530;
    color: white;
    border-color: #2c5530;
}

.natura-center-map:hover {
    background: #1a3a1e;
    border-color: #1a3a1e;
    color: white;
}

/* Combined Items */
.natura-combined-items {
    display: grid;
    gap: 12px;
}

.natura-combined-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;
}

.natura-combined-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.natura-combined-item .natura-item-content {
    flex: 1;
}

.natura-combined-item .natura-item-actions {
    margin-left: auto;
}

/* Pagination */
.natura-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.natura-page-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.natura-page-btn:hover:not(:disabled) {
    background: #2c5530;
    color: white;
    border-color: #2c5530;
}

.natura-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.natura-page-info {
    color: #666;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .natura-entity-lists {
        padding: 15px;
    }
    
    .natura-tab-headers {
        margin-bottom: 15px;
    }
    
    .natura-tab-header {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .natura-filter-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .natura-filter-group {
        min-width: auto;
    }
    
    .natura-entity-items {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .natura-card-image {
        height: 180px;
    }
    
    .natura-card-content {
        padding: 16px;
    }
    
    .natura-card-title {
        font-size: 16px;
    }
    
    .natura-card-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .natura-card-actions .natura-action-btn {
        flex: none;
        width: 100%;
    }
    
    .natura-entity-item:not(.natura-trails-item) {
        padding: 12px;
    }
    
    .natura-item-actions {
        flex-direction: column;
    }
    
    .natura-action-btn {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .natura-lists-container {
        margin: 15px 0;
        border-radius: 6px;
    }
    
    .natura-entity-lists {
        padding: 12px;
    }
    
    .natura-tab-header {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .natura-entity-items {
        gap: 12px;
    }
    
    .natura-card-image {
        height: 150px;
    }
    
    .natura-card-content {
        padding: 12px;
    }
    
    .natura-card-title {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .natura-card-meta-item {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .natura-card-meta-label {
        min-width: 70px;
    }
    
    .natura-entity-item:not(.natura-trails-item) {
        padding: 10px;
    }
    
    .natura-pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .natura-page-btn {
        width: 120px;
    }
}

/* WordPress theme compatibility */
.natura-lists-container * {
    box-sizing: border-box;
}

.natura-lists-container h3,
.natura-lists-container h4,
.natura-lists-container p,
.natura-lists-container button {
    margin-bottom: 0;
    line-height: 1.4;
    font-family: inherit;
}

.natura-lists-container a {
    text-decoration: none;
}

.natura-lists-container a:visited {
    color: inherit;
}