@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(30, 41, 59, 0.4);
  --bg-card-hover: rgba(30, 41, 59, 0.7);
  --border-light: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-1: #6366f1; /* Indigo */
  --accent-2: #ec4899; /* Pink */
  --success: #10b981;
  --danger: #f43f5e;
  --font-main: 'Outfit', sans-serif;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.5);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-main); }
body { background: var(--bg-main); background-image: radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08), transparent 25%), radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.08), transparent 25%); color: var(--text-main); font-size: 15px; min-height: 100vh; overflow-x: hidden; }
input, button { outline: none; border: none; }
.hidden { display: none !important; }
.page { display: none; min-height: 100vh; opacity: 0; transition: opacity 0.4s ease; }
.page.active { display: flex; opacity: 1; }

/* --- LOGIN PAGE --- */
.login-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.glow-orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.5; }
.orb-1 { width: 400px; height: 400px; background: var(--accent-1); top: -100px; left: -100px; }
.orb-2 { width: 300px; height: 300px; background: var(--accent-2); bottom: -50px; right: -50px; }

.login-container {
  position: relative; z-index: 1; margin: auto; width: 100%; max-width: 420px;
  background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  padding: 50px 40px; border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* ИСПРАВЛЕНИЕ ОШИБКИ В VS CODE (background-clip) */
.login-logo { 
  font-size: 28px; 
  font-weight: 700; 
  text-align: center; 
  margin-bottom: 10px; 
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); 
  -webkit-background-clip: text; 
  background-clip: text; 
  -webkit-text-fill-color: transparent; 
  color: transparent; 
}

.login-sub { text-align: center; color: var(--text-muted); margin-bottom: 40px; }
.field-group { margin-bottom: 24px; }
.field-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }
.field-wrap input { width: 100%; padding: 14px 18px; background: rgba(0,0,0,0.2); border: 1px solid var(--border-light); border-radius: var(--radius-sm); color: var(--text-main); transition: var(--transition); }
.field-wrap input:focus { border-color: var(--accent-1); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); }
.field-icon { display: none; }
.btn-signin { width: 100%; padding: 16px; background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); color: #fff; font-weight: 600; font-size: 16px; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3); }
.btn-signin:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(236, 72, 153, 0.4); }
.error-msg { background: rgba(244, 63, 94, 0.1); border: 1px solid rgba(244, 63, 94, 0.2); padding: 12px; border-radius: var(--radius-sm); color: var(--danger); margin-bottom: 20px; font-size: 13px; display: flex; align-items: center; gap: 8px; }

/* --- PROFILE LAYOUT --- */
#profile-page { flex-direction: row; }
.sidebar { width: 280px; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(10px); border-right: 1px solid var(--border-light); display: flex; flex-direction: column; padding: 40px 24px; height: 100vh; position: sticky; top: 0; }
.sidebar-logo { font-size: 24px; font-weight: 700; margin-bottom: 50px; text-align: center; letter-spacing: 2px; }
.avatar-wrap { margin-bottom: 20px; display: flex; justify-content: center; }
.avatar-ring { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); padding: 2px; }
.avatar-inner { width: 100%; height: 100%; background: var(--bg-main); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600; color: #fff; }
.avatar-pulse { display: none; }
.user-info { text-align: center; margin-bottom: 40px; }
.user-name { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.user-login { color: var(--text-muted); font-size: 14px; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.nav-item { background: transparent; color: var(--text-muted); padding: 14px 18px; border-radius: var(--radius-sm); text-align: left; cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; }
.nav-item:hover { background: rgba(255,255,255,0.03); color: var(--text-main); }
.nav-item.active { background: linear-gradient(to right, rgba(99, 102, 241, 0.1), transparent); color: var(--accent-1); border-left: 3px solid var(--accent-1); }
.nav-item svg { width: 18px; height: 18px; }

/* ОБНОВЛЕННАЯ КНОПКА ВЫХОДА */
.btn-logout { 
  background: transparent; 
  color: var(--text-muted); 
  padding: 12px 20px; 
  border-radius: var(--radius-sm); 
  border: 1px solid rgba(244, 63, 94, 0.2);
  cursor: pointer; 
  transition: var(--transition); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 10px; 
  font-size: 14px;
  font-weight: 500; 
  margin-top: auto; 
  align-self: center; /* Центрируем, чтобы не растягивалась на всю ширину */
  width: 85%; /* Аккуратный размер */
}
.btn-logout svg { 
  width: 16px; 
  height: 16px; 
  color: var(--danger); 
  transition: var(--transition); 
}
.btn-logout:hover { 
  background: rgba(244, 63, 94, 0.1); 
  color: var(--danger); 
  border-color: rgba(244, 63, 94, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.15);
}

/* --- MAIN CONTENT --- */
.main { flex: 1; padding: 50px 60px; overflow-y: auto; }
.section { display: none; animation: slideUp 0.4s ease forwards; opacity: 0; transform: translateY(10px); }
.section.active-section { display: block; }
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }
.section-title { font-size: 28px; font-weight: 700; margin-bottom: 30px; display: inline-block; }
.campus-tag { display: none; }

/* --- CARDS & GRID --- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 40px; }
.kpi-card { background: var(--bg-card); backdrop-filter: blur(10px); border: 1px solid var(--border-light); padding: 30px; border-radius: var(--radius-lg); transition: var(--transition); box-shadow: var(--shadow-soft); position: relative; overflow: hidden; }
.kpi-card:hover { transform: translateY(-5px); background: var(--bg-card-hover); border-color: rgba(255,255,255,0.15); }
.kpi-icon { font-size: 24px; margin-bottom: 16px; opacity: 0.8; }
.kpi-value { font-size: 36px; font-weight: 700; margin-bottom: 8px; color: #fff; }
.kpi-label { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.kpi-sub { font-size: 13px; color: var(--accent-1); margin-top: 5px; }

.detail-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 10px 30px; }
.detail-row { display: flex; justify-content: space-between; padding: 20px 0; border-bottom: 1px solid var(--border-light); }
.detail-row:last-child { border-bottom: none; }
.dk { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.dv { font-weight: 600; }

/* --- LISTS --- */
.projects-list { display: flex; flex-direction: column; gap: 12px; }
.project-item { display: flex; align-items: center; padding: 20px 24px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-md); transition: var(--transition); }
.project-item:hover { background: var(--bg-card-hover); transform: scale(1.01); }
.proj-name { flex: 1; font-size: 15px; font-weight: 500; }
.proj-badge { padding: 6px 12px; font-size: 12px; font-weight: 600; border-radius: 20px; }
.badge-pass { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-fail { background: rgba(244, 63, 94, 0.1); color: var(--danger); }
.proj-date { margin-left: 24px; color: var(--text-muted); font-size: 13px; }
.proj-dot { display: none; }

/* --- SKILLS --- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.skill-card { background: var(--bg-card); border: 1px solid var(--border-light); padding: 24px; border-radius: var(--radius-md); transition: var(--transition); }
.skill-card:hover { background: var(--bg-card-hover); }
.sk-name { margin-bottom: 16px; font-size: 15px; font-weight: 500; }
.sk-bar-bg { height: 6px; background: rgba(0,0,0,0.3); border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.sk-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-1), var(--accent-2)); width: 0; transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 10px; }
.sk-level { font-size: 13px; color: var(--text-muted); }

/* --- CHARTS --- */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 30px; }
.chart-card { background: var(--bg-card); border: 1px solid var(--border-light); padding: 30px; border-radius: var(--radius-lg); }
.chart-title { font-size: 16px; font-weight: 600; margin-bottom: 30px; color: var(--text-main); }

/* --- LOADING --- */
.loading-overlay { position: fixed; inset: 0; background: rgba(11, 15, 25, 0.8); backdrop-filter: blur(5px); z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-size: 16px; font-weight: 500; }
.loader-ring { width: 50px; height: 50px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--accent-1); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  #profile-page { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; padding: 20px; border-right: none; border-bottom: 1px solid var(--border-light); align-items: center; }
  .user-info, .avatar-wrap { display: none; }
  .sidebar-logo { margin-bottom: 20px; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .main { padding: 30px 20px; }
  .btn-logout { width: auto; margin-top: 20px; }
}