/* Producers Page Styles */
/* Variables, reset, body, container provided by base.css */

/* Page-specific header (not navigation) */
header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-top: 0; /* No gap after unified nav */
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
}

/* Search Controls */
.search-controls {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--primary-blue-hover);
}

.view-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.view-controls label {
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
}

.view-controls select {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.875rem;
    min-width: 100px;
}

/* Table Styles */
.table-container {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.producers-table {
    width: 100%;
    border-collapse: collapse;
}

.producers-table th {
    background: var(--gray-50);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-900);
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.875rem;
    white-space: nowrap;
}

.producers-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.producers-table th.sortable:hover {
    background: var(--gray-100);
}

.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sort-indicator {
    color: var(--gray-400);
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.producers-table th.sorted-asc .sort-indicator {
    color: var(--primary-blue);
    transform: rotate(180deg);
}

.producers-table th.sorted-desc .sort-indicator {
    color: var(--primary-blue);
}

.producers-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
    vertical-align: top;
}

.producers-table tbody tr:hover {
    background: var(--gray-50);
}

.producers-table tbody tr:last-child td {
    border-bottom: none;
}

/* Producer Link */
.producer-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.producer-link:hover {
    color: var(--primary-blue-hover);
    text-decoration: underline;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-spirit {
    background: #fef3c7;
    color: #92400e;
}

.status-wine {
    background: #fce7f3;
    color: #be185d;
}

/* Brand Count */
.brand-count {
    display: inline-block;
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.brand-count.has-brands {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

/* Location */
.location {
    color: var(--gray-600);
}

/* Loading and No Results */
.loading-indicator {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pagination-info {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.pagination-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.pagination-btn.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .producers-table {
        font-size: 0.8125rem;
    }
    
    .producers-table th,
    .producers-table td {
        padding: 0.75rem;
    }
}

@media (max-width: 992px) {
    .search-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .view-controls > * {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .stats-bar {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .producers-table {
        min-width: 800px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
    }
}