/**
 * Styles for BuddyBoss Free Audio Video Calls
 *
 * @package BuddyBoss_Free_Audio_Video_Calls
 * @since 1.0.0
 */

/* Call Buttons in Message Header - BuddyBoss Style */
.single-message-thread-header {
	position: relative;
}

.bbfavc-call-buttons {
    position: absolute !important;
    top: 2px !important;
    right: 65px !important;
    display: flex !important;
    gap: 0px !important;
    z-index: 0 !important;
    background: rgb(255 0 0 / 0%) !important;
    padding: 5px !important;
    border-radius: 5px !important;
}

.bbfavc-call-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 44px !important;
	height: 44px !important;
	border: 2px solid #e1e5e9 !important;
	border-radius: 50% !important; /* Perfect circle */
	cursor: pointer !important;
	transition: all 0.3s ease !important;
	font-size: 18px !important;
	color: #6c757d !important; /* Modern gray color */
	background: #ffffff !important; /* Clean white background */
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
	position: relative !important;
	overflow: hidden !important;
}

.bbfavc-call-btn:hover {
	color: #ffffff !important; /* White icon on hover */
	background: #007cba !important; /* Blue background on hover */
	border-color: #007cba !important;
	box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3) !important;
	transform: translateY(-1px) !important; /* Subtle lift effect */
}

/* Audio Call Button - Modern circular design */
.bbfavc-audio-call {
    color: #000000 !important;
    border-color: #dedede !important;
}

.bbfavc-audio-call:hover {
	color: #ffffff !important;
	background: #28a745 !important;
	border-color: #28a745 !important;
	box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
}

/* Video Call Button - Modern circular design */
.bbfavc-video-call {
    color: #000000 !important;
    border-color: #d7d7d7 !important;
}

.bbfavc-video-call:hover {
	color: #ffffff !important;
	background: #007cba !important;
	border-color: #007cba !important;
	box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3) !important;
}

.bbfavc-call-btn:active {
	transform: translateY(0px); /* Remove lift on click */
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.bbfavc-call-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	color: #adb5bd !important;
	background: #f8f9fa !important;
	border-color: #e9ecef !important;
	box-shadow: none !important;
	transform: none !important;
}

.bbfavc-call-btn i {
	font-size: 18px;
	margin: 0;
	font-weight: normal;
	line-height: 1;
	transition: all 0.3s ease;
}

/* Ensure BuddyBoss icons display correctly */
.bbfavc-call-btn .bb-icon-l {
	font-size: 18px;
	color: inherit;
	transition: all 0.3s ease;
}

/* Ensure 3-dots menu is not covered */
.single-message-thread-header .actions,
.single-message-thread-header .header-actions,
.single-message-thread-header .thread-options {
	position: relative;
	z-index: 10;
}

/* Alternative positioning for different BuddyBoss layouts */
.messages .single-message-thread-header .bbfavc-call-buttons {
	right: 60px;
}

/* If there's a specific actions container, adjust positioning */
.single-message-thread-header:has(.actions) .bbfavc-call-buttons,
.single-message-thread-header:has(.header-actions) .bbfavc-call-buttons,
.single-message-thread-header:has(.thread-options) .bbfavc-call-buttons {
	right: 70px;
}

/* Call Modal Styles */
.bbfavc-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bbfavc-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
}

.bbfavc-modal-content {
	position: relative;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
	max-width: 90vw;
	max-height: 90vh;
	overflow: hidden;
	z-index: 1;
}

.bbfavc-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px;
	border-bottom: 1px solid #eee;
	background: #f8f9fa;
}

.bbfavc-modal-title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #333;
}

.bbfavc-modal-close {
	background: none;
	border: none;
	font-size: 20px;
	color: #666;
	cursor: pointer;
	padding: 5px;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.bbfavc-modal-close:hover {
	background: #e9ecef;
	color: #333;
}

.bbfavc-modal-body {
	padding: 0;
}

/* Incoming Call Interface */
.bbfavc-incoming-call {
	text-align: center;
	padding: 40px 20px;
	min-width: 400px;
}

.bbfavc-caller-info {
	margin-bottom: 30px;
}

.bbfavc-caller-avatar {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	margin: 0 auto 15px;
	background: #f0f0f0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32px;
	color: #666;
}

.bbfavc-caller-avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.bbfavc-caller-name {
	font-size: 24px;
	font-weight: 600;
	color: #333;
	margin-bottom: 5px;
}

.bbfavc-call-type-text {
	font-size: 16px;
	color: #666;
}

.bbfavc-incoming-actions {
	display: flex;
	gap: 20px;
	justify-content: center;
}

.bbfavc-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
}

.bbfavc-answer-btn {
	background: #28a745;
	color: #fff;
}

.bbfavc-answer-btn:hover {
	background: #218838;
	transform: translateY(-1px);
}

.bbfavc-decline-btn {
	background: #dc3545;
	color: #fff;
}

.bbfavc-decline-btn:hover {
	background: #c82333;
	transform: translateY(-1px);
}

/* Call Interface */
.bbfavc-call-interface {
	width: 800px;
	height: 600px;
	display: flex;
	flex-direction: column;
}

.bbfavc-jitsi-container {
	flex: 1;
	position: relative;
	background: #000;
}

#bbfavc-jitsi-meet {
	width: 100%;
	height: 100%;
}

.bbfavc-call-controls {
	background: #f8f9fa;
	padding: 15px 20px;
	border-top: 1px solid #eee;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.bbfavc-call-status {
	font-size: 14px;
	color: #666;
}

.bbfavc-call-duration {
	font-size: 16px;
	font-weight: 600;
	color: #333;
}

.bbfavc-control-buttons {
	display: flex;
	gap: 10px;
}

.bbfavc-control-btn {
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: #6c757d;
	color: #fff;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bbfavc-control-btn:hover {
	transform: translateY(-1px);
}

.bbfavc-control-btn.active {
	background: #007bff;
}

.bbfavc-end-btn {
	background: #dc3545;
}

.bbfavc-end-btn:hover {
	background: #c82333;
}

/* Notification styles */
.bbfavc-notification {
	position: fixed;
	top: 20px;
	right: 20px;
	padding: 15px 20px;
	border-radius: 8px;
	color: #fff;
	font-weight: 600;
	z-index: 999999;
	transform: translateX(400px);
	transition: transform 0.3s ease;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	max-width: 300px;
}

.bbfavc-notification.show {
	transform: translateX(0);
}

.bbfavc-notification-info {
	background: linear-gradient(135deg, #007bff, #0056b3);
}

.bbfavc-notification-success {
	background: linear-gradient(135deg, #28a745, #20c997);
}

.bbfavc-notification-error {
	background: linear-gradient(135deg, #dc3545, #c82333);
}

.bbfavc-notification-warning {
	background: linear-gradient(135deg, #ffc107, #e0a800);
	color: #212529;
}

/* Enhanced modal for incoming calls */
.bbfavc-modal.incoming-call {
	animation: bbfavc-incoming-call-pulse 1s infinite;
}

@keyframes bbfavc-incoming-call-pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.9;
	}
}

/* Make modal more prominent for incoming calls */
.bbfavc-modal.incoming-call .bbfavc-modal-backdrop {
	background: rgba(0, 0, 0, 0.95);
}

.bbfavc-modal.incoming-call .bbfavc-modal-content {
	border: 3px solid #007bff;
	box-shadow: 0 0 30px rgba(0, 123, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
	.bbfavc-call-buttons {
		top: 8px;
		right: 55px; /* Maintain space for 3-dots on mobile */
		gap: 8px;
	}

	.bbfavc-call-btn {
		width: 38px;
		height: 38px;
		font-size: 16px;
		border-width: 1.5px;
	}

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

	.bbfavc-call-btn .bb-icon-l {
		font-size: 16px;
	}

	.bbfavc-call-interface {
		width: 95vw;
		height: 70vh;
	}

	.bbfavc-incoming-call {
		min-width: 300px;
		padding: 30px 15px;
	}

	.bbfavc-incoming-actions {
		flex-direction: column;
		gap: 15px;
	}

	.bbfavc-btn {
		width: 100%;
		justify-content: center;
	}
}

/* Fallback for very narrow screens */
@media (max-width: 480px) {
	.bbfavc-call-buttons {
		right: 50px;
		gap: 6px;
	}

	.bbfavc-call-btn {
		width: 34px;
		height: 34px;
		font-size: 14px;
		border-width: 1px;
	}

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

	.bbfavc-call-btn .bb-icon-l {
		font-size: 14px;
	}

	.bbfavc-call-interface {
		width: 100vw;
		height: 100vh;
	}

	.bbfavc-modal-content {
		border-radius: 0;
		max-width: 100vw;
		max-height: 100vh;
	}
}

/* Call History Panel Styles */
.bbfavc-call-history-panel {
	position: absolute !important;
	top: 60px !important;
	right: 65px !important;
	width: 350px !important;
	max-height: 400px !important;
	background: #ffffff !important;
	border: 1px solid #e1e5e9 !important;
	border-radius: 8px !important;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
	z-index: 1000 !important;
	overflow: hidden !important;
}

.bbfavc-history-header {
	display: flex !important;
	justify-content: space-between !important;
	align-items: center !important;
	padding: 15px 20px !important;
	background: #f8f9fa !important;
	border-bottom: 1px solid #e1e5e9 !important;
}

.bbfavc-history-header h4 {
	margin: 0 !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	color: #333 !important;
}

.bbfavc-history-close {
	background: none !important;
	border: none !important;
	cursor: pointer !important;
	padding: 5px !important;
	color: #666 !important;
	font-size: 16px !important;
	border-radius: 4px !important;
	transition: all 0.2s ease !important;
}

.bbfavc-history-close:hover {
	background: #e9ecef !important;
	color: #333 !important;
}

.bbfavc-history-content {
	max-height: 320px !important;
	overflow-y: auto !important;
}

.bbfavc-history-loading {
	padding: 30px 20px !important;
	text-align: center !important;
	color: #666 !important;
}

.bbfavc-history-loading i {
	font-size: 20px !important;
	margin-right: 8px !important;
}

.bbfavc-history-empty {
	padding: 40px 20px !important;
	text-align: center !important;
	color: #999 !important;
}

.bbfavc-history-empty i {
	font-size: 32px !important;
	margin-bottom: 10px !important;
	display: block !important;
}

.bbfavc-history-item {
	display: flex !important;
	align-items: center !important;
	padding: 12px 20px !important;
	border-bottom: 1px solid #f1f3f4 !important;
	transition: background-color 0.2s ease !important;
}

.bbfavc-history-item:hover {
	background: #f8f9fa !important;
}

.bbfavc-history-item:last-child {
	border-bottom: none !important;
}

.bbfavc-history-icon {
	width: 36px !important;
	height: 36px !important;
	border-radius: 50% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	margin-right: 12px !important;
	font-size: 16px !important;
	color: #fff !important;
}

.bbfavc-history-icon.audio {
	background: #28a745 !important;
}

.bbfavc-history-icon.video {
	background: #007cba !important;
}

.bbfavc-history-icon.missed {
	background: #dc3545 !important;
}

.bbfavc-history-details {
	flex: 1 !important;
}

.bbfavc-history-type {
	font-weight: 600 !important;
	color: #333 !important;
	font-size: 14px !important;
	margin-bottom: 2px !important;
}

.bbfavc-history-date {
	font-size: 12px !important;
	color: #666 !important;
}

.bbfavc-history-duration {
	font-size: 11px !important;
	color: #999 !important;
}

.bbfavc-history-actions {
	display: flex !important;
	gap: 8px !important;
}

.bbfavc-history-action {
	width: 32px !important;
	height: 32px !important;
	border: none !important;
	border-radius: 50% !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	font-size: 14px !important;
	transition: all 0.2s ease !important;
}

.bbfavc-history-recall {
	background: #e3f2fd !important;
	color: #1976d2 !important;
}

.bbfavc-history-recall:hover {
	background: #1976d2 !important;
	color: #fff !important;
}

.bbfavc-history-delete {
	background: #ffebee !important;
	color: #d32f2f !important;
}

.bbfavc-history-delete:hover {
	background: #d32f2f !important;
	color: #fff !important;
}

/* History Button Styling */
.bbfavc-history-btn {
    color: #000000 !important;
    border-color: #d6d6d6 !important;
}

.bbfavc-history-btn:hover {
	color: #ffffff !important;
	background: #6c757d !important;
	border-color: #6c757d !important;
	box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3) !important;
}

/* Responsive for history panel */
@media (max-width: 768px) {
	.bbfavc-call-history-panel {
		width: 300px !important;
		right: 55px !important;
	}
}

@media (max-width: 480px) {
	.bbfavc-call-history-panel {
		width: 280px !important;
		right: 50px !important;
		max-height: 350px !important;
	}

	.bbfavc-history-content {
		max-height: 270px !important;
	}

	.bbfavc-history-item {
		padding: 10px 15px !important;
	}

	.bbfavc-history-icon {
		width: 32px !important;
		height: 32px !important;
		font-size: 14px !important;
	}

	.bbfavc-history-action {
		width: 28px !important;
		height: 28px !important;
		font-size: 12px !important;
	}
}
