/* Tor Shield Dashboard - Purple/Onion Theme */
/* Copyright (C) 2025 CyberMind.fr */

:root {
	--tor-bg-primary: #0a0015;
	--tor-bg-secondary: #1a0a2e;
	--tor-bg-card: #1e1233;
	--tor-bg-card-hover: #2a1845;
	--tor-accent-purple: #7d4e9f;
	--tor-accent-light: #9f7aba;
	--tor-accent-dark: #4a2c6a;
	--tor-status-protected: #10b981;
	--tor-status-exposed: #ef4444;
	--tor-status-warning: #f59e0b;
	--tor-status-disabled: #6b7280;
	--tor-text-primary: #f3f4f6;
	--tor-text-secondary: #9ca3af;
	--tor-text-muted: #6b7280;
	--tor-border-color: rgba(125, 78, 159, 0.3);
	--tor-onion-gradient: linear-gradient(135deg, #7d4e9f, #4a2c6a);
	--tor-success-gradient: linear-gradient(135deg, #10b981, #059669);
	--tor-danger-gradient: linear-gradient(135deg, #ef4444, #dc2626);
}

.tor-dashboard {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: linear-gradient(180deg, var(--tor-bg-primary) 0%, var(--tor-bg-secondary) 100%);
	min-height: 100vh;
	padding: 20px;
	color: var(--tor-text-primary);
}

/* Header */
.tor-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	padding: 20px 24px;
	background: var(--tor-bg-card);
	border-radius: 16px;
	border: 1px solid var(--tor-border-color);
}

.tor-logo {
	display: flex;
	align-items: center;
	gap: 12px;
}

.tor-logo-icon {
	font-size: 40px;
	filter: drop-shadow(0 0 20px rgba(125, 78, 159, 0.5));
}

.tor-logo-text {
	font-size: 28px;
	font-weight: 700;
	color: var(--tor-text-primary);
}

.tor-logo-text span {
	color: var(--tor-accent-purple);
}

.tor-status-badge {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border-radius: 20px;
	font-weight: 500;
	font-size: 14px;
}

.tor-status-badge.protected {
	background: rgba(16, 185, 129, 0.15);
	color: var(--tor-status-protected);
	border: 1px solid rgba(16, 185, 129, 0.3);
}

.tor-status-badge.exposed {
	background: rgba(239, 68, 68, 0.15);
	color: var(--tor-status-exposed);
	border: 1px solid rgba(239, 68, 68, 0.3);
}

.tor-status-badge.disabled {
	background: rgba(107, 114, 128, 0.15);
	color: var(--tor-text-secondary);
	border: 1px solid rgba(107, 114, 128, 0.3);
}

.tor-status-badge.connecting {
	background: rgba(245, 158, 11, 0.15);
	color: var(--tor-status-warning);
	border: 1px solid rgba(245, 158, 11, 0.3);
}

.tor-status-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: currentColor;
	animation: pulse 2s ease-in-out infinite;
}

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

/* Hero Section - Master Toggle */
.tor-hero {
	display: flex;
	gap: 32px;
	margin-bottom: 24px;
	padding: 32px;
	background: var(--tor-bg-card);
	border-radius: 16px;
	border: 1px solid var(--tor-border-color);
}

.tor-toggle-section {
	flex: 0 0 200px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.tor-master-toggle {
	width: 140px;
	height: 140px;
	border-radius: 50%;
	border: 4px solid var(--tor-border-color);
	background: var(--tor-bg-secondary);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 48px;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

.tor-master-toggle:hover {
	transform: scale(1.05);
	border-color: var(--tor-accent-purple);
	box-shadow: 0 0 40px rgba(125, 78, 159, 0.4);
}

.tor-master-toggle.active {
	background: var(--tor-onion-gradient);
	border-color: var(--tor-accent-light);
	box-shadow: 0 0 50px rgba(125, 78, 159, 0.6);
}

.tor-master-toggle.active::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
	animation: shimmer 3s infinite;
}

@keyframes shimmer {
	0% { transform: translateX(-100%) rotate(45deg); }
	100% { transform: translateX(100%) rotate(45deg); }
}

.tor-toggle-label {
	margin-top: 12px;
	font-size: 16px;
	font-weight: 600;
	color: var(--tor-text-secondary);
}

.tor-toggle-label.active {
	color: var(--tor-accent-light);
}

/* Protection Info */
.tor-protection-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.tor-protection-title {
	font-size: 14px;
	font-weight: 500;
	color: var(--tor-text-muted);
	margin-bottom: 16px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.tor-ip-info {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}

.tor-ip-item {
	padding: 16px;
	background: var(--tor-bg-secondary);
	border-radius: 12px;
	border: 1px solid var(--tor-border-color);
}

.tor-ip-label {
	font-size: 12px;
	color: var(--tor-text-muted);
	margin-bottom: 4px;
	text-transform: uppercase;
}

.tor-ip-value {
	font-size: 18px;
	font-weight: 600;
	font-family: 'Monaco', 'Menlo', monospace;
}

.tor-ip-value.protected {
	color: var(--tor-status-protected);
}

.tor-ip-value.exposed {
	color: var(--tor-status-exposed);
}

.tor-exit-location {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
	font-size: 14px;
	color: var(--tor-text-secondary);
}

/* Presets */
.tor-presets {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-bottom: 24px;
}

.tor-preset {
	padding: 20px;
	background: var(--tor-bg-card);
	border-radius: 12px;
	border: 2px solid var(--tor-border-color);
	cursor: pointer;
	transition: all 0.3s ease;
	text-align: center;
}

.tor-preset:hover {
	border-color: var(--tor-accent-purple);
	transform: translateY(-2px);
}

.tor-preset.active {
	border-color: var(--tor-accent-light);
	background: linear-gradient(180deg, var(--tor-bg-card-hover), var(--tor-bg-card));
}

.tor-preset-icon {
	font-size: 32px;
	margin-bottom: 8px;
}

.tor-preset-name {
	font-size: 16px;
	font-weight: 600;
	color: var(--tor-text-primary);
	margin-bottom: 4px;
}

.tor-preset-desc {
	font-size: 12px;
	color: var(--tor-text-muted);
}

/* Quick Stats */
.tor-quick-stats {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 16px;
	margin-bottom: 24px;
}

.tor-quick-stat {
	padding: 16px 20px;
	background: var(--tor-bg-card);
	border-radius: 12px;
	border: 1px solid var(--tor-border-color);
	text-align: center;
}

.tor-quick-stat-icon {
	font-size: 24px;
	margin-bottom: 8px;
}

.tor-quick-stat-value {
	font-size: 24px;
	font-weight: 700;
	color: var(--tor-accent-light);
	margin-bottom: 4px;
}

.tor-quick-stat-label {
	font-size: 12px;
	color: var(--tor-text-muted);
	text-transform: uppercase;
}

/* Cards */
.tor-card {
	background: var(--tor-bg-card);
	border-radius: 16px;
	border: 1px solid var(--tor-border-color);
	margin-bottom: 24px;
	overflow: hidden;
}

.tor-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid var(--tor-border-color);
}

.tor-card-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	font-weight: 600;
}

.tor-card-title-icon {
	font-size: 20px;
}

.tor-card-body {
	padding: 20px;
}

.tor-card-badge {
	padding: 4px 12px;
	background: var(--tor-accent-dark);
	border-radius: 12px;
	font-size: 12px;
	color: var(--tor-accent-light);
}

/* Circuit Visualization */
.tor-circuit {
	display: flex;
	align-items: center;
	padding: 16px;
	background: var(--tor-bg-secondary);
	border-radius: 12px;
	margin-bottom: 12px;
	gap: 8px;
}

.tor-circuit-node {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 12px 16px;
	background: var(--tor-bg-card);
	border-radius: 8px;
	border: 1px solid var(--tor-border-color);
	min-width: 80px;
}

.tor-circuit-node.you {
	background: var(--tor-onion-gradient);
	border-color: var(--tor-accent-light);
}

.tor-circuit-node.guard {
	background: rgba(16, 185, 129, 0.1);
	border-color: rgba(16, 185, 129, 0.3);
}

.tor-circuit-node.middle {
	background: rgba(245, 158, 11, 0.1);
	border-color: rgba(245, 158, 11, 0.3);
}

.tor-circuit-node.exit {
	background: rgba(239, 68, 68, 0.1);
	border-color: rgba(239, 68, 68, 0.3);
}

.tor-circuit-node-flag {
	font-size: 24px;
	margin-bottom: 4px;
}

.tor-circuit-node-label {
	font-size: 10px;
	color: var(--tor-text-muted);
	text-transform: uppercase;
}

.tor-circuit-arrow {
	color: var(--tor-accent-purple);
	font-size: 20px;
}

/* Hidden Services */
.tor-hidden-service {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px;
	background: var(--tor-bg-secondary);
	border-radius: 12px;
	margin-bottom: 12px;
	border: 1px solid var(--tor-border-color);
}

.tor-hidden-service-info {
	flex: 1;
}

.tor-hidden-service-name {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 4px;
}

.tor-hidden-service-address {
	font-family: 'Monaco', 'Menlo', monospace;
	font-size: 12px;
	color: var(--tor-accent-light);
	word-break: break-all;
}

.tor-hidden-service-port {
	font-size: 12px;
	color: var(--tor-text-muted);
	margin-top: 4px;
}

.tor-hidden-service-actions {
	display: flex;
	gap: 8px;
}

/* Buttons */
.tor-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	border: none;
	background: var(--tor-accent-dark);
	color: var(--tor-text-primary);
}

.tor-btn:hover {
	background: var(--tor-accent-purple);
}

.tor-btn-primary {
	background: var(--tor-onion-gradient);
}

.tor-btn-primary:hover {
	box-shadow: 0 0 20px rgba(125, 78, 159, 0.5);
}

.tor-btn-success {
	background: var(--tor-success-gradient);
}

.tor-btn-danger {
	background: var(--tor-danger-gradient);
}

.tor-btn-sm {
	padding: 6px 12px;
	font-size: 12px;
}

.tor-btn-icon {
	padding: 8px;
	border-radius: 6px;
}

/* Progress Bar */
.tor-progress {
	height: 8px;
	background: var(--tor-bg-secondary);
	border-radius: 4px;
	overflow: hidden;
}

.tor-progress-bar {
	height: 100%;
	background: var(--tor-onion-gradient);
	border-radius: 4px;
	transition: width 0.5s ease;
}

/* Bootstrap Progress */
.tor-bootstrap {
	margin-top: 16px;
}

.tor-bootstrap-label {
	display: flex;
	justify-content: space-between;
	margin-bottom: 8px;
	font-size: 12px;
	color: var(--tor-text-secondary);
}

/* Refresh Control */
.tor-refresh-control {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	margin-bottom: 16px;
	font-size: 13px;
	color: var(--tor-text-muted);
}

.tor-refresh-indicator {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--tor-status-disabled);
}

.tor-refresh-indicator.active {
	background: var(--tor-status-protected);
	animation: pulse 2s infinite;
}

/* Empty State */
.tor-empty {
	text-align: center;
	padding: 40px;
	color: var(--tor-text-muted);
}

.tor-empty-icon {
	font-size: 48px;
	margin-bottom: 16px;
	opacity: 0.5;
}

.tor-empty-text {
	font-size: 16px;
	margin-bottom: 8px;
}

/* Animations */
.tor-fade-in {
	animation: fadeIn 0.3s ease;
}

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

.tor-value-updated {
	animation: highlight 0.5s ease;
}

@keyframes highlight {
	0%, 100% { background: transparent; }
	50% { background: rgba(125, 78, 159, 0.3); }
}

/* Responsive */
@media (max-width: 1200px) {
	.tor-quick-stats {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.tor-hero {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.tor-presets {
		grid-template-columns: 1fr;
	}

	.tor-quick-stats {
		grid-template-columns: repeat(2, 1fr);
	}

	.tor-ip-info {
		grid-template-columns: 1fr;
	}
}
