/* ====== Queen Ruva Profile Editor ====== */

:root {
  --bg: #0f172a;
  --card: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --sub: #94a3b8;
  --accent: #8b5cf6;
  --accent2: #6366f1;
  --ok: #22c55e;
  --err: #ef4444;
  --warn: #f59e0b;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  min-height: 100vh;
  padding-bottom: 60px;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Loader */
#loader {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
#loader.show { display: flex; }
.spin {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Header */
header {
  text-align: center;
  margin-bottom: 28px;
  animation: rise 0.6s both;
}
.crown {
  display: inline-block;
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(139,92,246,0.25);
}
.crown i { color: white; font-size: 22px; }

h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}
h1 em {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: normal;
}
.tagline {
  color: var(--sub);
  font-size: 0.8rem;
  margin-top: 6px;
  letter-spacing: 0.5px;
}

/* Status bar */
#sbar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.78rem;
  margin-bottom: 20px;
  min-height: 40px;
  display: flex;
  align-items: center;
  animation: rise 0.5s 0.04s both;
  transition: border-color 0.3s, color 0.3s;
}
#sbar.ok { border-color: var(--ok); color: var(--ok); }
#sbar.err { border-color: var(--err); color: var(--err); }
#sbar.warn { border-color: var(--warn); color: var(--warn); }

/* Section titles */
.stitle {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  animation: rise 0.5s both;
}

/* Profile Picture */
.pp-zone {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.pp-ring {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  padding: 3px;
  flex-shrink: 0;
}
.pp-placeholder {
  width: 100%; height: 100%;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pp-placeholder i { color: var(--sub); font-size: 32px; }
.pp-placeholder img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.pp-actions {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pp-actions p {
  color: var(--sub);
  font-size: 0.75rem;
  line-height: 1.5;
}
.pp-url-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pp-url-row input {
  flex: 1;
  min-width: 180px;
}

/* Form fields */
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .row2 { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 0.72rem;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.field label i { color: var(--accent); font-size: 0.8rem; }

input[type="text"],
input[type="url"],
textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}
input::placeholder,
textarea::placeholder { color: #475569; }

/* Buttons */
.btn-sm {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  color: white;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn-sm:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-sm:active { transform: translateY(0); }

.btn-save {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: white;
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(139,92,246,0.25);
}
.btn-save:hover { transform: translateY(-2px); opacity: 0.92; }
.btn-save:active { transform: translateY(0); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--err);
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}
.btn-danger:hover { background: rgba(239,68,68,0.18); }

/* Mess grid */
.mess-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.mess-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mess-key {
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}
.mess-val {
  resize: vertical;
  min-height: 60px;
}

/* Divider */
.div {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

/* Corner user menu */
#queenruva-corner {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}
#cornerBtn {
  width: 45px; height: 45px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.2);
}
#cornerBtn i { color: white; font-size: 18px; }
#cornerDropdown {
  position: absolute;
  top: 55px; right: 0;
  background: var(--card);
  border-radius: 12px;
  min-width: 200px;
  display: none;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  overflow: hidden;
}
#cornerDropdown > div:first-child {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
#cornerDropdown .uname {
  color: white;
  font-weight: 600;
  font-size: 13px;
}
#cornerDropdown .uphone {
  color: var(--sub);
  font-size: 11px;
  margin-top: 4px;
}
#logoutBtn {
  padding: 10px 16px;
  color: var(--err);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
#logoutBtn:hover { background: rgba(239,68,68,0.08); }

/* Animations */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.profile-photo {
  width: 90px;
  height: 90px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Main section titles */
.stitle {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.3px;
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: rise 0.5s ease both;
}

/* Typing status text */
.typing-text {
  font-size: 13px;
  color: #b5b5b5;
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Sub description text */
.sub-info {
  font-size: 12px;
  color: #7f7f7f;
  margin-top: 4px;
  line-height: 1.4;
}

/* Small badge/tag */
.sub-tag {
  font-size: 10px;
  font-weight: 500;
  color: #8a8a8a;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.2px;
}

/* blinking dot */
.dot {
  animation: blink 1s infinite;
}

/* animations */
@keyframes blink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

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