/* Completely New Distributor Plugin Frontend Styles */

.distributor-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Filters Section */
.distributor-filters {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filter-item {
    flex: 1;
    min-width: 180px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fafafa;
    transition: all 0.2s;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

.reset-btn {
    padding: 10px 16px;
    background: #4ade80;
    color: #166534;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: #16a34a;
    color: white;
    transform: translateY(-1px);
}

/* Grid Layout */
.distributor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* Distributor Card - Completely New Design */
.distributor-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.distributor-card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
    border-color: #93c5fd;
}

/* Card Header */
.distributor-header {
    padding: 20px;
    background: linear-gradient(135deg, #86efac 0%, #4ade80 100%);
    color: white;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.distributor-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.distributor-logo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.distributor-info {
    flex: 1;
}

.distributor-name {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: #166534;
}

.distributor-state-badge {
    display: inline-block;
    background: rgba(22, 101, 52, 0.2);
    color: #166534;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.distributor-description {
    color: #166534;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 6px;
}

/* Card Body */
.distributor-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.distributor-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
    padding: 8px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-icon {
    font-size: 16px;
    min-width: 20px;
    text-align: center;
    color: #16a34a;
    margin-top: 2px;
}

.detail-text {
    flex: 1;
    word-break: break-word;
}

.detail-text strong {
    color: #1f2937;
    font-weight: 500;
    margin-right: 4px;
}

.detail-text a {
    color: #16a34a;
    text-decoration: none;
    font-weight: 500;
}

.detail-text a:hover {
    color: #15803d;
    text-decoration: underline;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
    background: #f9fafb;
    border-radius: 8px;
    grid-column: 1 / -1;
    border: 1px dashed #d1d5db;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .distributor-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .distributor-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .distributor-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-item {
        width: 100%;
    }

    .distributor-filters {
        padding: 16px;
    }

    .distributor-card {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .distributor-wrapper {
        padding: 15px;
    }

    .distributor-grid {
        gap: 16px;
    }

    .distributor-header {
        padding: 16px;
    }

    .distributor-body {
        padding: 16px;
    }

    .distributor-name {
        font-size: 16px;
    }

    .detail-item {
        gap: 8px;
        font-size: 13px;
    }
}

/* Animation for cards on load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.distributor-card {
    animation: fadeInUp 0.4s ease-out;
}

/* Stagger animation for multiple cards */
.distributor-card:nth-child(1) { animation-delay: 0.1s; }
.distributor-card:nth-child(2) { animation-delay: 0.2s; }
.distributor-card:nth-child(3) { animation-delay: 0.3s; }
.distributor-card:nth-child(4) { animation-delay: 0.4s; }
.distributor-card:nth-child(5) { animation-delay: 0.5s; }
.distributor-card:nth-child(6) { animation-delay: 0.6s; }

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .distributor-wrapper {
        color: #e5e7eb;
    }
    
    .distributor-filters {
        background: #1f2937;
        border-color: #374151;
    }
    
    .filter-input,
    .filter-select {
        background: #374151;
        border-color: #4b5563;
        color: #e5e7eb;
    }
    
    .distributor-card {
        background: #1f2937;
        border-color: #374151;
    }
    
    .distributor-header {
        background: linear-gradient(135deg, #166534 0%, #15803d 100%);
        color: #dcfce7;
    }
    
    .distributor-logo {
        border: 2px solid rgba(220, 252, 231, 0.3);
    }
    
    .distributor-logo-placeholder {
        background: rgba(220, 252, 231, 0.2);
        border: 2px solid rgba(220, 252, 231, 0.3);
        color: #dcfce7;
    }
    
    .distributor-name {
        color: #dcfce7;
    }
    
    .distributor-state-badge {
        background: rgba(220, 252, 231, 0.2);
        color: #dcfce7;
    }
    
    .distributor-description {
        color: #bbf7d0;
    }
    
    .distributor-body {
        background: #1f2937;
    }
    
    .detail-item {
        color: #e5e7eb;
        border-bottom-color: #374151;
    }
    
    .detail-text {
        color: #d1d5db;
    }
    
    .detail-text strong {
        color: #f9fafb;
    }
    
    .detail-icon {
        color: #4ade80;
    }
    
    .detail-text a {
        color: #4ade80;
    }
    
    .detail-text a:hover {
        color: #86efac;
    }
    
    .reset-btn {
        background: #16a34a;
        color: white;
    }
    
    .reset-btn:hover {
        background: #4ade80;
        color: #166534;
    }
    
    .no-results {
        background: #111827;
        color: #9ca3af;
        border-color: #374151;
    }
}