/* ===== Цвета и темы ===== */
:root {
	--bg: #0f172a;
	--bg-secondary: #020617;
	--text: #e5e7eb;
	--text-muted: #94a3b8;
	--accent: #38bdf8;
	--accent-hover: #38bdf8;
	--border: #1e293b;
	--skill-hover-bg: linear-gradient(135deg, #0ea5e9, #38bdf8);
	--skill-hover-color: #ffffff;
	--project-hover-shadow: rgba(30, 64, 175, 0.4);
}
[data-theme="light"] {
	--bg: #ffffff;
	--bg-secondary: #f3f4f6;
	--text: #111827;
	--text-muted: #374151;
	--accent: #1e40af;
	--accent-hover: #2563eb;
	--border: #d1d5db;
	--skill-hover-bg: linear-gradient(135deg, #1e40af, #3b82f6);
	--skill-hover-color: #ffffff;
	--project-hover-shadow: rgba(30, 64, 175, 0.4);
}

/* ===== Глобальные стили ===== */
* {
	box-sizing: border-box;
	font-family: Arial, sans-serif;
}
body {
	margin: 0;
	display: flex;
	min-height: 100vh;
	background: var(--bg);
	color: var(--text);
	transition:
		background 0.5s ease,
		color 0.5s ease;
}

/* ===== Sidebar ===== */
.sidebar {
	width: 250px;
	background: var(--bg-secondary);
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 40px 20px;
	flex-shrink: 0;
	transition:
		background 0.5s ease,
		color 0.5s ease;
}
.profile-photo {
	width: 120px;
	height: 120px;
	border-radius: 8px;
	overflow: hidden;
	border: 2px solid var(--border);
	margin-bottom: 15px;
	background: var(--bg);
	transition: border-color 0.5s ease;
}
.profile-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.profile-name {
	font-size: 1.5rem;
	font-weight: bold;
	margin-bottom: 4px;
	text-align: center;
}
.profile-role {
	font-size: 1rem;
	color: var(--text-muted);
	text-align: center;
	margin-bottom: 10px;
	transition: color 0.5s ease;
}

/* Sidebar links animation */
.contact-links {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 10px;
	text-align: center;
}
.contact-links a {
	color: var(--accent);
	text-decoration: none;
	font-weight: bold;
	position: relative;
	opacity: 0;
	transform: translateY(20px);
	transition:
		transform 0.5s ease,
		opacity 0.5s ease,
		color 0.3s ease;
}
.contact-links a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -2px;
	width: 100%;
	height: 2px;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.3s ease;
}
.contact-links a:hover {
	color: var(--accent-hover);
	transform: translateY(-2px) scale(1.05);
}
.contact-links a:hover::after {
	transform: scaleX(1);
	transform-origin: left;
}
.contact-links a.visible {
	opacity: 1;
	transform: translateY(0);
}

/* ===== Main content ===== */
.main-content {
	flex-grow: 1;
	padding: 40px 30px;
	position: relative;
	transition:
		background 0.5s ease,
		color 0.5s ease;
}
h2 {
	border-left: 4px solid var(--accent);
	padding-left: 10px;
	margin-bottom: 20px;
	transition: border-color 0.5s ease;
}

/* ===== Skills ===== */
.skills {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
}
.skill {
	background: var(--bg-secondary);
	padding: 10px 15px;
	border-radius: 6px;
	border: 1px solid var(--border);
	transition:
		transform 0.3s ease,
		background 0.3s ease,
		border-color 0.3s ease,
		color 0.3s ease,
		box-shadow 0.3s ease,
		opacity 0.5s ease,
		transform 0.5s ease;
	opacity: 0;
	transform: translateY(20px);
	cursor: pointer;
}
.skill.visible {
	opacity: 1;
	transform: translateY(0);
}
.skill:hover {
	transform: translateY(-5px) scale(1.1);
	background: var(--skill-hover-bg);
	color: var(--skill-hover-color);
	border-color: var(--accent-hover);
	box-shadow: 0 8px 20px var(--project-hover-shadow);
}

/* ===== Projects ===== */
.projects {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(420px, 640px));
	gap: 32px;
	justify-content: center; /* чтобы карточки не растягивались по всей ширине */
	align-items: start; /* Чтобы карточки не растягивались по высоте. */
}

.projects .project {
	background: var(--bg-secondary);
	border-radius: 8px;
	padding: 15px;
	border: 1px solid var(--border);
	transition:
		background 0.5s ease,
		border-color 0.5s ease,
		color 0.5s ease,
		transform 0.6s ease-out,
		opacity 0.6s ease-out,
		box-shadow 0.3s ease;
	opacity: 0;
	transform: translateY(20px);
	max-width: 640px; /* ограничиваем ширину карточки */
	margin: 0 auto; /* центрируем карточку внутри сетки */
}
.project.visible {
	opacity: 1;
	transform: translateY(0);
}
.project p {
	color: var(--text-muted);
	transition: color 0.5s ease;
}

/* Project Links Animation */
.project a {
	display: inline-block;
	margin-top: 10px;
	margin-right: 10px;
	text-decoration: none;
	transition:
		transform 0.3s ease,
		color 0.3s ease;
}
.project a.github-link {
	color: var(--accent);
	font-weight: bold;
	position: relative;
}
.project a.github-link::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -3px;
	width: 100%;
	height: 2px;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.3s ease;
}
.project a.github-link:hover {
	transform: translateY(-2px) scale(1.05);
}
.project a.github-link:hover::after {
	transform: scaleX(1);
	transform-origin: left;
}
.project a.demo-link {
	color: #10b981;
	position: relative;
	font-weight: bold;
}
.project a.demo-link::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -3px;
	width: 100%;
	height: 2px;
	background: #059669;
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.3s ease;
}
.project a.demo-link:hover {
	color: #059669;
	transform: translateY(-2px) scale(1.05);
}
.project a.demo-link:hover::after {
	transform: scaleX(1);
	transform-origin: left;
}
/* Стиль для ссылки документации */
.project a.documentation-link {
	color: #a1c500; /* Такой же цвет как для DEMO */
	position: relative;
	font-weight: bold;
}
.project a.documentation-link::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -3px;
	width: 100%;
	height: 2px;
	background: #a1c500;
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.3s ease;
}
.project a.documentation-link:hover {
	color: #a1c500;
	transform: translateY(-2px) scale(1.05);
}
.project a.documentation-link:hover::after {
	transform: scaleX(1);
	transform-origin: left;
}

.project:hover {
	transform: scale(1.03);
	box-shadow: 0 10px 25px var(--project-hover-shadow);
}

/* Project image */
.project-image {
	width: 100%;
	aspect-ratio: 16 / 9; /* сохраняем соотношение 16:9 */
	background-color: var(--border);
	border-radius: 6px;
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	transition: background 0.5s ease;
}

.project-image img {
	width: 100%;
	height: 100%;
	object-fit: cover; /* изображение растягивается по размеру контейнера, сохраняя обрезку */
}
.project-image span {
	color: var(--text-muted);
	font-size: 14px;
}

/* Footer */
footer {
	text-align: center;
	padding: 30px;
	background: var(--bg-secondary);
	color: var(--text-muted);
	margin-top: 40px;
	transition:
		background 0.5s ease,
		color 0.5s ease;
}

.top-buttons {
  position: absolute;
  top: 20px;
  right: 20px;

  display: flex;
  gap: 12px;
}


.ui-btn {
  width: 50px;
  height: 50px;

  
  display: grid;
  place-items: center;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);

  background: rgba(255,255,255,.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  cursor: pointer;

  transition:
    transform .25s cubic-bezier(.34,1.56,.64,1),
    background .35s ease,
    border .35s ease,
    box-shadow .35s ease;
}


/* ===== Inner light ===== */
.ui-btn::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;

	background: linear-gradient(
		180deg,
		rgba(255,255,255,.35),
		rgba(255,255,255,0) 45%
	);

	opacity: .6;
	pointer-events: none;
}

/* ===== Hover ===== */
.ui-btn:hover {
  transform: scale(1.08);

  background: rgba(255,255,255,.14);

  box-shadow:
    0 0 18px rgba(120,180,255,.25),
    inset 0 0 14px rgba(255,255,255,.2);

  border-color: rgba(255,255,255,.35);
}


/* ===== Active ===== */
.ui-btn:active {
  transform: scale(.9);
}

.theme-toggle {
  position: relative;
}



/* ===== Glyph ===== */
.theme-glyph {
	position: absolute;
	font-size: 26px;
	line-height: 1;

	filter: drop-shadow(0 0 6px rgba(120,180,255,.35));

	transition:
		transform .35s cubic-bezier(.34,1.56,.64,1),
		filter .35s ease;
}

/* Light theme glow */
[data-theme="light"] .theme-glyph {
	filter: drop-shadow(0 0 6px rgba(255,180,80,.45));
}

/* ===== Light theme button ===== */
[data-theme="light"] .ui-btn {

	background: rgba(255,255,255,.55);
	backdrop-filter: blur(20px) saturate(140%);
	border: 1px solid rgba(0,0,0,.12);

	box-shadow:
		0 6px 18px rgba(0,0,0,.12),
		inset 0 0 12px rgba(255,255,255,.6);
}

/* Hover для светлой темы */
[data-theme="light"] .ui-btn:hover {

	background: rgba(255,255,255,.85);

	border-color: rgba(0,0,0,.2);

	box-shadow:
		0 8px 24px rgba(0,0,0,.18),
		inset 0 0 14px rgba(255,255,255,.9);
}
[data-theme="light"] .ui-btn::after {
	opacity: .3;
}




/* Responsive */
@media (max-width: 800px) {
	body {
		flex-direction: column;
	}
	.sidebar {
		flex-direction: row;
		justify-content: center;
		width: 100%;
		padding: 20px;
	}
	.profile-photo {
		margin-right: 20px;
		margin-bottom: 0;
	}
	.main-content {
		padding: 20px;
	}
}

.project-image-slider {
	position: relative;
	overflow: hidden;
	border-radius: 6px;
	touch-action: pan-y;

	aspect-ratio: 16 / 9;
	height: auto;
}


.slider-progress-multi {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	display: flex;
	gap: 6px;
	z-index: 20;
}

.slider-progress-item {
	flex: 1;
	height: 4px;
	background: rgba(0,0,0,.35);
	border-radius: 4px;
	overflow: hidden;
	backdrop-filter: blur(4px);
	box-shadow:
		inset 0 0 0 1px rgba(255,255,255,.15);
}

.slider-progress-fill {
	height: 100%;
	width: 0%;

	background: rgba(255,255,255,.95);
	box-shadow: 0 0 6px rgba(255,255,255,.6);

	transition:
		background .45s ease,
		box-shadow .45s ease;
}

/* Светлый вариант */
.slider-progress-fill.light {
	background: rgba(255,255,255,.95);
	box-shadow: 0 0 6px rgba(255,255,255,.6);
}

/* Тёмный вариант */
.slider-progress-fill.dark {
	background: rgba(0,0,0,.85);
	box-shadow: 0 0 6px rgba(0,0,0,.5);
}

.slider-progress-fill.animate {
	animation-name: slideProgress;
	animation-timing-function: linear;
	animation-fill-mode: forwards;
}

.slider-progress-fill.paused {
	animation-play-state: paused;
}

@keyframes slideProgress {
	from { width: 0%; }
	to { width: 100%; }
}


.project-images {
	display: flex;
	transition: transform 0.6s ease;
	height: 100%;
	will-change: transform;
}

.project-images img {
	width: 100%;
	flex: 0 0 100%;
	object-fit: contain;
	background: #00020d;

	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;

	transition:
		background 0.5s ease,
		filter 0.5s ease;
}
[data-theme="light"] .project-images img {
	width: 100%;
	flex: 0 0 100%;
	object-fit: contain;
	background: #d1d5db;

	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
}

.prev-slide,
.next-slide {
	pointer-events: auto;
}

.project-image-slider * {
	touch-action: inherit;
}


button.prev-slide,
button.next-slide {
  position: absolute;
  top: 45%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 10px;
  border: none;
  border-radius: 20%;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s ease, transform 0.3s ease; /* убрали все изменения, касающиеся padding или height */
  height: 40px;  /* Явно задаем высоту кнопки */
  width: 40px;   /* Явно задаем ширину кнопки */
  line-height: 40px; /* Центрируем текст */
  display: flex;
  align-items: center;
  justify-content: center;
}

button.prev-slide {
	left: 10px;
}

button.next-slide {
	right: 10px;
}

button.prev-slide:hover,
button.next-slide:hover {
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1); /* Увеличение размера при наведении */
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input, textarea, select {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #1e1e1e;
  color: #fff;
}

label {
  font-size: 14px;
  opacity: 0.8;
}

/* =====================================================
   ADMIN DASHBOARD
===================================================== */

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.admin-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  flex: 1;
  text-align: center;
}

.stat-card h3 {
  font-size: 32px;
  margin: 0;
}

.stat-card p {
  opacity: 0.7;
  margin: 5px 0 0;
}

.admin-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.muted {
  opacity: 0.6;
}

/* =====================================================
   AUTH PAGES
===================================================== */

.auth-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg);
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.auth-card {
  background: var(--bg-secondary);
  padding: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
  animation: fadeIn 0.4s ease;
}

.auth-card h2 {
  margin-top: 0;
  text-align: center;
  border: none;
}

.auth-card button {
  margin-top: 15px;
}

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

/* === Карточки === */
.card {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* === Кнопки === */
button {
  padding: 12px 20px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

button:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

button:focus {
  outline: none;
}

/* === Формы === */
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

form input,
form select,
form textarea {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 14px;
  transition: border 0.3s ease;
}

form input:focus,
form select:focus,
form textarea:focus {
  border-color: var(--accent);
}

form label {
  font-weight: bold;
  color: var(--text-muted);
  font-size: 14px;
}

/* === Таблицы === */
table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table th {
  background: var(--bg-secondary);
  font-weight: bold;
}

table tr:hover {
  background: var(--bg-secondary);
  transition: background 0.3s ease;
}

.form-container {
  max-width: 500px;
  margin: 0 auto;
}
