/* ===== Home page styles ===== */

/* Light aqua background for Home (overrides white in common.css) */
html, body {
    background: #d3f9f5;
}

.app-container {
    background: #d3f9f5;
}




/* User grid */
.user-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* User card */
.user-card {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
}

/* Fallback for old WebView/browsers without aspect-ratio (prevent grid collapse) */
@supports not (aspect-ratio: 1) {
    .user-card {
        height: 0;
        padding-top: 133.3333%; /* 4/3 */
    }

    .user-photo {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }

}


.user-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Online badge */
.online-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(34, 197, 94, 0.95);
    padding: 4px 8px;
    border-radius: 10px;
    z-index: 2;
}

.online-dot {
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
}

.online-text {
    font-size: 11px;
    font-weight: 500;
    color: #ffffff;
}

/* Card bottom info */
.card-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
    z-index: 2;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Video call button */
.video-btn {
    width: 38px;
    height: 38px;
    background: #ec4899;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.4);
    transition: transform 0.2s;
}

.video-btn i {
    font-size: 20px;
    color: #ffffff;
}

.video-btn:active {
    transform: scale(0.92);
}

/* ===== Video call modal styles ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.call-modal {
    width: 85%;
    max-width: 320px;
    height: 480px;
    background: #000;
    border-radius: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.modal-bg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.modal-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px 40px;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.8) 100%);
    color: #ffffff;
}

.caller-avatar-wrapper {
    margin-bottom: 20px;
    position: relative;
}

.avatar-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.4);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Core pulse animation: expand then contract */
    animation: avatar-pulse 2s infinite ease-in-out;
}

/* Extra halo layer: expands outward and fades */
.avatar-circle::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: ripple-out 2s infinite ease-out;
}

@keyframes avatar-pulse {
    0%, 100% {
        transform: scale(1);
        border-color: rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.12);
        border-color: rgba(255, 255, 255, 0.7);
    }
}

@keyframes ripple-out {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}


.avatar-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
}

.caller-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.call-type {
    font-size: 15px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.call-actions {
    display: flex;
    gap: 40px;
    margin-bottom: 20px;
}

.call-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.call-btn:active {
    transform: scale(0.9);
}

.call-btn .material-symbols-rounded {
    font-size: 32px;
    color: #ffffff;
}

.call-btn.decline {
    background: #ff4b4b;
    box-shadow: 0 8px 20px rgba(255, 75, 75, 0.4);
}

.call-btn.accept {
    background: #22c55e;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
}


/* Insufficient balance alert (triggered on call accept) */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.alert-modal {
    width: 280px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    animation: alert-pop 0.2s ease-out;
}

@keyframes alert-pop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.alert-content {
    padding: 24px 20px;
}

.alert-title {
    font-size: 18px;
    font-weight: 600;
    color: #000;
    margin-bottom: 8px;
}

.alert-message {
    font-size: 14px;
    color: #999;
}

.alert-actions {
    display: flex;
    border-top: 1px solid #eee;
}

.alert-btn {
    flex: 1;
    padding: 12px 0;
    font-size: 17px;
    background: none;
    border: none;
    cursor: pointer;
}

.alert-btn.cancel {
    color: #000;
    border-right: 1px solid #eee;
}

.alert-btn.recharge {
    color: #007bff;
    font-weight: 500;
}

.alert-btn:active {
    background: #f9f9f9;
}

/* Responsive tweaks */
@media (max-height: 600px) {
    .call-modal {
        height: 420px;
    }
    .avatar-circle {
        width: 90px;
        height: 90px;
    }
}


