/* TradeTracker Feed Display - Frontend Styles */

/* Products Wrapper */
.ttfd-products-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Filters Section */
.ttfd-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.ttfd-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ttfd-filter-group label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.ttfd-checkbox-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ttfd-checkbox-filters label {
    font-weight: normal;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.ttfd-checkbox-filters input[type="checkbox"] {
    cursor: pointer;
}

.ttfd-search-input,
.ttfd-filter-select,
.ttfd-price-input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.3s;
}

.ttfd-search-input:focus,
.ttfd-filter-select:focus,
.ttfd-price-input:focus {
    outline: none;
    border-color: #007cba;
}

.ttfd-price-filter .ttfd-price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ttfd-price-input {
    width: 100%;
}

.ttfd-price-separator {
    color: #666;
    font-weight: 600;
}

.ttfd-reset-btn {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.ttfd-reset-btn:hover {
    background: #c82333;
}

.ttfd-map-btn {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
    margin-left: 10px;
}

.ttfd-map-btn:hover {
    background: #218838;
}

/* Loading Indicator */
.ttfd-loading {
    text-align: center;
    padding: 40px;
}

.ttfd-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: ttfd-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes ttfd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Products Grid */
.ttfd-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* Product Card */
.ttfd-product-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.ttfd-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.ttfd-product-image {
    position: relative;
    padding-top: 75%;
    background: #f8f9fa;
    overflow: hidden;
}

.ttfd-product-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.ttfd-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ttfd-badge-stars {
    background: #ffc107;
    color: #000;
}

.ttfd-badge-wifi {
    background: #17a2b8;
    color: white;
}

.ttfd-badge-pool {
    background: #007bff;
    color: white;
}

.ttfd-badge-pets {
    background: #28a745;
    color: white;
}

.ttfd-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform 0.3s;
}

.ttfd-product-image img[src*="no-image"],
.ttfd-product-image img[src*="placeholder"] {
    opacity: 0.3;
}

.ttfd-product-card:hover .ttfd-product-image img {
    transform: scale(1.05);
}

.ttfd-product-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ttfd-product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ttfd-product-country {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.ttfd-product-description {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
    max-height: 60px;
    overflow: hidden;
}

.ttfd-product-description p {
    margin: 0;
}

.ttfd-product-brand {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.ttfd-product-category {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-block;
    width: fit-content;
}

.ttfd-product-price {
    font-size: 22px;
    font-weight: 700;
    color: #28a745;
    margin: auto 0 15px 0;
}

.ttfd-product-link {
    display: block;
    text-align: center;
    padding: 12px 20px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s;
}

.ttfd-product-link:hover {
    background: #005a87;
    color: white;
}

/* No Products Message */
.ttfd-no-products {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    grid-column: 1 / -1;
}

.ttfd-no-products p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Pagination */
.ttfd-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

.ttfd-page-btn {
    padding: 10px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.ttfd-page-btn:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.ttfd-page-btn.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ttfd-filters {
        grid-template-columns: 1fr;
    }
    
    .ttfd-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .ttfd-product-title {
        font-size: 14px;
    }
    
    .ttfd-product-price {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .ttfd-products-grid {
        grid-template-columns: 1fr;
    }
    
    .ttfd-price-filter .ttfd-price-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .ttfd-price-separator {
        display: none;
    }
}

/* Map Container */
#ttfd-map-container {
    position: relative;
    margin-bottom: 30px;
}

.ttfd-close-map-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.ttfd-close-map-btn:hover {
    background: #f0f0f0;
}

#ttfd-map {
    width: 100%;
    height: 600px;
    border-radius: 8px;
}

/* Results Info */
.ttfd-results-info {
    text-align: center;
    padding: 15px;
    color: #666;
    font-size: 14px;
    grid-column: 1 / -1;
}

/* Pagination improvements */
.ttfd-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 30px;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

.ttfd-pagination span {
    padding: 8px;
    color: #666;
}

.ttfd-page-ellipsis {
    padding: 10px 5px;
}
