/**
 * Dashboard Styles
 */

.tvb-dashboard-container {
	max-width: 1200px;
	margin: 20px auto;
	padding: 0;
}

.tvb-dashboard-header {
	margin-bottom: 30px;
	padding-bottom: 15px;
	border-bottom: 2px solid #ddd;
}

.tvb-dashboard-header h2 {
	margin: 0;
	color: #333;
	font-size: 32px;
}

.tvb-dashboard-section {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 25px;
	margin-bottom: 25px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tvb-dashboard-section h3 {
	margin: 0 0 20px 0;
	color: #333;
	font-size: 22px;
	border-bottom: 1px solid #eee;
	padding-bottom: 10px;
}

/* Balance Section */
.tvb-balance-section {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	border: none;
}

.tvb-balance-section h3 {
	color: #fff;
	border-bottom-color: rgba(255, 255, 255, 0.3);
}

.tvb-balance-display {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.tvb-balance-main {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 15px;
}

.tvb-balance-label {
	font-size: 18px;
	font-weight: 500;
}

.tvb-balance-value {
	font-size: 48px;
	font-weight: bold;
	line-height: 1;
}

.tvb-balance-stats {
	display: flex;
	gap: 30px;
	flex-wrap: wrap;
}

.tvb-stat-item {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.tvb-stat-label {
	font-size: 14px;
	opacity: 0.9;
}

.tvb-stat-value {
	font-size: 20px;
	font-weight: 600;
}

/* Call Section */
.tvb-call-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.tvb-form-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tvb-form-group label {
	font-weight: 600;
	color: #333;
	font-size: 14px;
}

.tvb-required {
	color: #e74c3c;
}

.tvb-input {
	padding: 12px 15px;
	border: 2px solid #ddd;
	border-radius: 5px;
	font-size: 16px;
	transition: border-color 0.3s ease;
}

.tvb-input:focus {
	outline: none;
	border-color: #667eea;
}

.tvb-help-text {
	color: #666;
	font-size: 13px;
	margin-top: 5px;
}

.tvb-button {
	padding: 12px 30px;
	border: none;
	border-radius: 5px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	display: inline-block;
	text-align: center;
}

.tvb-button-primary {
	background: #667eea;
	color: #fff;
}

.tvb-button-primary:hover {
	background: #5568d3;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.tvb-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.tvb-messages {
	margin-top: 15px;
	min-height: 30px;
}

.tvb-message {
	padding: 12px 15px;
	border-radius: 5px;
	margin: 10px 0;
	font-size: 14px;
}

.tvb-message-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.tvb-message-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.tvb-insufficient-balance {
	text-align: center;
	padding: 20px;
}

.tvb-insufficient-balance p {
	margin: 0 0 15px 0;
	color: #666;
	font-size: 16px;
}

/* History Section */
.tvb-table-container {
	overflow-x: auto;
}

.tvb-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 15px;
}

.tvb-table thead {
	background: #f8f9fa;
}

.tvb-table th {
	padding: 12px 15px;
	text-align: left;
	font-weight: 600;
	color: #333;
	border-bottom: 2px solid #ddd;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.tvb-table td {
	padding: 12px 15px;
	border-bottom: 1px solid #eee;
	color: #666;
	font-size: 14px;
}

.tvb-table tbody tr:hover {
	background: #f8f9fa;
}

.tvb-status {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: capitalize;
}

.tvb-status-completed {
	background: #d4edda;
	color: #155724;
}

.tvb-status-initiated,
.tvb-status-ringing,
.tvb-status-in-progress {
	background: #d1ecf1;
	color: #0c5460;
}

.tvb-status-failed,
.tvb-status-busy,
.tvb-status-no-answer {
	background: #f8d7da;
	color: #721c24;
}

.tvb-status-pending {
	background: #fff3cd;
	color: #856404;
}

.tvb-no-data {
	text-align: center;
	padding: 40px 20px;
	color: #999;
	font-style: italic;
}

.tvb-dashboard-error {
	padding: 20px;
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
	border-radius: 5px;
	text-align: center;
}

.tvb-error-message {
	color: #e74c3c;
	font-size: 14px;
	margin: 10px 0;
	padding: 10px;
	background: #fee;
	border-left: 3px solid #e74c3c;
	border-radius: 3px;
}

/* Loading States */
.tvb-loading {
	position: relative;
	pointer-events: none;
	opacity: 0.6;
}

.tvb-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #667eea;
	border-radius: 50%;
	animation: tvb-spin 1s linear infinite;
}

@keyframes tvb-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.tvb-button-loading {
	position: relative;
	color: transparent !important;
}

.tvb-button-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top: 2px solid #fff;
	border-radius: 50%;
	animation: tvb-spin 0.8s linear infinite;
}

/* Call Status Indicator */
.tvb-call-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 15px;
	background: #f0f8ff;
	border: 1px solid #b3d9ff;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 500;
	color: #0066cc;
	margin: 10px 0;
}

.tvb-call-status.active {
	background: #d4edda;
	border-color: #c3e6cb;
	color: #155724;
}

.tvb-call-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	animation: tvb-pulse 2s infinite;
}

@keyframes tvb-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

/* Phone Number Formatter */
.tvb-phone-input-wrapper {
	position: relative;
}

.tvb-phone-format-hint {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 12px;
	color: #999;
	pointer-events: none;
}

.tvb-input:focus + .tvb-phone-format-hint {
	display: none;
}

/* Tooltips */
.tvb-tooltip {
	position: relative;
	cursor: help;
	display: inline-block;
}

.tvb-tooltip-icon {
	display: inline-block;
	width: 16px;
	height: 16px;
	line-height: 16px;
	text-align: center;
	background: #667eea;
	color: #fff;
	border-radius: 50%;
	font-size: 11px;
	font-weight: bold;
	margin-left: 5px;
	vertical-align: middle;
}

.tvb-tooltip-content {
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	margin-bottom: 8px;
	padding: 8px 12px;
	background: #333;
	color: #fff;
	border-radius: 4px;
	font-size: 12px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
	z-index: 1000;
}

.tvb-tooltip-content::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #333;
}

.tvb-tooltip:hover .tvb-tooltip-content {
	opacity: 1;
}

/* Search and Filter */
.tvb-history-filters {
	display: flex;
	gap: 15px;
	margin-bottom: 20px;
	flex-wrap: wrap;
	align-items: center;
}

.tvb-search-input {
	flex: 1;
	min-width: 200px;
	padding: 10px 15px;
	border: 2px solid #ddd;
	border-radius: 5px;
	font-size: 14px;
}

.tvb-filter-select {
	padding: 10px 15px;
	border: 2px solid #ddd;
	border-radius: 5px;
	font-size: 14px;
	background: #fff;
	cursor: pointer;
}

/* Empty State */
.tvb-empty-state {
	text-align: center;
	padding: 60px 20px;
	color: #999;
}

.tvb-empty-state-icon {
	font-size: 48px;
	margin-bottom: 15px;
	opacity: 0.5;
}

.tvb-empty-state-title {
	font-size: 18px;
	font-weight: 600;
	color: #666;
	margin-bottom: 10px;
}

.tvb-empty-state-text {
	font-size: 14px;
}

/* Success Animation */
@keyframes tvb-success-check {
	0% {
		transform: scale(0);
	}
	50% {
		transform: scale(1.2);
	}
	100% {
		transform: scale(1);
	}
}

.tvb-success-icon {
	display: inline-block;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #28a745;
	color: #fff;
	text-align: center;
	line-height: 20px;
	font-size: 12px;
	animation: tvb-success-check 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
	.tvb-dashboard-container {
		margin: 10px;
	}
	
	.tvb-dashboard-section {
		padding: 15px;
	}
	
	.tvb-dashboard-header h2 {
		font-size: 24px;
	}
	
	.tvb-dashboard-section h3 {
		font-size: 18px;
	}
	
	.tvb-balance-main {
		flex-direction: column;
		align-items: flex-start;
	}
	
	.tvb-balance-value {
		font-size: 36px;
	}
	
	.tvb-balance-stats {
		flex-direction: column;
		gap: 15px;
		width: 100%;
	}
	
	.tvb-table-container {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	
	.tvb-table {
		font-size: 12px;
		min-width: 600px;
	}
	
	.tvb-table th,
	.tvb-table td {
		padding: 8px 10px;
	}
	
	.tvb-button {
		width: 100%;
		padding: 14px 20px;
		font-size: 16px;
	}
	
	.tvb-history-filters {
		flex-direction: column;
		align-items: stretch;
	}
	
	.tvb-search-input,
	.tvb-filter-select {
		width: 100%;
	}
	
	.tvb-call-info {
		font-size: 14px;
	}
	
	.tvb-call-info ol {
		margin-left: 15px;
	}
}

@media (max-width: 480px) {
	.tvb-dashboard-container {
		margin: 5px;
	}
	
	.tvb-dashboard-section {
		padding: 12px;
	}
	
	.tvb-balance-value {
		font-size: 28px;
	}
	
	.tvb-table {
		font-size: 11px;
	}
	
	.tvb-table th,
	.tvb-table td {
		padding: 6px 8px;
	}
}

