/* ============================================
   BizConnect - Directory & Search Styles
   Mobile-first A-Z directory
   ============================================ */

/* ============ DIRECTORY LAYOUT ============ */
.directory-layout {
    display: flex;
    min-height: calc(100vh - 64px);
    position: relative;
}

.directory-main {
    flex: 1;
    padding: 20px 24px 60px;
    max-width: 100%;
    margin-right: 44px;
}

/* ============ SEARCH HEADER ============ */
.search-header {
    margin-bottom: 24px;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    font-size: 18px;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    background: var(--white);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 237, 144, 0.3);
}

.search-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    background: var(--white);
    min-width: 130px;
    transition: var(--transition);
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--gold);
    outline: none;
}

.active-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.filter-tag {
    background: var(--gold);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-tag a {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    opacity: 0.7;
}

.filter-tag a:hover {
    opacity: 1;
}

/* ============ BUSINESS CARDS GRID ============ */
.biz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.biz-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.biz-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.biz-card-top {
    background: linear-gradient(135deg, var(--primary), #1a2730);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    position: relative;
}

.biz-card-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--white);
    border: 2px solid var(--gold);
}

.biz-card-logo-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--gold);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
}

.wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    backdrop-filter: blur(4px);
}

.wishlist-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.wishlist-btn.active {
    color: #ef4444;
    background: rgba(255, 255, 255, 0.9);
}

.biz-card-body {
    padding: 14px 16px;
}

.biz-card-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.biz-card-category {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.biz-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* ============ FAST SCROLLER (RecyclerView-style) ============ */
.az-strip {
    position: fixed;
    right: 0;
    top: 64px;
    height: calc(100vh - 64px);
    width: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    z-index: 50;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    background: transparent;
    transition: background 0.3s ease;
}

/* Glass background on hover/active */
.az-strip.active,
.az-strip:hover {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

.az-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    font-size: 10px;
    font-weight: 700;
    color: rgba(17, 25, 31, 0.45);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
}

.az-letter:hover {
    color: var(--primary);
    transform: scale(1.3);
    background: rgba(255, 237, 144, 0.4);
}

/* Active letter (currently visible section) */
.az-letter.active {
    background: var(--primary);
    color: var(--gold);
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(17, 25, 31, 0.3);
}

/* Highlight on scrub - the letter being touched/hovered during drag */
.az-letter.scrubbing {
    background: var(--gold);
    color: var(--primary);
    transform: scale(1.5);
    box-shadow: 0 2px 12px rgba(255, 237, 144, 0.5);
}

.az-letter.disabled {
    color: rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

/* Neighbours scale effect - letters near the scrubbed one get slightly bigger */
.az-letter.near {
    transform: scale(1.15);
    color: rgba(17, 25, 31, 0.7);
}

/* ---- Bubble Indicator (Android-style popup) ---- */
.az-bubble {
    position: fixed;
    right: 56px;
    width: 64px;
    height: 64px;
    border-radius: 50% 50% 50% 8px;
    background: linear-gradient(135deg, var(--primary), #1a2730);
    color: var(--gold);
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(17, 25, 31, 0.4);
    opacity: 0;
    transform: scale(0.3) rotate(45deg);
    transform-origin: bottom right;
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 60;
    letter-spacing: -1px;
}

.az-bubble.show {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Bubble inner glow */
.az-bubble::after {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 237, 144, 0.15);
    top: 8px;
    left: 8px;
}

/* ---- Section Headers ---- */
.biz-section-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    margin-top: 8px;
}

.biz-section-letter {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(17, 25, 31, 0.2);
}

.biz-section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

/* ---- Scroll-to-top fab (appears when scrolled) ---- */
.scroll-top-fab {
    position: fixed;
    bottom: 24px;
    right: 56px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--gold);
    border: none;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 49;
}

.scroll-top-fab.show {
    opacity: 1;
    transform: translateY(0);
}

.scroll-top-fab:hover {
    background: #1a2730;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

/* ============ FULLSCREEN CARD ============ */
.fullscreen-card-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.fullscreen-card-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.fullscreen-card {
    background: var(--white);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.fullscreen-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    color: var(--text);
}

.fullscreen-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.fullscreen-card-content {
    padding: 0;
}

/* Fullscreen card inner styles */
.fc-header {
    background: linear-gradient(135deg, var(--primary), #1a2730);
    padding: 32px 28px;
    color: var(--white);
    border-radius: 20px 20px 0 0;
}

.fc-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    background: var(--white);
    border: 3px solid var(--gold);
}

.fc-logo-ph {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--gold);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 26px;
}

.fc-body {
    padding: 24px 28px;
}

.fc-info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 14px;
}

.fc-info-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.fc-actions {
    display: flex;
    gap: 10px;
    padding: 20px 28px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* Empty Directory State */
.empty-directory {
    text-align: center;
    padding: 80px 20px;
}

.empty-directory h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-directory p {
    color: var(--text-muted);
    max-width: 300px;
    margin: 0 auto;
}

/* Loader */
.loader {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .directory-main {
        margin-right: 36px;
        padding: 16px 12px 40px;
    }

    .az-strip {
        width: 32px;
    }

    .az-letter {
        width: 24px;
        height: 18px;
        font-size: 9px;
    }

    .az-bubble {
        right: 46px;
        width: 52px;
        height: 52px;
        font-size: 22px;
    }

    .biz-section-letter {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .scroll-top-fab {
        right: 46px;
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .biz-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .biz-card-top {
        padding: 16px;
        min-height: 80px;
    }

    .biz-card-logo,
    .biz-card-logo-placeholder {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .biz-card-body {
        padding: 10px 12px;
    }

    .biz-card-name {
        font-size: 13px;
    }

    .search-filters {
        flex-wrap: wrap;
    }

    .filter-select {
        min-width: 100px;
        font-size: 12px;
        padding: 8px 10px;
    }

    .fullscreen-card {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 16px;
        margin: 0;
    }

    .fc-header {
        padding: 24px 20px;
    }

    .fc-body {
        padding: 20px;
    }

    .fc-actions {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .biz-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .az-strip {
        width: 26px;
    }

    .az-letter {
        width: 20px;
        height: 16px;
        font-size: 8px;
    }

    .az-bubble {
        right: 38px;
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    .directory-main {
        margin-right: 26px;
        padding: 12px 8px 40px;
    }

    .biz-section-header {
        padding: 6px 0;
    }

    .biz-section-letter {
        width: 26px;
        height: 26px;
        font-size: 12px;
        border-radius: 8px;
    }

    .scroll-top-fab {
        right: 38px;
        bottom: 16px;
    }
}