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

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

:root {
  --accent: #0078d4;
  --accent-light: #2899f5;
  --accent-dark: #005a9e;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-hover: rgba(255, 255, 255, 0.85);
  --border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.18), 0 0 1px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --blur: blur(24px) saturate(180%);
  --text: #1b1b1b;
  --text-muted: #605e5c;
}

html, body {
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  font-size: 15px;
}

body {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(0, 120, 212, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 168, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 30%, rgba(120, 180, 255, 0.1) 0%, transparent 45%),
    linear-gradient(160deg, #dce8f5 0%, #eaf2fb 40%, #f0f4f9 100%);
  background-attachment: fixed;
}

.hidden { display: none !important; }

/* ---- Header ---- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  height: 52px;
  background: rgba(243, 249, 255, 0.82);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.logo {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
}

.login-btn {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0, 120, 212, 0.08);
  border: 1px solid rgba(0, 120, 212, 0.25);
  padding: 5px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.login-btn:hover {
  background: rgba(0, 120, 212, 0.14);
  border-color: rgba(0, 120, 212, 0.45);
  box-shadow: 0 0 0 1px rgba(0, 120, 212, 0.2);
}

.login-btn.admin-mode {
  color: #c50f1f;
  background: rgba(197, 15, 31, 0.07);
  border-color: rgba(197, 15, 31, 0.22);
}

.login-btn.admin-mode:hover {
  background: rgba(197, 15, 31, 0.13);
  border-color: rgba(197, 15, 31, 0.4);
}

/* ---- Page layout ---- */
.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Card ---- */
.card {
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ---- Profile ---- */
.profile {
  display: flex;
  gap: 24px;
  padding: 24px;
}

.avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.avatar {
  width: 148px;
  height: 148px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(0,120,212,0.08), rgba(0,120,212,0.03));
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.18s;
  pointer-events: none;
}

.avatar {
  position: relative;
}

.avatar.admin-hover {
  cursor: pointer;
}

.avatar.admin-hover:hover .avatar-hint {
  opacity: 1;
}

.about-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bio-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bio {
  flex: 1;
  min-height: 120px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.45);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

.bio-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.bio-edit textarea {
  flex: 1;
  min-height: 120px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  border: 1px solid rgba(0,120,212,0.3);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.6);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.bio-edit textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
}

/* ---- Projects ---- */
.projects {
  overflow: hidden;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
  gap: 2px;
  background: rgba(255,255,255,0.3);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tab {
  position: relative;
  padding: 12px 18px 11px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, background 0.15s;
}

.tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.tab:hover {
  color: var(--text);
  background: rgba(0,0,0,0.04);
}

.tab.active {
  color: var(--accent);
}

.tab.active::after {
  transform: scaleX(1);
}

.tab-content {
  padding: 24px;
  min-height: 140px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.tab-pane.active {
  display: flex;
}

.pane-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.desc-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.tab-pane a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  background: rgba(0,120,212,0.07);
  border: 1px solid rgba(0,120,212,0.18);
  width: fit-content;
  transition: background 0.15s, border-color 0.15s;
}

.tab-pane a::before {
  content: '↗';
  font-size: 0.75rem;
}

.tab-pane a:hover {
  background: rgba(0,120,212,0.14);
  border-color: rgba(0,120,212,0.35);
  text-decoration: none;
}

/* ---- Links view ---- */
.links-view {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.link-row a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  background: rgba(0,120,212,0.07);
  border: 1px solid rgba(0,120,212,0.18);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.link-row a::before { content: '↗'; font-size: 0.75rem; }

.link-row a:hover {
  background: rgba(0,120,212,0.14);
  border-color: rgba(0,120,212,0.35);
}

.link-row .link-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---- Links editor ---- */
.pane-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pane-edit textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  border: 1px solid rgba(0,120,212,0.3);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.6);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pane-edit textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
}

.links-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.links-editor-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.link-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.link-edit-row input {
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.875rem;
  border: 1px solid rgba(0,120,212,0.25);
  border-radius: 4px;
  background: rgba(255,255,255,0.7);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.link-edit-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,120,212,0.12);
}

.link-edit-row .input-url { flex: 2; min-width: 0; }
.link-edit-row .input-label { flex: 3; min-width: 0; }

.link-save-btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}

.link-save-btn:hover { background: var(--accent-light); }

.link-delete-btn {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 5px 9px;
  background: rgba(197,15,31,0.08);
  color: #c50f1f;
  border: 1px solid rgba(197,15,31,0.2);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.link-delete-btn:hover { background: rgba(197,15,31,0.16); }

.add-link-btn {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 7px 14px;
  background: rgba(0,120,212,0.07);
  color: var(--accent);
  border: 1px dashed rgba(0,120,212,0.35);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
  margin-top: 2px;
}

.add-link-btn:hover {
  background: rgba(0,120,212,0.13);
  border-color: rgba(0,120,212,0.5);
}

/* ---- Buttons ---- */
.save-btn {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 7px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: fit-content;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(0,120,212,0.3);
}

.save-btn:hover {
  background: var(--accent-light);
  box-shadow: 0 2px 8px rgba(0,120,212,0.4);
}

.save-btn:active {
  background: var(--accent-dark);
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fade-in 0.15s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: rgba(250, 253, 255, 0.92);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px 28px;
  width: 340px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modal-in 0.2s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
}

.modal-close:hover {
  background: rgba(0,0,0,0.07);
  color: var(--text);
}

.modal input[type="password"] {
  width: 100%;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid rgba(0,120,212,0.3);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.7);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.modal input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
}

.btn-primary {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 9px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(0,120,212,0.3);
}

.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 2px 10px rgba(0,120,212,0.4);
}

.btn-primary:active {
  background: var(--accent-dark);
}

.login-error {
  color: #c50f1f;
  font-size: 0.85rem;
  background: rgba(197,15,31,0.07);
  border-radius: 4px;
  padding: 6px 10px;
}
