/* ================================================
   1. ROOT VARIABLES (Studio Black Theme)
   ================================================ */
:root {
  --color-primary: #5a189a;
  --color-secondary: #ffc300;
  --color-background: #f4f7f9;
  --color-text: #333333;
  --color-soft-gray: #6b7280;
  --color-error: #dc3545;
  --color-success: #28a745;

  /* Glass Vars */
  --bg-body: var(--color-background);
  --bg-glass-panel: rgba(255, 255, 255, 0.95);
  --bg-input: #ffffff;
  --border-color: #c0c0c0;
  --shadow-glass: 0 8px 30px rgba(90, 24, 154, 0.05);
  
  --font-family-sans: 'Poppins', system-ui, -apple-system, sans-serif;
  --border-radius-lg: 16px;
  --border-radius-sm: 8px;
  --border-radius-pill: 50px;
}

/* DARK MODE */
body.dark {
  --bg-body: #050505; 
  --bg-glass-panel: #141414; 
  --bg-input: #1f1f1f; 
  --color-text: #ffffff;
  --color-soft-gray: #a3a3a3;
  --border-color: #3c096c; 
  --color-secondary: #ffd60a; 
}

/* ================================================
   2. LAYOUT
   ================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-family-sans);
  background: var(--bg-body);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
.page-header {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 500px;
  margin-bottom: 20px;
}

.back-link {
  font-size: 2rem;
  color: var(--color-primary);
  text-decoration: none;
  margin-right: 15px;
  line-height: 1;
  transition: transform 0.2s;
}
.back-link:hover { transform: translateX(-3px); }
body.dark .back-link { color: var(--color-secondary); }

.page-header h1 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--color-text);
}

/* ================================================
   3. PROFILE CONTAINER (Glass Card)
   ================================================ */
.profile-container {
  background: var(--bg-glass-panel);
  border: 1px solid var(--border-color);
  padding: 30px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-glass);
  width: 100%;
  max-width: 500px;
}

/* Dark Mode Glow */
body.dark .profile-container {
  box-shadow: 0 0 20px rgba(90, 24, 154, 0.15);
}

/* Image Upload */
.profile-image-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 25px;
}

.profile-img-lg {
  width: 100px; 
  height: 100px; 
  border-radius: 50%; 
  object-fit: cover; 
  margin-bottom: 12px;
  border: 3px solid var(--color-secondary); 
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Form Elements */
label { 
  display: block; 
  margin-bottom: 8px; 
  font-weight: 500; 
  color: var(--color-text); 
  font-size: 0.9em;
  margin-top: 15px; 
}

input[type="text"], textarea {
  width: 100%; 
  padding: 12px; 
  margin-bottom: 5px; 
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm); 
  font-family: var(--font-family-sans); 
  font-size: 1em;
  color: var(--color-text); 
  transition: 0.3s;
}

input[type="text"]:focus, textarea:focus { 
  outline: none; 
  border-color: var(--color-secondary); 
  box-shadow: 0 0 0 3px rgba(90, 24, 154, 0.1); 
}

textarea { resize: vertical; min-height: 80px; }

h3 {
  text-align: center; 
  color: var(--color-primary); 
  margin-top: 30px; 
  margin-bottom: 15px; 
  font-size: 1em; 
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
body.dark h3 { color: var(--color-secondary); }

/* Buttons */
.small-btn {
  background-color: var(--bg-input); 
  color: var(--color-text); 
  padding: 8px 15px; 
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-pill); 
  cursor: pointer; 
  font-size: 0.85em; 
  transition: 0.2s;
}
.small-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

#saveProfileBtn {
  background-color: var(--color-primary); 
  color: white; 
  padding: 14px; 
  border: none;
  border-radius: var(--border-radius-sm); 
  cursor: pointer; 
  margin-top: 25px; 
  width: 100%; 
  font-size: 1.1em;
  font-weight: 600; 
  transition: 0.2s; 
  display: flex;
  align-items: center; 
  justify-content: center; 
  gap: 10px;
}
#saveProfileBtn:hover { background-color: #4a148c; transform: translateY(-2px); }
body.dark #saveProfileBtn { background: var(--color-secondary); color: #3E1F47; }
body.dark #saveProfileBtn:hover { background: #ffdb4d; }

.cancel-link { 
  display: block; 
  text-align: center; 
  margin-top: 15px; 
  color: var(--color-soft-gray); 
  text-decoration: none; 
  font-size: 0.9em;
}
.cancel-link:hover { color: var(--color-text); }

.error-message { color: var(--color-error); font-size: 0.85em; margin-bottom: 10px; display: none; }

/* Utilities */
.toast-message {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #333; color: white; padding: 10px 20px; border-radius: 30px;
  z-index: 1000; opacity: 0; transition: opacity 0.5s;
}
.toast-message.show { opacity: 1; }

.spinner-small {
  width: 20px; height: 20px; 
  border: 3px solid rgba(255,255,255,0.3); 
  border-top-color: #fff; 
  border-radius: 50%; 
  animation: spin 1s linear infinite;
}
body.dark .spinner-small { border-color: rgba(0,0,0,0.2); border-top-color: #000; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton */
.profile-loading { display: flex; flex-direction: column; align-items: center; gap: 15px; animation: pulse 1.5s infinite; }
.skeleton-image { width: 100px; height: 100px; border-radius: 50%; background: #e0e0e0; }
.skeleton-text { width: 100%; height: 40px; background: #e0e0e0; border-radius: 8px; }
body.dark .skeleton-image, body.dark .skeleton-text { background: #1f1f1f; }
@keyframes pulse { 50% { opacity: 0.5; } }
