/* ========================================================================= */
/* ======================= ПРОЕКТЫ С ПОДДЕРЖКОЙ ТЕМ ====================== */
/* ========================================================================= */

.projects-list {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	width: 100%;
}

.project-item {
	background: var(--bg-surface);
	border: 1px solid var(--border-light);
	border-radius: 20px;
	padding: 2.5rem;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 2rem;
	transition: all 0.3s cubic-bezier(0.2, 0, 0.2, 1);
	box-shadow: var(--shadow-sm);
}

.project-item:hover {
	transform: translateY(-3px);
	border-color: var(--color-primary);
	box-shadow: var(--shadow-lg);
}

.project-columns {
	display: flex;
	gap: 2rem;
}

.project-left {
	flex: 0 0 200px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.25rem;
	padding-top: 0.5rem;
}

.project-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.project-footer {
	margin-top: 0.5rem;
	padding-top: 1.1rem;
	border-top: 1px solid var(--border-light);
}

.project-footer .project-features {
	padding-left: 0.8rem;
	justify-content: center;
}

/* ИКОНКА ПРОЕКТА */
.project-icon {
	width: 80px;
	height: 80px;
	border-radius: 16px;
	background: var(--gradient-dark);
	border: 1px solid var(--glassmorphism-border);
	box-shadow: var(--shadow-md);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	position: relative;
	transition: all 0.3s ease;
	padding: 4px;
}

.project-icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform 0.3s ease;
	border-radius: 6px;
}

.project-icon i {
	font-size: 1.8rem;
	color: #ffffff;
	filter: drop-shadow(0 2px 4px rgba(var(--brand-dark-rgb), 0.2));
}

/* НАЗВАНИЕ ПРОЕКТА */
.project-name {
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0;
	line-height: 1.3;
	text-align: center;
	width: 100%;
	color: var(--text-primary);
}

.project-company {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--text-muted);
	text-align: center;
	width: 100%;
	letter-spacing: 0.02em;
	margin-top: -0.5rem;
}

/* ВЕРСИЯ И СТАТУС */
.project-version,
.project-status {
	display: inline-flex;
	align-items: center;
	padding: 0.4rem 0.75rem;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	transition: all 0.3s ease;
}

.project-version {
	background-color: rgba(var(--brand-blue-rgb), 0.12);
	border: 1px solid var(--color-primary);
	color: var(--color-primary);
}

.project-version.beta {
	background-color: rgba(var(--brand-orange-rgb), 0.15);
	border-color: var(--color-accent);
	color: var(--color-accent);
}

.project-version.rc {
	background-color: rgba(var(--brand-purple-rgb), 0.15);
	border-color: var(--color-secondary);
	color: var(--color-secondary);
}

.project-version.alpha {
	background-color: rgba(255, 59, 48, 0.12);
	border-color: var(--color-error);
	color: var(--color-error);
}

.project-status {
	background-color: rgba(52, 199, 89, 0.15);
	border: 1px solid var(--color-success);
	color: var(--color-success);
}

/* ГРУППИРОВКА МЕТАДАННЫХ */
.project-meta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	margin: 0.25rem 0 auto;
}

/* ССЫЛКА НА GITHUB */
.project-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border-medium);
	border-radius: 8px;
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--text-secondary);
	text-decoration: none;
	transition: all 0.2s ease;
	width: auto;
	min-width: 120px;
	margin: 1rem auto 0;
}

.project-link:hover {
	background: var(--bg-elevated);
	border-color: var(--border-dark);
	color: var(--text-primary);
	transform: translateY(-1px);
	box-shadow: var(--shadow-sm);
}

/* ОПИСАНИЕ И ТЕГИ */
.project-desc {
	font-size: 1rem;
	line-height: 1.6;
	color: var(--text-secondary);
	margin: 0;
}

.project-features {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: flex-start;
	width: 100%;
}

.feature-tag {
	padding: 0.5rem 1rem;
	border-radius: 10px;
	background: var(--gradient-light);
	color: var(--color-primary);
	font-size: 0.9rem;
	border: 1px solid var(--glassmorphism-border);
	box-shadow: var(--shadow-sm);
	backdrop-filter: var(--blur-backdrop);
	-webkit-backdrop-filter: var(--blur-backdrop);
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-tag:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

/* HOVER ЭФФЕКТЫ */
.project-icon:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg);
}

.project-icon:hover img {
	transform: scale(1.05);
}

/* РАСШИРЕННОЕ ОПИСАНИЕ ПРОЕКТА */
.project-sections {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.info-block {
	position: relative;
	padding-left: 1.5rem;
}

.info-block::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--color-primary);
	opacity: 0.2;
}

.info-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.info-header i {
	color: var(--color-primary);
	font-size: 1.25rem;
}

.info-header h4 {
	margin: 0;
	font-weight: 600;
	font-size: 1.1rem;
	color: var(--text-primary);
}

.info-block p {
	color: var(--text-secondary);
	line-height: 1.6;
	margin: 0;
	font-size: 0.95rem;
}

/* АРХИТЕКТУРНАЯ ДИАГРАММА */
.architecture-diagram {
	margin: 0.5rem auto;
	padding: 1.5rem;
	background: var(--bg-surface);
	border-radius: 16px;
	border: none;
	position: relative;
	max-width: 900px;
	width: 100%;
	box-shadow: var(--shadow-sm);
}

.main-container {
	gap: 0;
	position: relative;
}

/* ВЕРХНЯЯ СЕКЦИЯ: 3 КОЛОНКИ */
.top-section {
	display: flex;
	align-items: stretch;
	gap: 0.5rem;
}

/* Левая зона: внешние сервисы */
.external-zone {
	flex: 2;
	background: var(--bg-secondary);
	padding: 1rem;
	padding-bottom: 5rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	align-self: stretch;
	border-radius: 12px;
}

/* Средняя зона: SDN (разделена на верх и низ) */
.sdn-zone {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.sdn-upper {
	background: var(--color-primary);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	border-radius: 12px 12px 0 0;
	flex: 3;
	min-height: 160px;
}

.sdn-lower {
	background: transparent;
	flex: 0.15;
	min-height: 15px;
}

/* Правая зона: локальная сеть */
.local-zone {
	flex: 2;
	background: var(--bg-secondary);
	padding: 1rem;
	padding-bottom: 5rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	align-self: stretch;
	border-radius: 12px;
}

/* НИЖНЯЯ СЕКЦИЯ: ПРИЛОЖЕНИЯ */
.bottom-section {
	background: var(--color-primary);
	min-height: 60px;
	display: flex;
	align-items: center;
	padding: 0.75rem 1rem;
	border-radius: 30px;
	margin: -4.5rem 2rem 0 2rem;
	box-shadow: var(--shadow-lg);
	position: relative;
	z-index: 10;
}

/* ЗАГОЛОВКИ ЗОН */
.zone-title {
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--text-primary);
	text-align: center;
	margin-bottom: 0.75rem;
}

.sdn-upper .zone-title {
	color: #ffffff;
	writing-mode: horizontal-tb;
	text-orientation: mixed;
	text-align: center;
}

.sdn-upper .zone-title i {
	font-size: 2rem;
	margin-bottom: 0.5rem;
	display: block;
}

/* СЕРВИСНЫЕ БЛОКИ */
.service-box {
	background: var(--bg-surface);
	border: 1px solid var(--border-light);
	padding: 0.5rem;
	text-align: center;
	font-size: 0.8rem;
	margin-bottom: 0.5rem;
	line-height: 1.3;
	border-radius: 8px;
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 45px;
	transition: all 0.3s ease;
}

.service-box i {
	margin-right: 0.3rem;
	color: var(--color-primary);
}

.service-box .ports {
	font-size: 0.7rem;
	color: var(--text-secondary);
	font-weight: 400;
	position: absolute;
	bottom: 0.4rem;
	right: 0.8rem;
	background: var(--bg-surface);
	padding: 0.1rem 0.3rem;
	border-radius: 4px;
	border: 1px solid var(--border-light);
}

.service-box .service-name {
	text-align: left;
	padding-left: 0.8rem;
	flex-grow: 1;
	display: flex;
	align-items: center;
}

/* СПЕЦИАЛЬНЫЕ БЛОКИ */
.service-box.cloud-network {
	background: linear-gradient(135deg, var(--color-primary), rgba(var(--brand-blue-rgb), 0.1));
	border: 1px solid var(--color-primary);
	border-radius: 16px;
	padding: 1.25rem 1rem;
	font-size: 0.9rem;
	font-weight: 600;
	box-shadow: var(--shadow-md);
	margin-top: 1rem;
	margin-bottom: 1rem;
	position: relative;
	overflow: hidden;
	color: #ffffff;
}

.service-box.cloud-network::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	right: -50%;
	bottom: -50%;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
	animation: cloudPulse 3s ease-in-out infinite;
}

.service-box.cloud-network i {
	font-size: 1.2rem;
	margin-right: 0.5rem;
	color: #ffffff;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes cloudPulse {

	0%,
	100% {
		opacity: 0.3;
		transform: scale(1);
	}

	50% {
		opacity: 0.6;
		transform: scale(1.1);
	}
}

.service-box.internet-cloud {
	background: var(--bg-tertiary);
	border: 1px solid var(--border-dark);
	border-radius: 16px;
	padding: 1.25rem 1rem;
	font-size: 0.9rem;
	font-weight: 600;
	box-shadow: var(--shadow-md);
	margin-bottom: 1rem;
	position: relative;
	overflow: hidden;
	color: var(--text-secondary);
}

.service-box.internet-cloud i {
	font-size: 1.2rem;
	margin-right: 0.5rem;
	color: var(--text-muted);
	filter: drop-shadow(0 2px 4px rgba(var(--brand-dark-rgb), 0.1));
}

/* ГРУППА СЕРВИСОВ */
.services-group {
	border: 1px solid var(--border-medium);
	padding: 0.5rem;
	background: var(--bg-surface);
	border-radius: 8px;
	margin-bottom: 0.5rem;
}

.services-group .service-box {
	margin-bottom: 0.25rem;
	padding: 0.5rem;
	font-size: 0.8rem;
	line-height: 1.3;
}

.services-group .service-box:last-child {
	margin-bottom: 0;
}

.service-box.separate {
	margin-bottom: 0.5rem;
	padding: 0.5rem;
	font-size: 0.8rem;
	line-height: 1.3;
}

/* КОНТЕЙНЕРЫ ПРИЛОЖЕНИЙ */
.app-container {
	display: flex;
	justify-content: center;
}

.app-container:first-child {
	flex: 0 0 auto;
	display: flex;
	justify-content: center;
}

.app-container:nth-child(2) {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 60px;
}

.app-container:last-child {
	flex: 0 0 auto;
	display: flex;
	justify-content: center;
}

/* АНИМИРОВАННАЯ ЛИНИЯ ПЕРЕДАЧИ ДАННЫХ */
.data-flow-line {
	width: 100%;
	height: 3px;
	background: repeating-linear-gradient(to right,
			rgba(255, 255, 255, 0.8) 0px,
			rgba(255, 255, 255, 0.8) 10px,
			transparent 10px,
			transparent 20px);
	border-radius: 2px;
	animation: dataFlow 2s linear infinite;
}

@keyframes dataFlow {
	0% {
		background-position: 0px 0px;
	}

	100% {
		background-position: 40px 0px;
	}
}

/* APP БЛОКИ */
.app-box {
	background: var(--bg-surface);
	color: var(--text-primary);
	padding: 0.8rem 1rem;
	font-weight: 600;
	font-size: 0.8rem;
	text-align: center;
	border-radius: 15px;
	white-space: nowrap;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.2rem;
	min-width: 220px;
	width: auto;
	max-width: 280px;
	position: relative;
	min-height: 48px;
	padding-top: 1.5rem;
}

.app-box i {
	margin-right: 0.5rem;
	color: var(--color-primary);
}

.app-box.has-corner-icon {
	text-align: center !important;
	align-items: stretch !important;
	justify-content: space-between !important;
	gap: 0 !important;
	padding: 0.5rem 1.2rem !important;
}

.app-box .service-name {
	text-align: left;
	flex-grow: 1;
	display: flex;
	align-items: flex-start;
	justify-content: flex-start;
	margin: 0 0 0.2rem 0;
	font-weight: 400;
	font-size: 0.95em;
}

.app-box .bottom-info {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	width: 100%;
	margin-top: auto;
	min-height: 24px;
}

.app-box .port-routing {
	font-size: 0.65rem;
	color: var(--color-success);
	font-weight: 500;
	background: var(--bg-surface);
	padding: 0.2rem 0.4rem;
	border-radius: 4px;
	border: 1px solid var(--color-success);
	white-space: nowrap;
	line-height: 1.2;
	height: 24px;
	display: flex;
	align-items: center;
	margin-right: auto;
	margin-left: 0;
}

.app-box .zt-ip {
	padding: 0.2rem 0.7rem !important;
	height: 24px;
	display: flex;
	align-items: center;
	border-radius: 4px;
	border: 1px solid var(--border-light);
	background: var(--bg-surface);
	font-size: 0.65rem;
	color: var(--text-secondary);
	margin-left: 0.5rem;
}

/* ========================================================================= */
/* =============== ✅ ИСПРАВЛЕННЫЕ УГЛОВЫЕ ИКОНКИ (ЛЕВЫЙ УГОЛ) ============= */
/* ========================================================================= */

/* УГЛОВЫЕ ИКОНКИ - БАЗОВЫЕ СТИЛИ */
.app-box.has-corner-icon,
.service-box.has-corner-icon,
.services-group.has-corner-icon {
	position: relative;
}

/* ✅ ОСНОВНЫЕ УГЛОВЫЕ ИКОНКИ - ПО УМОЛЧАНИЮ В ПРАВОМ УГЛУ */
.app-box.has-corner-icon::before,
.service-box.has-corner-icon::before,
.services-group.has-corner-icon::before {
	content: '\f395';
	/* Docker icon по умолчанию */
	font-family: 'Font Awesome 6 Brands';
	font-weight: 400;
	position: absolute;
	width: 24px;
	height: 24px;
	background: var(--color-primary);
	color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.7rem;
	box-shadow: var(--shadow-md);
	border: 1px solid #ffffff;
	z-index: 5;
	transition: all 0.2s ease;
	/* ✅ ПО УМОЛЧАНИЮ В ПРАВОМ УГЛУ */
	top: -8px;
	right: -8px;
}

/* ✅ ИСКЛЮЧЕНИЕ: DOCKER ИКОНКИ В ЛЕВОМ УГЛУ */
.has-corner-icon.icon-docker::before {
	left: -8px;
	right: auto;
	/* Отменяем right */
}

/* ВАРИАНТЫ ИКОНОК */
.has-corner-icon.icon-docker::before {
	content: '\f395';
	font-family: 'Font Awesome 6 Brands';
}

.has-corner-icon.icon-server::before {
	content: '\f233';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
}

.has-corner-icon.icon-shield::before {
	content: '\f3ed';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
}

.has-corner-icon.icon-database::before {
	content: '\f1c0';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
}

.has-corner-icon.icon-memory::before {
	content: '\f538';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
}

.has-corner-icon.icon-code::before {
	content: '\f121';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
}

.has-corner-icon.icon-sync::before {
	content: '\f021';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
}

/* ЦВЕТОВЫЕ ТЕМЫ */
.has-corner-icon.theme-docker::before {
	background: #2496ed;
}

.has-corner-icon.theme-success::before {
	background: var(--color-success);
}

.has-corner-icon.theme-warning::before {
	background: var(--color-accent);
}

.has-corner-icon.theme-secondary::before {
	background: var(--color-secondary);
}

/* ✅ КЛАССЫ ДЛЯ ТОЧНОГО ПОЗИЦИОНИРОВАНИЯ (ОПЦИОНАЛЬНЫЕ) */
.corner-top-left::before {
	top: -8px;
	left: -8px;
	right: auto;
}

.corner-top-right::before {
	top: -8px;
	right: -8px;
	left: auto;
}

.corner-bottom-left::before {
	bottom: -8px;
	left: -8px;
	right: auto;
	top: auto;
}

.corner-bottom-right::before {
	bottom: -8px;
	right: -8px;
	left: auto;
	top: auto;
}

/* Hover эффекты для угловых иконок */
.has-corner-icon:hover::before {
	transform: scale(1.1);
	box-shadow: var(--shadow-lg);
	transition: all 0.2s ease;
}

/* ТЕМНАЯ ТЕМА - СПЕЦИАЛЬНЫЕ СТИЛИ */
:root[data-theme="dark"] .architecture-diagram {
	background: var(--bg-surface);
}

:root[data-theme="dark"] .external-zone,
:root[data-theme="dark"] .local-zone {
	background: var(--bg-secondary);
}

:root[data-theme="dark"] .service-box.internet-cloud {
	background: var(--bg-tertiary);
	color: var(--text-secondary);
}

:root[data-theme="dark"] .service-box.internet-cloud i {
	color: var(--text-muted);
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* АДАПТИВНОСТЬ */
@media (max-width: 768px) {
	.info-block {
		padding-left: 0;
	}

	.info-block::before {
		display: none;
	}

	.info-header {
		margin-bottom: 0.5rem;
	}

	.architecture-diagram {
		display: none;
	}
}

@media (max-width: 640px) {
	.project-item {
		padding: 1.5rem;
		gap: 1.5rem;
	}

	.project-columns {
		flex-direction: column;
		gap: 1.5rem;
	}

	.project-left {
		flex: none;
		width: 100%;
	}

	.project-content {
		text-align: left;
	}

	.project-footer {
		margin-top: 1rem;
		padding-top: 1.5rem;
	}

	.project-footer .project-features {
		justify-content: center;
		gap: 0.5rem;
	}

	/* ✅ АДАПТИВНЫЕ УГЛОВЫЕ ИКОНКИ */
	.has-corner-icon::before {
		width: 20px;
		height: 20px;
		font-size: 0.6rem;
		top: -6px;
		right: -6px;
		/* По умолчанию правый угол */
	}

	/* ✅ DOCKER ИКОНКИ В ЛЕВОМ УГЛУ - АДАПТИВ */
	.has-corner-icon.icon-docker::before {
		left: -6px;
		right: auto;
	}
}

@media (max-width: 480px) {
	.project-item {
		padding: 1.25rem 1rem;
	}

	.project-icon {
		width: 64px;
		height: 64px;
	}

	.project-name {
		font-size: 1.25rem;
	}

	.feature-tag {
		padding: 0.35rem 0.75rem;
		font-size: 0.85rem;
	}

	.project-version,
	.project-status,
	.project-link {
		font-size: 0.875rem;
		padding: 0.35rem 0.65rem;
	}

	.app-box {
		min-width: 140px;
		width: 140px;
		padding: 0.4rem 0.6rem;
		font-size: 0.7rem;
		font-weight: 500;
		border-radius: 12px;
	}

	.bottom-section {
		height: 50px;
		margin: -3.5rem 1rem 0 1rem;
		flex-wrap: nowrap;
	}

	/* ✅ МОБИЛЬНЫЕ УГЛОВЫЕ ИКОНКИ */
	.has-corner-icon::before {
		width: 18px;
		height: 18px;
		font-size: 0.55rem;
		top: -5px;
		right: -5px;
		/* По умолчанию правый угол */
	}

	/* ✅ DOCKER ИКОНКИ В ЛЕВОМ УГЛУ - МОБИЛЬНЫЕ */
	.has-corner-icon.icon-docker::before {
		left: -5px;
		right: auto;
	}
}

/* ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
	.data-flow-line {
		animation: none;
	}

	.service-box.cloud-network::before {
		animation: none;
	}

	.project-item:hover,
	.project-icon:hover,
	.feature-tag:hover {
		transform: none;
	}
}

/* HIGH CONTRAST MODE */
@media (prefers-contrast: high) {
	.project-item {
		border: 2px solid var(--border-dark);
	}

	.project-item:hover {
		border-color: var(--color-primary);
	}

	.project-icon {
		border: 2px solid var(--border-dark);
	}

	.feature-tag {
		border: 2px solid var(--border-dark);
	}
}

/* ПЕЧАТЬ */
@media print {
	.architecture-diagram {
		display: none;
	}

	.project-item {
		box-shadow: none;
		border: 1px solid var(--border-dark);
		break-inside: avoid;
	}

	.feature-tag {
		box-shadow: none;
		border: 1px solid var(--border-dark);
	}
}
