.connections-container {
    max-width: 1200px;
    margin: 0 auto;
    /* padding: 5px; */
    margin-bottom: 1%;
}
.connections-container .title{
    font-size: 16px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.show-all-btn {
    background: none;
    border: none;
    color: #4a90e2;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}

.show-all-btn:hover {
    text-decoration: underline;
}

.connections-grid {
    /* display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px; */
    display: grid;
    grid-column-gap: 14px;
    grid-row-gap: 14px;
    grid-template-rows: auto auto;
    grid-template-columns: repeat(4, 1fr);
    /* grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); */
    grid-auto-columns: 1fr;
    margin-bottom: 40px;
}

.connection-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: box-shadow 0.2s;
}

.connection-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.card-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.card-header {
    height: 80px;
    position: relative;
}

.profile-image-wrapper {
    position: relative;
    /* top: -12%; */
    margin-top: -50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: 130px;
    height: 130px;
}

.profile-image {
    width: 130px;
    min-width: 130px;
    min-height: 130px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    background: #e0e0e0;
}

.card-body {
    padding: 12px 16px 16px;
    text-align: center;
    position: relative;
}

.profile-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.verified-badge {
    color: #4a90e2;
    font-size: 14px;
}

.profile-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mutual-connections {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mutual-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.connect-btn {
    width: 100%;
    /* padding: 8px 14px;
    background: white;
    border: 1px solid #4a90e2;
    color: #4a90e2;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; */
}
.connect-btn svg{
    width: 20px;
    height: 20px;
    fill: #ffffff;
}
/* .connect-btn:hover {
    background: #4a90e2;
    color: white;
}
.connect-btn:hover svg{
    fill: #ffffff;
} */

.profile-badge {
    font-size: 12px;
    color: #ff6b35;
    margin-left: 2px;
}


/* error popup ui update */

/* .popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
} */

/* Timer Progress Bar */
.timer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 0 0 20px 20px;
    width: 100%;
    transform-origin: left;
    animation: countdown 5s linear forwards;
}

@keyframes countdown {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Style 4: Side Icon Layout */
.popup-connect {
    padding: 36px !important;
    gap: 24px;
    /* position: relative; */
    /* overflow: hidden; */
    align-items: flex-start !important;
}

.popup-overlay.active .popup-connect {
    transform: translateX(0);
    opacity: 1;
}

.popup-connect .icon-side {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #d32f2f 0%, #ff7c7c 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

/* .popup-connect .content-side {
    flex: 1;
} */

.popup-connect .title {
    font-size: 22px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
    margin-top: 0;
}

.popup-connect .message {
    font-size: 15px;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 0px;
}

.popup-connect .auto-close {
    font-size: 13px;
    color: #a0aec0;
}
        



/* Tablet */
@media (max-width: 1024px) {
    .connections-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .popup-connect{
        flex-direction: column !important;
        padding: 24px;
        margin: 20px;
    }
    .connections-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .section-title {
        font-size: 14px;
    }

    .show-all-btn {
        font-size: 13px;
    }

    .profile-name {
        font-size: 15px;
    }

    .profile-title {
        font-size: 12px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .connections-container {
        padding: 12px;
    }
    .connections-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* .connections-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    } */

    /* .connection-card {
        max-width: 400px;
        margin: 0 auto;
    } */

    .card-header {
        height: 70px;
    }

    .profile-image {
        width: 70px;
        height: 70px;
    }

    .profile-image-wrapper {
        bottom: -35px;
    }

    .card-body {
        padding: 45px 12px 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .show-all-btn {
        align-self: flex-end;
    }
}


.connections-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px;
}

.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    filter: grayscale(100%) brightness(0) saturate(100%) invert(46%) sepia(98%) saturate(2618%) hue-rotate(200deg) brightness(99%) contrast(92%);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

.loading-message {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    animation: fadeIn 0.5s ease-in;
}

.loading-submessage {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    max-width: 400px;
    animation: fadeIn 0.5s ease-in 0.2s both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Demo container - remove this in production */
.demo-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
}