
/**
 * Followers/Following Modal Component
 * ByLearning - Instagram-style followers modal
 */

/* ================================================
   MODAL OVERLAY & CONTAINER
   ================================================ */

.bl-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.bl-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.bl-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.bl-modal-content {
    position: relative;
    width: 400px;
    max-height: 600px;
    background: var(--white, #FFFFFF);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* ================================================
   MODAL HEADER
   ================================================ */

.bl-modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #E1E5E9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white, #FFFFFF);
}

.bl-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark, #003366);
    margin: 0;
}

.bl-modal-close {
    background: none;
    border: none;
    color: #6B7280;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.bl-modal-close:hover {
    color: var(--primary-dark, #003366);
    background: rgba(0, 51, 102, 0.05);
}

/* ================================================
   SEARCH BAR
   ================================================ */

.bl-modal-search {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #E1E5E9);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #F5F5F5;
}

.bl-modal-search i {
    color: #9CA3AF;
    font-size: 0.9rem;
}

.bl-modal-search input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    color: #1F2937;
}

.bl-modal-search input::placeholder {
    color: #9CA3AF;
}

/* ================================================
   MODAL BODY
   ================================================ */

.bl-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.bl-modal-body::-webkit-scrollbar {
    width: 6px;
}

.bl-modal-body::-webkit-scrollbar-track {
    background: #F5F5F5;
}

.bl-modal-body::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.bl-modal-body::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* ================================================
   USER LIST
   ================================================ */

.bl-user-list {
    display: flex;
    flex-direction: column;
}

/* User Item */
.bl-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    transition: background 0.2s;
}

.bl-user-item:hover {
    background: #F9FAFB;
}

/* User Info */
.bl-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    cursor: pointer;
    min-width: 0;
}

.bl-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color, #E1E5E9);
    flex-shrink: 0;
}

.bl-user-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.bl-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1F2937;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bl-verified-badge {
    color: var(--accent-green, #4CAF50);
    font-size: 0.85rem;
    display: inline-flex;
    flex-shrink: 0;
}

.bl-user-meta {
    font-size: 0.8rem;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bl-user-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    background: rgba(51, 102, 153, 0.1);
    color: var(--primary-medium, #336699);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* ================================================
   FOLLOW BUTTON
   ================================================ */

.bl-follow-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.bl-follow-btn:not(.following) {
    background: var(--accent-green, #4CAF50);
    color: white;
}

.bl-follow-btn:not(.following):hover {
    background: #45A049;
    transform: translateY(-1px);
}

.bl-follow-btn.following {
    background: #E1E5E9;
    color: var(--primary-dark, #003366);
}

.bl-follow-btn.following:hover {
    background: #D1D5DB;
}

.bl-follow-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ================================================
   LOADING STATE
   ================================================ */

.bl-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: #6B7280;
}

.bl-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E5E7EB;
    border-top-color: var(--accent-green, #4CAF50);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

.bl-modal-loading p {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ================================================
   EMPTY STATE
   ================================================ */

.bl-modal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: #9CA3AF;
}

.bl-modal-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.bl-modal-empty p {
    font-size: 0.95rem;
    font-weight: 500;
}

/* ================================================
   ERROR STATE
   ================================================ */

.bl-modal-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: #EF4444;
}

.bl-modal-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.bl-modal-error p {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: #6B7280;
}

.bl-retry-btn {
    padding: 0.6rem 1.5rem;
    background: var(--accent-green, #4CAF50);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.bl-retry-btn:hover {
    background: #45A049;
    transform: translateY(-2px);
}

/* ================================================
   ANIMATIONS
   ================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ================================================
   MOBILE RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .bl-modal-content {
        width: 90%;
        max-width: 400px;
        max-height: 80vh;
    }

    .bl-modal-header,
    .bl-modal-search {
        padding: 0.75rem 1rem;
    }

    .bl-user-item {
        padding: 0.75rem 1rem;
    }

    .bl-user-avatar {
        width: 40px;
        height: 40px;
    }

    .bl-follow-btn {
        padding: 0.45rem 1rem;
        font-size: 0.8rem;
    }
}
