/**
 * Public CSS for Country-Based Supplier Directory
 */

/* Container */
.cbsd-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Country Page */
.cbsd-country-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Page Header */
.cbsd-page-header {
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
}

.cbsd-page-title {
    margin-bottom: 15px;
    font-size: 32px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cbsd-country-flag-header {
    width: 32px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    vertical-align: middle;
}

.cbsd-page-description {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

/* Search Section */
.cbsd-search-section {
    width: 100%;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.cbsd-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
}

.cbsd-search-input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.cbsd-search-input:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.cbsd-search-button {
    padding: 12px 24px;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cbsd-search-button:hover {
    background-color: #3367d6;
}

/* Filter Section */
.cbsd-filter-section {
    width: 100%;
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.cbsd-filter-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    color: #333;
}

.cbsd-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cbsd-filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

/* More filters dropdown */
.cbsd-filter-more-container {
    position: relative;
    display: inline-block;
}

.cbsd-filter-more-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    font-size: 13px;
    display: none;
}

.cbsd-filter-dropdown {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 4px;
    z-index: 10;
    right: 0;
}

.cbsd-filter-dropdown .cbsd-filter-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 15px;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid #f1f1f1;
}

.cbsd-filter-dropdown .cbsd-filter-btn:last-child {
    border-bottom: none;
}

.cbsd-filter-more-container:hover .cbsd-filter-dropdown {
    display: block;
}

.cbsd-filter-btn:hover {
    background-color: #f1f1f1;
}

.cbsd-filter-active {
    background-color: #4285f4;
    color: #fff;
    border-color: #4285f4;
}

.cbsd-filter-active:hover {
    background-color: #3367d6;
    border-color: #3367d6;
}

/* Suppliers Grid */
.cbsd-suppliers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
    width: 100%;
}

/* Suppliers Wrapper */
.cbsd-suppliers-wrapper {
    width: 100%;
    box-sizing: border-box;
}

/* Supplier Card */
.cbsd-supplier-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.cbsd-supplier-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.cbsd-supplier-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.cbsd-supplier-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cbsd-supplier-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cbsd-supplier-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4285f4;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
}

.cbsd-supplier-meta {
    flex-grow: 1;
    overflow: hidden;
}

.cbsd-supplier-name {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cbsd-supplier-verified {
    color: #4285f4;
    display: inline-flex;
    align-items: center;
}

.cbsd-supplier-location {
    display: flex;
    align-items: center;
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

.cbsd-country-flag {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cbsd-country-flag img {
    width: 16px;
    height: auto;
    border-radius: 2px;
    vertical-align: middle;
}

/* Rating */
.cbsd-supplier-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.cbsd-rating-stars {
    color: #ffc107;
}

.cbsd-star {
    font-size: 16px;
    margin-right: -2px;
}

.cbsd-rating-count {
    font-size: 14px;
    color: #666;
}

/* Categories */
.cbsd-supplier-categories {
    margin-bottom: 15px;
    flex-grow: 1;
}

.cbsd-supplier-categories h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.cbsd-category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cbsd-category-tag {
    background-color: #f1f1f1;
    color: #555;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.cbsd-category-more {
    background-color: #e0e0e0;
    color: #555;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
}

.cbsd-category-none {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

/* Action Buttons */
.cbsd-supplier-actions {
    text-align: center;
    margin-top: auto;
    padding-top: 15px;
}

.cbsd-view-profile-btn {
    display: inline-block;
    width: 100%;
    padding: 10px 20px;
    background-color: #4285f4;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
    text-align: center;
}

.cbsd-view-profile-btn:hover {
    background-color: #3367d6;
    color: #fff;
}

/* Load More */
.cbsd-load-more-container {
    text-align: center;
    margin: 30px 0;
}

.cbsd-load-more-btn {
    padding: 12px 24px;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cbsd-load-more-btn:hover {
    background-color: #3367d6;
}

.cbsd-loading-spinner {
    margin: 20px auto;
    text-align: center;
}

.cbsd-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #4285f4;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Messages */
.cbsd-error {
    padding: 15px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.cbsd-no-suppliers {
    text-align: center;
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* Responsive styles */
@media (max-width: 992px) {
    .cbsd-suppliers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cbsd-search-form {
        flex-direction: column;
    }
    
    .cbsd-suppliers-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .cbsd-filter-buttons {
        justify-content: flex-start;
    }
    
    .cbsd-filter-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .cbsd-filter-more-btn {
        display: inline-block;
    }
    
    /* Hide categories after the 5th one on mobile */
    .cbsd-filter-btn.cbsd-filter-extra {
        display: none;
    }
    
    .cbsd-filter-dropdown .cbsd-filter-btn.cbsd-filter-extra {
        display: block;
    }
    
    .cbsd-page-title {
        font-size: 24px;
    }
    
    .cbsd-supplier-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cbsd-supplier-avatar {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .cbsd-search-button {
        width: 100%;
    }
    
    .cbsd-supplier-meta {
        width: 100%;
    }
}

/* Countries grid */
.cbsd-countries-wrapper {
    width: 100%;
}

.cbsd-countries-grid {
    display: grid;
    grid-template-columns: repeat(var(--cbsd-columns, 4), 1fr);
    gap: 20px;
    width: 100%;
}

@media (max-width: 992px) {
    .cbsd-countries-grid {
        --cbsd-columns: 3;
    }
}

@media (max-width: 768px) {
    .cbsd-countries-grid {
        --cbsd-columns: 2;
    }
}

@media (max-width: 480px) {
    .cbsd-countries-grid {
        --cbsd-columns: 1;
    }
} 