@import url('shared-styles.css');

/* profile.css - LaoVerse Profile Page Styling */
:root {
  --neon-blue: #66f0ff;
  --light-blue: #00b7d4;
  --black: #000000;
  --white: #ffffff;
  --gray: #222222;
  --light-gray: #333333;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Noto Sans Lao', sans-serif;
}

body {
  background-color: var(--black);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  padding-top: 100px;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(102, 240, 255, 0.05) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(102, 240, 255, 0.05) 0%, transparent 20%);
}

/* --- Shared Header Styling --- */
.main-header {
  width: 100%;
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--black);
  border-bottom: 1px solid var(--neon-blue);
  box-shadow: 0 0 15px var(--neon-blue);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
}
.logo img { width: 160px; }
.main-nav ul { display: flex; list-style: none; gap: 1.2rem; }
.main-nav a {
  color: var(--white);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--neon-blue);
  background-color: var(--black);
  font-size: 0.9rem;
}
.main-nav a:hover { color: var(--neon-blue); background-color: var(--white); }
.main-nav a.active { background-color: var(--neon-blue); color: var(--black); font-weight: bold; }

/* --- Profile Section --- */
.profile-container {
  width: 95%;
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 2.5rem;
  background-color: var(--gray);
  border-radius: 12px;
  border: 1px solid var(--neon-blue);
  box-shadow: 0 0 30px rgba(102, 240, 255, 0.2);
  display: flex;
  gap: 2.5rem;
  align-items: center;
  position: relative;
  animation: subtleGlow 4s infinite alternate;
}

@keyframes subtleGlow { from { box-shadow: 0 0 15px rgba(102, 240, 255, 0.1); } to { box-shadow: 0 0 30px rgba(102, 240, 255, 0.3); } }

.profile-container img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  min-width: 140px;
  border: 3px solid var(--neon-blue);
  box-shadow: 0 0 20px rgba(102, 240, 255, 0.4);
}

.profile-info { flex: 1; min-width: 250px; }
.profile-info h2 { color: var(--neon-blue); margin-bottom: 0.8rem; font-size: 2rem; }
.profile-info p { font-size: 1.1rem; margin-bottom: 0.4rem; }
.profile-info span { color: var(--neon-blue); font-weight: bold; }

#friendBtn { position: absolute; right: 2rem; top: 2rem; background: var(--light-blue); color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: bold; }
#friendBtn:hover { background: var(--neon-blue); box-shadow: 0 0 15px var(--neon-blue); }

#editProfileBtn { background: rgba(102, 240, 255, 0.1); border: 1px solid var(--neon-blue); color: var(--neon-blue); width: 100%; margin-top: 1rem; padding: 12px; border-radius: 8px; cursor: pointer; font-weight: bold; }
#editProfileBtn:hover { background: var(--neon-blue); color: var(--black); }

/* --- Posts Section --- */
#profilePosts { width: 95%; max-width: 800px; margin: 0 auto; }
#profilePosts h2 { color: var(--neon-blue); font-size: 1.4rem; margin-bottom: 1.5rem; border-bottom: 1px solid rgba(102, 240, 255, 0.3); padding-bottom: 0.5rem; }

.post { background: var(--gray); padding: 1.5rem; border-radius: 12px; border: 1px solid rgba(102, 240, 255, 0.2); margin-bottom: 1.5rem; }
.post-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.post-profile-pic { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--neon-blue); object-fit: cover; }
.post-user-info strong { color: white; display: block; font-size: 1.05rem; }
.post-user-info small { color: #888; font-size: 0.8rem; }

.post-image { max-width: 100%; border-radius: 8px; margin-top: 1rem; border: 1px solid rgba(255,255,255,0.1); }

.post-actions { display: flex; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.05); flex-wrap: wrap; }
.post-actions button { background: rgba(102, 240, 255, 0.05); border: 1px solid rgba(102, 240, 255, 0.1); color: white; padding: 8px 14px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.post-actions button:hover { background: var(--neon-blue); color: var(--black); }
.post-actions button.liked { color: #ff4444; border-color: #ff4444; }

.btn-icon { width: 16px; height: 16px; }

/* --- Comments --- */
.comments-section { margin-top: 1rem; padding: 1rem; background: rgba(0,0,0,0.2); border-radius: 8px; }
.comment { display: flex; gap: 0.8rem; margin-bottom: 1rem; }
.comment-profile-pic { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.comment-username { color: var(--neon-blue); font-size: 0.9rem; font-weight: bold; }
.comment-text { color: #eee; font-size: 0.9rem; margin-top: 2px; }

.add-comment { display: flex; gap: 10px; margin-top: 1.5rem; }
.comment-input { flex: 1; background: var(--light-gray); border: 1px solid #444; color: white; padding: 10px 15px; border-radius: 20px; outline: none; }
.comment-input:focus { border-color: var(--neon-blue); }
.submit-comment { background: var(--neon-blue); color: black; border: none; padding: 8px 18px; border-radius: 20px; font-weight: bold; cursor: pointer; }

/* --- Modals --- */
.modal { 
  position: fixed; 
  inset: 0; 
  background: rgba(0,0,0,0.4); 
  backdrop-filter: blur(8px);
  display: none; 
  align-items: center; 
  justify-content: center; 
  z-index: 3000; 
  padding: 20px; 
}
.modal-content { 
  background: rgba(34, 34, 34, 0.95); 
  width: 100%; 
  max-width: 500px; 
  padding: 2.5rem; 
  border-radius: 16px; 
  border: 1px solid rgba(102, 240, 255, 0.4); 
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 20px rgba(102, 240, 255, 0.2);
  animation: modalEntry 0.3s ease-out;
}
@keyframes modalEntry { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.close-button { 
  position: absolute; 
  right: 1.5rem; 
  top: 1rem; 
  font-size: 1.8rem; 
  color: var(--neon-blue); 
  cursor: pointer; 
  opacity: 0.7;
  transition: opacity 0.2s;
}
.close-button:hover { opacity: 1; }

.modal-content h2 { 
  color: var(--neon-blue); 
  font-size: 1.5rem; 
  margin-bottom: 1.5rem; 
  text-align: center;
}

.modal-content input, .modal-content textarea { 
  width: 100%; 
  background: rgba(0,0,0,0.3); 
  border: 1px solid rgba(255,255,255,0.1); 
  color: white; 
  padding: 14px; 
  border-radius: 10px; 
  margin-bottom: 1.2rem; 
  font-size: 0.95rem;
  transition: all 0.3s;
}
.modal-content input:focus, .modal-content textarea:focus {
  border-color: var(--neon-blue);
  background: rgba(0,0,0,0.5);
  box-shadow: 0 0 10px rgba(102, 240, 255, 0.2);
  outline: none;
}

.modal-content button[type="submit"] { 
  background: var(--neon-blue); 
  color: black; 
  border: none; 
  width: 100%; 
  padding: 14px; 
  border-radius: 10px; 
  font-weight: bold; 
  cursor: pointer; 
  margin-bottom: 12px; 
  transition: all 0.3s;
  font-size: 1rem;
}
.modal-content button[type="submit"]:hover {
  background: var(--white);
  box-shadow: 0 0 20px var(--neon-blue);
  transform: translateY(-2px);
}

.cancel-button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #aaa;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.cancel-button:hover {
  background: rgba(255,255,255,0.05);
  color: white;
  border-color: white;
}

.file-input-label {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 20px !important;
  border: 2px dashed rgba(102, 240, 255, 0.2) !important;
  margin-bottom: 1.5rem;
  cursor: pointer;
}
.file-input-label:hover {
  border-color: var(--neon-blue) !important;
  background: rgba(102, 240, 255, 0.05);
}
#editProfilePic, #editPostImage { display: none; }

/* --- Common UI --- */
.message { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 12px 24px; border-radius: 8px; z-index: 4000; display: none; }
.message.success { background: var(--light-blue); color: white; }
.message.error { background: #ff4444; color: white; }
#loading { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 5000; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.1); border-top-color: var(--neon-blue); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Mobile --- */
@media (max-width: 768px) {
  body { padding-top: 140px; }
  .main-header { flex-direction: column; padding: 10px; }
  .main-nav ul { gap: 8px; flex-wrap: wrap; justify-content: center; }
  .main-nav a { padding: 6px 10px; font-size: 0.75rem; }
  .profile-container { flex-direction: column; text-align: center; gap: 1.5rem; padding: 1.5rem; }
  #friendBtn { position: static; width: 100%; }
}
