/* ========================
   Phone Animation Styles
   ======================== */

.phone-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.phone {
    width: 320px;
    height: 650px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 40px;
    padding: 12px;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    position: relative;
    animation: phoneFloat 3s ease-in-out infinite;
}

@keyframes phoneFloat {
    0%, 100% {
        transform: translateY(0px) rotateY(-5deg);
    }
    50% {
        transform: translateY(-10px) rotateY(-5deg);
    }
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 25px;
    background: #000;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.phone-shadow {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 40px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3), transparent);
    filter: blur(20px);
}

/* Call Screen */
.call-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px 30px 40px;
    background: linear-gradient(180deg, #1e3a8a 0%, #1e293b 100%);
}

.call-info {
    text-align: center;
    color: white;
}

.incoming-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.phone-number {
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 30px;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.caller-details {
    margin-top: 20px;
}

.caller-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #3b82f6, #1e3a8a);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
    transition: all 0.5s ease;
}

.caller-avatar.identified {
    animation: avatarReveal 0.5s ease-out;
}

@keyframes avatarReveal {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.caller-name {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

.caller-name.show {
    opacity: 1;
    transform: translateY(0);
    animation: slideIn 0.5s ease-out;
}

.caller-position {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease 0.2s;
}

.caller-position.show {
    opacity: 1;
    transform: translateY(0);
    animation: slideIn 0.5s ease-out 0.2s;
}

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

/* Call Action Buttons */
.call-actions {
    display: flex;
    justify-content: center;
    gap: 60px;
    padding: 20px 0;
}

.call-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.call-btn:hover {
    transform: scale(1.1);
}

.call-btn.decline {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.call-btn.decline::before {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    font-weight: bold;
}

.call-btn.accept {
    background: linear-gradient(135deg, #10b981, #059669);
}

.call-btn.accept::before {
    content: '📞';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
}

.call-btn.decline:active {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.call-btn.accept:active {
    background: linear-gradient(135deg, #059669, #047857);
}

/* Ringing Animation - Reduced vibration */
@keyframes ring {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30%, 50% {
        transform: rotate(-3deg);
    }
    20%, 40% {
        transform: rotate(3deg);
    }
}

.phone.ringing {
    animation: phoneFloat 3s ease-in-out infinite, ring 1s ease-in-out infinite;
}

/* Identification Animation Sequence */
.identifying {
    position: relative;
}

.identifying::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 3px solid rgba(59, 130, 246, 0.5);
    animation: sonar 1.5s ease-out infinite;
}

@keyframes sonar {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Loading dots animation */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: loadingDot 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDot {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Success checkmark animation */
.checkmark {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10b981, #059669);
    margin: 0 auto;
    animation: scaleIn 0.5s ease-out;
}

.checkmark::before {
    content: '✓';
    font-size: 4rem;
    color: white;
    animation: checkmarkDraw 0.5s ease-out 0.3s;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes checkmarkDraw {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 968px) {
    .phone {
        width: 280px;
        height: 570px;
    }

    .caller-name {
        font-size: 1.5rem;
    }

    .phone-number {
        font-size: 1.5rem;
    }

    .caller-avatar {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
}

@media (max-width: 640px) {
    .phone {
        width: 260px;
        height: 530px;
    }

    .call-actions {
        gap: 40px;
    }

    .call-btn {
        width: 60px;
        height: 60px;
    }
}

.caller-badge {
    font-size: 0.85rem;
    color: rgba(100, 255, 150, 0.9);
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease 0.3s;
    font-weight: 500;
}

.caller-badge.show {
    opacity: 1;
    transform: translateY(0);
    animation: slideIn 0.5s ease-out 0.3s;
}
