/* Fishtank Calling UI Styles */

/* Call Modal Overlay */
.call-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.85) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.call-modal-overlay.is-active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Call Modal */
.call-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Caller Avatar */
.call-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 48px;
    font-weight: 600;
    color: #fff;
    position: relative;
}

.call-avatar.is-ringing {
    animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* Incoming call shake animation */
.call-avatar.is-incoming {
    animation: shake-ring 0.5s ease-in-out infinite;
}

@keyframes shake-ring {
    0%,
    100% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
}

/* Dialing dots animation */
.call-status-dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 4px;
}

.call-status-dots span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: dot-bounce 1.4s infinite ease-in-out both;
}

.call-status-dots span:nth-child(1) {
    animation-delay: -0.32s;
}
.call-status-dots span:nth-child(2) {
    animation-delay: -0.16s;
}
.call-status-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes dot-bounce {
    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Call Info */
.call-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.call-status {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.call-timer {
    font-size: 32px;
    font-weight: 300;
    margin: 20px 0;
    font-variant-numeric: tabular-nums;
}

/* Call Actions */
.call-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 32px;
}

.call-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.call-btn:active {
    transform: scale(0.95);
}

.call-btn.is-answer {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(56, 239, 125, 0.4);
}

.call-btn.is-end {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(235, 51, 73, 0.4);
}

.call-btn.is-mute {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.call-btn.is-mute.is-active {
    background: #fff;
    color: #1a1a2e;
}

.call-btn.is-speaker {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.call-btn.is-speaker.is-active {
    background: #fff;
    color: #1a1a2e;
}

/* Incoming Call Actions */
.call-actions-incoming {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 32px;
}

/* Dialing state - show end call only */
.call-actions-dialing {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

/* Call Button on Profile */
.btn-call {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-call:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.btn-call:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-call i {
    font-size: 18px;
}

/* Video Container */
.call-video-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
}

.call-video-remote {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.call-video-local {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 120px;
    aspect-ratio: 4/3;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #fff;
}

/* Call Quality Indicator */
.call-quality {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    margin-bottom: 16px;
}

.call-quality-bar {
    width: 4px;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.call-quality-bar.is-active {
    background: #38ef7d;
}

.call-quality-bar:nth-child(1) {
    height: 8px;
}
.call-quality-bar:nth-child(2) {
    height: 12px;
}
.call-quality-bar:nth-child(3) {
    height: 16px;
}
.call-quality-bar:nth-child(4) {
    height: 20px;
}

/* In-app call button in profile */
.btn-call-inapp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font: inherit;
    transition: opacity 0.2s ease;
}

.btn-call-inapp:hover {
    opacity: 0.7;
}

.btn-call-inapp:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-call-inapp i {
    font-size: 1em;
}

/* Loading Spinner */
.call-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: call-spin 0.8s linear infinite;
}

.call-spinner.is-small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.call-spinner.is-dark {
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: #333;
}

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

.call-btn.is-loading,
.btn-call-inapp.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.call-btn.is-loading i,
.btn-call-inapp.is-loading i,
.call-btn.is-loading span,
.btn-call-inapp.is-loading span {
    display: none;
}

.call-btn .call-spinner,
.btn-call-inapp .call-spinner {
    display: none;
}

.call-btn.is-loading .call-spinner,
.btn-call-inapp.is-loading .call-spinner {
    display: inline-block;
}

/* Responsive */
@media (max-width: 480px) {
    .call-modal {
        margin: 16px;
        padding: 32px 24px;
    }

    .call-avatar {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }

    .call-name {
        font-size: 20px;
    }

    .call-timer {
        font-size: 28px;
    }

    .call-btn {
        width: 56px;
        height: 56px;
        font-size: 20px;
    }

    .call-actions-incoming {
        gap: 40px;
    }
}
