/* Modern Auction Search Interface */

:root {
    --primary: #4a9eff;
    --primary-hover: #3b82f6;
    --secondary: #8b8b8b;
    --success: #22c55e;
    --success-dark: #15803d;
    --warning: #f59e0b;
    --danger: #ef4444;
    --accent: #8b5cf6;

    /* Dark theme colors similar to Dark Reader */
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-tertiary: #2e2e2e;
    --bg-card: #212121;
    --bg-elevated: #2a2a2a;

    --text-primary: #e8e6e3;
    --text-secondary: #b8b5b2;
    --text-muted: #a8a5a2;
    --text-dim: #8a8784;

    --border-primary: #3a3a3a;
    --border-secondary: #4a4a4a;
    --border-hover: #5a5a5a;

    --overlay: rgba(0, 0, 0, 0.5);
    --glass: rgba(255, 255, 255, 0.05);

    --border-radius: 12px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.main-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.refresh-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* ===== USER INFO ===== */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-welcome {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.user-dropdown .dropdown-menu {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 250px;
}

.user-dropdown .dropdown-item {
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 0.25rem;
}

.user-dropdown .dropdown-item:hover {
    background: var(--glass);
    color: var(--text-primary);
}

.user-dropdown .dropdown-item-text {
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    display: block;
}

.user-dropdown .dropdown-divider {
    border-color: var(--border-primary);
    margin: 0.5rem 0;
}

/* ===== SEARCH SECTION ===== */
.search-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.search-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.search-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 2rem;
    transition: all 0.2s ease;
    min-height: 60px;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(74, 158, 255, 0.2);
}

.search-icon {
    color: var(--text-muted);
    margin-right: 1rem;
    font-size: 1.125rem;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    padding-right: 170px;
    /* Space for clear button and search button */
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.875rem 2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.search-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.clear-btn {
    position: absolute;
    right: 140px;
    /* More space for search button */
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.875rem;
    width: 28px;
    height: 28px;
    z-index: 10;
}

.clear-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .search-section {
        padding: 1.5rem 0 2rem 0;
    }

    .search-card {
        margin: 0 0.75rem;
        padding: 1.5rem;
    }

    .search-input-wrapper {
        padding: 0.75rem 1rem;
        min-height: 52px;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .search-input {
        font-size: 0.9rem;
        padding-right: 0;
        flex: 1;
        min-width: 0;
        /* Allow input to shrink */
    }

    .search-btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        margin-left: 0;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: auto;
    }

    .search-btn i {
        margin-right: 0.25rem;
    }

    .clear-btn {
        right: 90px;
        /* Better positioning for mobile */
        top: 40%;
        width: 28px;
        height: 28px;
        padding: 0.25rem;
        font-size: 0.8rem;
    }

    .search-header h1 {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }

    .search-header p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }

    .search-help {
        margin: 1rem 0 1.5rem 0;
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .quick-locations {
        gap: 0.5rem;
        justify-content: flex-start;
    }

    .location-tag {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .quick-label {
        font-size: 0.85rem;
        margin-right: 0.25rem;
    }
}

.search-help {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 1.5rem 0 2rem 0;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius);
    width: 100%;
}

.search-help i {
    color: var(--primary);
}

.quick-locations {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.quick-label {
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 0.5rem;
}

.location-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.location-tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.location-tag.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== NEW AUCTIONS SECTION ===== */
.new-auctions-section {
    background: linear-gradient(135deg, #0f3460 0%, #1a1a2e 100%);
    padding: 2rem 0;
    border-bottom: 1px solid #2d3748;
}

.new-auctions-header {
    text-align: center;
    margin-bottom: 2rem;
}

.new-auctions-header h2 {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.new-badge {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.new-auctions-header p {
    color: #a0aec0;
    font-size: 1rem;
    margin: 0;
}

.new-auctions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.new-auction-card {
    background: rgba(45, 55, 72, 0.7);
    border: 1px solid #4a5568;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.new-auction-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: #63b3ed;
}

.new-auction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.new-tag {
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.auction-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.auction-details {
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.detail-row i {
    width: 18px;
    margin-right: 0.5rem;
}

.detail-row .price {
    font-weight: 600;
    font-size: 1rem;
}

.auction-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.auction-actions .btn {
    border-radius: 6px;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.auction-actions .heart-btn {
    padding: 0.4rem 0.6rem;
}

@media (max-width: 768px) {
    .new-auctions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .new-auctions-header h2 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.3rem;
    }

    .new-auction-card {
        padding: 1rem;
    }
}

/* ===== CONTROL PANEL ===== */
.control-panel {
    padding: 2rem 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .panel-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .search-section {
        padding: 2rem 1rem;
    }

    .search-card {
        padding: 2rem 1.5rem;
        margin: 0 auto;
        max-width: calc(100vw - 2rem);
        width: calc(100% - 2rem);
    }

    .search-header h1 {
        font-size: 2rem;
    }

    .search-header p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
}

.control-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    min-width: 0;
    min-height: 80px;
}

.control-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
}

.control-card:has(.custom-dropdown.open) {
    overflow: visible;
    z-index: 10;
}

.control-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.control-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    justify-content: center;
}

.control-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.2;
}

.control-select {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}

.control-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.monitor-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.monitor-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.next-refresh {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
    font-family: monospace;
}

.monitor-btn {
    background: var(--success-dark);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.monitor-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    background: var(--success);
}

.monitor-btn.active {
    background: var(--danger);
    color: white;
}

.monitor-status {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.monitor-status.active {
    color: var(--success);
}

/* ===== RESULTS SECTION ===== */
.results-section {
    padding: 2rem 0 4rem;
    min-height: 60vh;
}

.results-header {
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 1.5rem;
}

.results-info h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.results-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.pagination-info {
    color: var(--primary);
    font-weight: 600;
}

.last-updated {
    font-family: monospace;
}

/* ===== STATE CARDS ===== */
.state-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    max-width: 500px;
    margin: 2rem auto;
    box-shadow: var(--shadow);
}

.state-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.state-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.state-icon {
    font-size: 4rem;
    margin-bottom: 2rem;
}

.error-icon {
    color: var(--danger);
}

.empty-icon {
    color: var(--text-muted);
}

.loading-spinner {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-primary);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.retry-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* ===== RESULTS GRID ===== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 1024px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== AUCTION CARDS ===== */
.auction-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.auction-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--success));
}

.auction-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-hover);
    background: var(--bg-elevated);
}

.auction-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    margin-bottom: 1.5rem;
}

.auction-status.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.auction-status.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.auction-status.status-expired {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.auction-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.auction-details {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.auction-details li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.875rem;
}

.auction-details li:last-child {
    border-bottom: none;
}

.auction-details .label {
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 1rem;
}

.auction-details .value {
    color: var(--text-secondary);
    text-align: right;
    font-weight: 500;
}

.auction-details .value.price {
    color: var(--success);
    font-weight: 700;
    font-size: 1.125rem;
}

.auction-details .value.location {
    color: var(--primary);
    font-weight: 600;
}

.auction-details .value.date {
    font-family: monospace;
    font-size: 0.8rem;
}

.auction-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-primary);
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.favorite-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.favorite-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    transform: scale(1.1);
}

.favorite-btn.active {
    background: #ff6b6b;
    color: white;
    transform: scale(1.05);
}

.favorite-btn.active:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.details-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.details-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.auction-meta {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auction-link-btn {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.auction-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

/* ===== PAGINATION ===== */
.pagination-wrapper {
    max-width: 1400px;
    margin: 3rem auto 0;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
}

.pagination-nav {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.pagination-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-list li {
    display: flex;
}

.pagination-list a,
.pagination-list span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid var(--border-primary);
}

.pagination-list a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.pagination-list .active a {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-list .disabled span {
    background: var(--bg-secondary);
    color: var(--text-dim);
    cursor: not-allowed;
    border-color: var(--border-primary);
}

.pagination-list .disabled a {
    background: var(--bg-secondary);
    color: var(--text-dim);
    cursor: not-allowed;
    border-color: var(--border-primary);
}

.pagination-list .disabled a:hover {
    transform: none;
    background: var(--bg-secondary);
    color: var(--text-dim);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .header-content {
        padding: 0 1.5rem;
    }

    .panel-grid {
        padding: 0 1.5rem;
    }

    .results-header {
        padding: 0 1.5rem 1.5rem;
    }

    .results-grid {
        padding: 0 1.5rem;
    }

    .pagination-wrapper {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .search-section {
        padding: 2rem 0;
    }

    .search-card {
        margin: 0 1rem;
        padding: 2rem 1.5rem;
    }

    .search-header h1 {
        font-size: 2rem;
        line-height: 1.3;
    }

    .search-header p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .search-input-wrapper {
        flex-direction: column;
        gap: 1rem;
    }

    .search-btn {
        width: 100%;
        margin-left: 0;
        justify-content: center;
        padding: 1rem 2rem;
    }

    .search-help {
        margin: 1rem 0;
        text-align: left;
    }

    .quick-locations {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .quick-label {
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .location-tag {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
    }

    .control-panel {
        padding: 1.5rem 0;
    }

    .panel-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .control-card {
        padding: 1.25rem;
    }

    .control-icon {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }

    .monitor-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .monitor-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
    }

    #intervalSelect {
        width: 100% !important;
        margin-right: 0 !important;
    }

    .results-header {
        padding: 0 1rem 1.5rem;
    }

    .results-info h2 {
        font-size: 1.5rem;
    }

    .results-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .results-grid {
        padding: 0 1rem;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .auction-card {
        padding: 1.5rem;
    }

    .pagination-wrapper {
        padding: 0 1rem;
    }

    .pagination-list {
        gap: 0.25rem;
    }

    .pagination-list a,
    .pagination-list span {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .container-fluid {
        padding: 0 0.75rem;
    }

    .search-card {
        margin: 0 0.5rem;
        padding: 1.25rem;
    }

    .search-input-wrapper {
        padding: 0.5rem 0.75rem;
        min-height: 48px;
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        position: relative;
    }

    .search-input {
        order: 1;
        padding-right: 32px;
        /* Space for clear button only */
        text-align: left;
        height: 48px;
        /* Match wrapper height */
        line-height: 1.2;
        position: relative;
    }

    .search-btn {
        order: 2;
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
        margin-left: 0;
    }

    .clear-btn {
        right: 8px;
        /* Positioned at the edge of input */
        top: 47px;
        /* Centered in the input field area (48px / 2) */
        transform: translateY(-50%);
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
        z-index: 15;
    }

    .search-header h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    .search-header p {
        font-size: 0.9rem;
        text-align: center;
        margin-bottom: 1.25rem;
    }

    .quick-locations {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .quick-label {
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .location-tag {
        text-align: center;
        padding: 0.75rem;
        width: 100%;
    }

    .brand-text {
        font-size: 1.25rem;
    }

    .brand {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-content {
        padding: 0 0.75rem;
    }

    .control-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }

    .control-icon {
        margin: 0 auto 1rem;
    }

    .auction-title {
        font-size: 1.125rem;
    }

    .auction-card {
        padding: 1.25rem;
    }

    .auction-details .label {
        margin-right: 0.5rem;
    }

    .pagination-list a,
    .pagination-list span {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .state-card {
        margin: 1rem 0.75rem;
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 360px) {
    .search-card {
        margin: 0 0.5rem;
        padding: 1.25rem 0.75rem;
    }

    .search-header h1 {
        font-size: 1.5rem;
    }

    .control-card {
        padding: 0.75rem;
    }

    .auction-card {
        padding: 1rem;
    }

    .results-grid {
        padding: 0 0.5rem;
    }

    .pagination-wrapper {
        padding: 0 0.5rem;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-dialog {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-xl);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.details-grid {
    display: grid;
    gap: 2rem;
}

.detail-group {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.detail-group h3 {
    margin: 0 0 1rem 0;
    color: var(--primary);
    font-size: 1.125rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 0.5rem;
}

.detail-item {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-item .value {
    color: var(--text-primary);
    word-break: break-word;
}

.detail-item .value.description {
    white-space: pre-wrap;
    line-height: 1.6;
}

.detail-item .value.price {
    color: var(--success);
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid var(--border-primary);
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
}

/* Action Buttons Layout */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.details-btn {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.details-btn:hover {
    background: var(--accent);
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-content {
        padding: 1rem;
    }

    .modal-actions {
        padding: 1rem;
        flex-direction: column;
    }

    .details-grid {
        gap: 1rem;
    }

    .detail-group {
        padding: 1rem;
    }

    .detail-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .detail-item .label {
        font-weight: 600;
        color: var(--text-primary);
    }

    .action-buttons {
        flex-direction: column;
    }

    .details-btn,
    .auction-link-btn {
        justify-content: center;
    }
}

/* Simple dark theme select dropdown */
.dropdown-wrapper {
    position: relative;
    width: 100%;
}

.location-select {
    width: 100%;
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: var(--border-radius) !important;
    color: var(--text-primary) !important;
    padding: 0.75rem !important;
    font-size: 0.875rem !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.75rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.5em 1.5em !important;
    padding-right: 2.5rem !important;
}

.location-select:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2) !important;
}

.location-select option {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    padding: 0.5rem !important;
}

.selected-locations {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selected-location {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.remove-location {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.remove-location:hover {
    opacity: 1;
}

.choices__list--dropdown .choices__item--disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}

.choices__item--selectable::after {
    display: none;
}

.choices__group {
    border-bottom: 1px solid var(--border-primary);
}

.choices__heading {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.choices__item--choice.has-no-results,
.choices__item--choice.has-no-choices {
    color: var(--text-muted);
    padding: 1rem;
    text-align: center;
}

/* Location selector specific styling */
.location-selector {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.location-selector select {
    width: 100%;
    max-width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

/* Responsive adjustments for Choices.js */
@media (max-width: 768px) {
    .choices__inner {
        min-height: 40px;
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .choices__list--multiple .choices__item {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }

    .choices__list--dropdown {
        max-height: 250px;
    }

    .choices__list--dropdown .choices__item {
        padding: 0.6rem;
        font-size: 0.875rem;
    }
}