:root {
  --bg-primary: #000000;
  --bg-secondary: rgba(255, 255, 255, 0.08);
  --bg-tertiary: rgba(255, 255, 255, 0.06);
  --bg-hover: rgba(255, 255, 255, 0.12);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --border-color: rgba(255, 255, 255, 0.12);
  --border-light: rgba(255, 255, 255, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.2);
  --cloud1-color1: rgba(68, 70, 225, 0.4);
  --cloud1-color2: rgba(220, 53, 69, 0.35);
  --cloud2-color1: rgba(100, 102, 255, 0.3);
  --cloud2-color2: rgba(255, 80, 100, 0.25);
  --card-bg: linear-gradient(135deg, rgba(28, 42, 93, 0.8) 0%, rgba(10, 17, 42, 0.8) 100%);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --accent: #4446E1;
}

[data-theme="light"] {
  --bg-primary: #f5f7fa;
  --bg-secondary: rgba(255, 255, 255, 0.9);
  --bg-tertiary: rgba(255, 255, 255, 0.95);
  --bg-hover: rgba(255, 255, 255, 1);
  --text-primary: #1a1a2e;
  --text-secondary: rgba(26, 26, 46, 0.7);
  --text-muted: rgba(26, 26, 46, 0.5);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.1);
  --cloud1-color1: rgba(68, 70, 225, 0.8);
  --cloud1-color2: rgba(220, 53, 69, 0.75);
  --cloud2-color1: rgba(100, 102, 255, 0.7);
  --cloud2-color2: rgba(255, 80, 100, 0.65);
  --card-bg: linear-gradient(135deg, rgba(68, 70, 225, 0.15) 0%, rgba(100, 102, 255, 0.08) 100%);
  --shadow-color: rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse 80% 60% at 30% 20%, var(--cloud1-color1) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 70% 30%, var(--cloud1-color2) 0%, transparent 50%);
  z-index: -1;
  animation: cloudFloat 20s ease-in-out infinite;
  transition: background 0.3s ease;
}

body::after {
  content: '';
  position: fixed;
  top: -30%;
  left: -30%;
  width: 160%;
  height: 160%;
  background:
    radial-gradient(ellipse 50% 40% at 60% 25%, var(--cloud2-color1) 0%, transparent 45%),
    radial-gradient(ellipse 40% 35% at 40% 35%, var(--cloud2-color2) 0%, transparent 40%);
  z-index: -1;
  animation: cloudFloat2 25s ease-in-out infinite reverse;
  transition: background 0.3s ease;
}

@keyframes cloudFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(5%, 3%) scale(1.05); }
  50% { transform: translate(-3%, 5%) scale(0.98); }
  75% { transform: translate(-5%, -2%) scale(1.02); }
}

@keyframes cloudFloat2 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-4%, 4%) rotate(2deg); }
  66% { transform: translate(4%, -3%) rotate(-2deg); }
}

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

@keyframes cardApproach {
  0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(-20px) scale(0.95); opacity: 0.7; }
}

.container {
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.top-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.5s ease-out;
  align-items: stretch;
}

.nav-close {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.nav-group {
  flex: 1;
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 4px;
  gap: 4px;
}

.nav-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-tab.active {
  background: rgba(68, 70, 225, 0.2);
  color: var(--text-primary);
}

.header {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeInUp 0.5s ease-out;
}

.header img {
  height: 60px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 30px var(--shadow-color);
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.info-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.info-value {
  font-weight: 600;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

select,
input[type="password"],
input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--bg-hover);
}

.inline-group {
  display: flex;
  gap: 10px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #4446E1 0%, #2E3192 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(68, 70, 225, 0.4);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-danger {
  background: rgba(230, 53, 48, 0.15);
  color: #ff4d4d;
  border: 1px solid rgba(230, 53, 48, 0.3);
}

.btn-sm {
  width: auto;
  padding: 10px 16px;
  font-size: 0.85rem;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 16px;
  margin-bottom: 10px;
}

.toggle-info {
  flex: 1;
}

.toggle-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.toggle-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  transition: .4s;
  border-radius: 34px;
  border: 1px solid var(--border-light);
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.avatar-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.avatar-upload-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--accent);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  transition: all 0.3s ease;
}

.avatar-upload-btn:hover {
  transform: scale(1.1);
}

.student-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 8px;
}

.student-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.student-phone {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.student-badge {
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.modal-overlay.shown {
  visibility: visible;
  opacity: 1;
}

.modal-content {
  background: var(--bg-tertiary);
  backdrop-filter: blur(40px);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 24px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 25px 50px var(--shadow-color);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.grid {
  display: grid;
  gap: 10px;
}

.flex {
  display: flex;
}

.flex-1 {
  flex: 1;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.mt-10 {
  margin-top: 10px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

@media (max-width: 480px) {
  .container {
    padding: 0.8rem;
  }
  .header h1 {
    font-size: 1.5rem;
  }
  .card {
    padding: 18px;
  }
}
