/**
 * Vanity Shop - Light Minimalist Bank Style
 */

/* Hero Section - Search + Filters Layout */
.vanity-hero {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 40px 0 30px;
    min-height: auto;
    border-bottom: 1px solid #e2e8f0;
}

/* Desktop: Search left (50%), Filters right (50%) */
.hero-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.search-section {
    text-align: left;
}

/* Section Header with Help Button */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.vanity-hero h1 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.5px;
}

/* How to Buy Button */
.how-to-buy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.how-to-buy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.how-to-buy-btn i {
    font-size: 1rem;
}

/* Search Card */
.search-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Search Tabs */
.search-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.search-tab {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.search-tab:hover {
    border-color: #667eea;
    color: #1e293b;
}

.search-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
}

/* Search Input */
.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.search-input-wrapper:focus-within {
    border-color: #667eea;
}

.address-prefix {
    padding: 0 0 0 18px;
    color: #667eea;
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    user-select: none;
    pointer-events: none;
    border: none;
    outline: none;
    box-shadow: none;
    text-decoration: none;
}

.input-with-wildcards {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.wildcard {
    color: #94a3b8;
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1rem;
    font-weight: 400;
    user-select: none;
    pointer-events: none;
    display: none;
    flex-shrink: 0;
}

.wildcard.visible {
    display: inline;
}

.wildcard-left {
    margin-left: 2px;
}

.wildcard-right {
    margin-right: 0;
}

.search-input {
    width: auto;
    min-width: 80px;
    max-width: 100%;
    padding: 16px 0 16px 6px;
    background: transparent;
    border: none !important;
    color: #1e293b;
    font-size: 1.1rem;
    font-family: 'Roboto Mono', monospace;
    outline: none !important;
    box-shadow: none !important;
}

.search-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-btn {
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn:hover {
    opacity: 0.9;
}

/* Search Hints */
.search-hints {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
}

.search-hints span {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Quick Categories */
.quick-categories {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.quick-cat {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-cat:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    color: #1e293b;
}

/* Filters Section (Right Panel) */
.filters-section {
    position: sticky;
    top: 20px;
}

.filters-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.filters-card h3 {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters-card h3 i {
    color: #667eea;
}

/* Filters in 2 columns */
.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.filter-group {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.results-info {
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.results-info span {
    color: #667eea;
    font-weight: 600;
}

/* Stats Ticker */
.stats-ticker {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 10px 0;
    margin-top: 30px;
    overflow: hidden;
}

.stats-ticker-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ticker-item {
    color: #cbd5e1;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ticker-item i {
    color: #667eea;
    font-size: 0.9rem;
}

.ticker-item strong {
    color: #fff;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}

.ticker-sep {
    color: #475569;
    font-size: 0.7rem;
}

@media (max-width: 768px) {
    .stats-ticker-content {
        gap: 10px;
    }
    .ticker-item {
        font-size: 0.75rem;
    }
    .ticker-sep {
        display: none;
    }
}

/* Results Section */
.vanity-results-section {
    padding: 30px 0 60px;
    background: #f8fafc;
    min-height: 50vh;
}

.filter-select {
    width: 100%;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
    transition: border-color 0.2s;
}

.filter-select:hover,
.filter-select:focus {
    border-color: #667eea;
}

.filter-select option {
    background: #fff;
    color: #1e293b;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 8px 10px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover,
.view-btn.active {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    color: #667eea;
}

/* States */
.loading-state,
.empty-state,
.no-results-state {
    text-align: center;
    padding: 80px 20px;
    color: #64748b;
}

.loading-state .spinner,
.empty-state i,
.no-results-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #cbd5e1;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.results-grid.list-view {
    grid-template-columns: 1fr;
}

/* Address Card */
.address-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.address-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.address-card.in-cart {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.address-display {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: #64748b;
    word-break: break-all;
    margin-bottom: 15px;
    line-height: 1.5;
}

.address-display .highlight {
    color: #667eea;
    font-weight: 600;
}

.address-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 15px;
}

.pattern-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pattern-type {
    padding: 3px 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
    color: #667eea;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.pattern-value {
    font-family: 'Roboto Mono', monospace;
    color: #1e293b;
    font-size: 0.85rem;
}

.address-price {
    text-align: right;
}

.price-value {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
}

.price-currency {
    color: #667eea;
    font-size: 0.8rem;
    margin-left: 4px;
}

.price-usd {
    color: #64748b;
    font-size: 0.75rem;
}

/* Card Actions */
.address-actions {
    display: flex;
    gap: 10px;
}

.btn-add-cart {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-cart:hover {
    opacity: 0.9;
}

.btn-add-cart.in-cart {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-copy {
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* List View Adjustments */
.results-grid.list-view .address-card {
    display: grid;
    grid-template-columns: 1fr 150px 120px 160px;
    gap: 20px;
    align-items: center;
    padding: 16px 20px;
}

.results-grid.list-view .address-display {
    margin: 0;
}

.results-grid.list-view .address-meta {
    display: contents;
}

.results-grid.list-view .pattern-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.results-grid.list-view .address-price {
    text-align: left;
}

.results-grid.list-view .address-actions {
    justify-content: flex-end;
}

/* Load More */
.load-more-wrapper {
    text-align: center;
    margin-top: 30px;
}

.load-more-btn {
    padding: 12px 40px;
    background: #fff;
    border: 1px solid #667eea;
    border-radius: 8px;
    color: #667eea;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* Cart Floating Button */
.cart-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
}

.cart-floating-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: #fff;
    font-size: 1.4rem;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    position: relative;
}

.cart-floating-btn:hover {
    transform: scale(1.1);
    color: #fff;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #ef4444;
    border-radius: 11px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-floating:not(.has-items) .cart-badge {
    display: none;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: #fff;
    border: 1px solid #10b981;
    border-radius: 10px;
    color: #10b981;
    font-size: 0.9rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast-notification.error {
    border-color: #ef4444;
    color: #ef4444;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .search-section {
        text-align: center;
    }

    .quick-categories {
        justify-content: center;
    }

    .filters-section {
        position: static;
    }

    .filters-card h3 {
        display: none;
    }

    .filters-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .vanity-hero {
        padding: 30px 0 20px;
    }

    .vanity-hero h1 {
        font-size: 1.35rem;
    }

    .search-card {
        padding: 18px 14px;
    }

    .search-type-tabs {
        flex-wrap: wrap;
    }

    .search-tab {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .search-input {
        font-size: 1rem;
        padding: 14px 10px 14px 4px;
    }

    .search-btn {
        padding: 14px 18px;
    }

    .quick-categories {
        gap: 8px;
    }

    .quick-cat {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .filters-grid {
        grid-template-columns: 1fr 1fr;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .results-grid.list-view .address-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cart-floating {
        bottom: 20px;
        right: 20px;
    }

    .cart-floating-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

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

/* ========================================
   Help Modal
   ======================================== */

/* Help Modal Overlay */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.help-modal.show {
    opacity: 1;
    visibility: visible;
}

/* Help Modal Content */
.help-modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.help-modal.show .help-modal-content {
    transform: translateY(0);
}

/* Help Modal Header */
.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.help-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.help-modal-close:hover {
    opacity: 1;
}

/* Help Modal Body */
.help-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

/* Help Sections */
.help-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.help-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.help-section h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 1.05rem;
    font-weight: 600;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

.help-section p {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.help-section ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.8;
}

.help-section ul li {
    margin-bottom: 4px;
}

.help-section strong {
    color: #1e293b;
}

/* Warning Section */
.help-section.help-warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.help-section.help-warning h3 {
    color: #92400e;
}

.help-section.help-warning h3 i {
    color: #d97706;
}

.help-section.help-warning p,
.help-section.help-warning ul {
    color: #78350f;
}

/* Security Steps */
.security-step {
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    margin: 12px 0;
}

.security-step h4 {
    color: #92400e;
    font-size: 0.9rem;
    margin: 0 0 8px 0;
}

.security-step p {
    margin: 0;
    color: #78350f;
}

.code-example {
    background: #1e293b;
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 10px;
}

.code-example code {
    color: #10b981;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
}

/* Tip Section */
.help-section.help-tip {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 12px;
    padding: 20px;
}

.help-section.help-tip h3 {
    color: #065f46;
}

.help-section.help-tip h3 i {
    color: #10b981;
}

.help-section.help-tip ul {
    color: #047857;
}

/* Links Section */
.help-section.help-links h3 i {
    color: #667eea;
}

.help-section.help-links ul {
    list-style: none;
    padding-left: 0;
}

.help-section.help-links ul li {
    margin-bottom: 8px;
}

.help-section.help-links a {
    color: #667eea;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.help-section.help-links a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Help Modal Responsive */
@media (max-width: 768px) {
    .section-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .how-to-buy-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .help-modal {
        padding: 10px;
    }

    .help-modal-content {
        max-height: 90vh;
    }

    .help-modal-header {
        padding: 16px 18px;
    }

    .help-modal-header h2 {
        font-size: 1.1rem;
    }

    .help-modal-body {
        padding: 18px;
        max-height: calc(90vh - 70px);
    }

    .help-section h3 {
        font-size: 1rem;
    }

    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
}
