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

/* feed.css - LaoVerse Feed Page Styling */
/* Base Styles */
:root {
  --neon-blue: #66f0ff;
  --light-blue: #00b7d4;
  --soft-blue: #8bd8e5;
  --black: #000000;
  --white: #ffffff;
  --gray: #222222;
  --light-gray: #333333;
  --chat-gray: #1a1a1a;
}

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

body {
  background-color: black;
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
-webkit-tap-highlight-color: rgba(255, 0, 0, 0.0);
  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%);
  padding-top: 96px;
}

.haha {
  width: 100%;
  height: 100%;
  padding: 80px 90px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: black;
  
}


/* Container Styles */
.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Search Container Styles */
.search-container {
  display: flex;
  margin-bottom: 1.5rem;
  gap: 0.5rem;
}

.search-container input {
  flex: 1;
  padding: 0.8rem;
  border: 1px solid var(--neon-blue);
  border-radius: 5px;
  background-color: var(--light-gray);
  color: var(--white);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-container input:focus {
  outline: none;
  box-shadow: 0 0 10px var(--neon-blue);
}

.search-container button {
  padding: 0.8rem;
  background-color: var(--light-gray);
  border: 1px solid var(--neon-blue);
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.search-container button:hover {
  background-color: var(--light-blue);
  box-shadow: 0 0 10px var(--neon-blue);
}

/* Post Form Styles */
.post-form {
  background-color: var(--gray);
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  border: 1px solid var(--neon-blue);
  box-shadow: 0 0 20px rgba(102, 240, 255, 0.3);
  animation: glow 2s infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 10px rgba(102, 240, 255, 0.3);
  }
  to {
    box-shadow: 0 0 20px rgba(102, 240, 255, 0.6);
  }
}

.post-form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--neon-blue);
  border-radius: 5px;
  background-color: var(--light-gray);
  color: var(--white);
  font-size: 1rem;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.post-form textarea:focus {
  outline: none;
  box-shadow: 0 0 10px var(--neon-blue);
}

.post-form textarea::placeholder {
  color: #aaa;
}

#image-preview {
  margin-bottom: 1rem;
}

#image-preview img,
#image-preview video {
  max-width: 100%;
  max-height: 300px;
  border-radius: 5px;
  border: 1px solid var(--neon-blue);
}

#image-preview audio {
  width: 100%;
  max-width: 500px;
  border-radius: 5px;
  border: 1px solid var(--neon-blue);
  margin-top: 0.5rem;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.file-input-label {
  padding: 0.8rem 1.5rem;
  background-color: var(--light-gray);
  color: var(--white);
  border: 1px solid var(--neon-blue);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-input-label:hover {
  background-color: rgba(102, 240, 255, 0.1);
  box-shadow: 0 0 10px var(--neon-blue);
}

.file-input {
  display: none;
}

.post-button-tao {
  padding: 0.8rem;
  border: 1px solid var(--neon-blue);
  border-radius: 5px;
  background-color: var(--light-gray);
  color: var(--white);
  justify-content: center;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.post-button-tao:hover {
  background-color: var(--light-blue);
  color: var(--white);
  box-shadow: 0 0 15px var(--neon-blue);
  border-color: var(--light-blue);
}

/* Feed Container Styles */
.feed-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.no-posts {
  text-align: center;
  color: #aaa;
  padding: 2rem;
  background-color: var(--gray);
  border-radius: 10px;
  border: 1px dashed var(--neon-blue);
}

/* Post Styles */
.post {
  background-color: var(--gray);
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--neon-blue);
  box-shadow: 0 0 15px rgba(102, 240, 255, 0.2);
}

.post-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.post-profile-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-right: 1rem;
  border: 1px solid var(--neon-blue);
}

.post-user-info {
  flex: 1;
}

.username {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.post-time {
  color: #aaa;
  font-size: 0.8rem;
}

.post-content {
  margin-bottom: 1rem;
}

.post-text {
  color: var(--white);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.post-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 5px;
  display: block;
  margin-top: 1rem;
  border: 1px solid var(--neon-blue);
}
.post-audio {
  width: 100%;
  margin-top: 1rem;
}
.post-file {
  display: inline-block;
  margin-top: 1rem;
  color: var(--neon-blue);
}
.post-embed {
  margin-top: 1rem;
}
.post-embed iframe {
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--neon-blue);
  border-radius: 8px;
}

.post-actions {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(102, 240, 255, 0.2);
}

/* Icon styling for buttons with theme support */
.btn-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 1;
  margin-right: 0.3rem;
  transition: all 0.3s ease;
  vertical-align: middle;
}

.like-btn {
  background: none;
  border: none;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  padding: 10px 10px;
  line-height: 1;
  width: fit-content;
  flex-shrink: 1;
}

.like-btn .like-icon {
  color: var(--neon-blue);
  filter: drop-shadow(0 0 2px var(--neon-blue));
}

.like-btn.liked {
  color: #ff4444;
}

.like-btn.liked .like-icon {
  color: #ff4444;
  filter: drop-shadow(0 0 3px #ff4444);
}

.like-btn:hover {
  background-color: var(--light-blue);
  border-radius: 5px;
}

.comment-btn {
  background: none;
  border: none;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  padding: 10px 10px;
  line-height: 1;
  width: fit-content;
  flex-shrink: 1;
}

.comment-btn .comment-icon {
  color: var(--light-blue);
  filter: drop-shadow(0 0 2px var(--light-blue));
}

.comment-btn:hover {
  background-color: var(--light-blue);
  border-radius: 5px;
}

.edit-post-btn,
.delete-post-btn {
  background: none;
  border: none;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  padding: 10px 10px;
  line-height: 1;
  width: fit-content;
  flex-shrink: 1;
}

.delete-post-btn {
  color: #ff6666;
}

.edit-post-btn:hover,
.delete-post-btn:hover {
  background-color: rgba(102, 240, 255, 0.12);
  border-radius: 5px;
}

.reply-toggle .reply-icon {
  color: var(--soft-blue);
  filter: drop-shadow(0 0 1px var(--soft-blue));
}

/* Comments Section */
.comments-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(102, 240, 255, 0.2);
}

.comment {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.8rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.comment:hover {
  background-color: rgba(102, 240, 255, 0.05);
}

.comment-profile-pic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 5px rgba(102, 240, 255, 0.3);
}

.comment-content {
  flex: 1;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.comment-username {
  color: var(--white);
  font-weight: bold;
}

.comment-time {
  color: #aaa;
  font-size: 0.8rem;
}

.comment-text {
  color: var(--white);
  line-height: 1.4;
}

.comment-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.reply-toggle,
.comment-edit-toggle,
.comment-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  background: rgba(102, 240, 255, 0.05);
  color: var(--neon-blue);
  border: 1px solid rgba(102, 240, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.comment-delete-btn {
  color: #ff6666;
  border-color: rgba(255, 102, 102, 0.2);
}

.reply-toggle:hover,
.comment-edit-toggle:hover {
  background: rgba(102, 240, 255, 0.15);
  border-color: var(--neon-blue);
  box-shadow: 0 0 8px rgba(102, 240, 255, 0.3);
}

.comment-delete-btn:hover {
  background: rgba(255, 102, 102, 0.15);
  border-color: #ff6666;
  box-shadow: 0 0 8px rgba(255, 102, 102, 0.3);
}

@media (max-width: 480px) {
  .reply-toggle,
  .comment-edit-toggle,
  .comment-delete-btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
}

.comment-edit-box {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.comment-edit-input {
  flex: 1;
  min-width: 180px;
  padding: 0.7rem;
  border: none;
  border-radius: 6px;
  background-color: var(--light-gray);
  color: var(--white);
}

.comment-edit-input:focus {
  outline: none;
  background-color: var(--gray);
  box-shadow: 0 0 0 2px var(--neon-blue);
}

.add-comment {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  align-items: center;
}

.comment-input {
  flex: 1;
  padding: 0.8rem;
  border: none;
  border-radius: 5px;
  background-color: var(--light-gray);
  color: var(--white);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.comment-input:focus {
  outline: none;
  background-color: var(--gray);
  box-shadow: 0 0 0 2px var(--neon-blue);
}

.submit-comment {
  padding: 0.5rem 1rem;
  background-color: transparent;
  color: var(--neon-blue);
  border: 2px solid var(--neon-blue);
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-comment:hover {
  background-color: var(--neon-blue);
  color: var(--black);
  box-shadow: 0 0 10px var(--neon-blue);
  border-color: var(--light-blue);
}

.no-comments {
  color: #aaa;
  text-align: center;
  padding: 1rem;
}

/* Message Notification */
.message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 15px 25px;
  border-radius: 8px;
  color: var(--white);
  font-weight: 500;
  font-size: 0.95rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  animation: fadeIn 0.3s ease-out;
  max-width: 90%;
  width: max-content;
}

.message.success {
  background-color: var(--light-blue);
  border: 1px solid var(--neon-blue);
  box-shadow: 0 0 15px rgba(102, 240, 255, 0.5);
}

.message.error {
  background-color: var(--error-red);
  border: 1px solid #ff6666;
  box-shadow: 0 0 15px rgba(255, 51, 51, 0.5);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Loading Animation */
#loading {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1001;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: var(--neon-blue);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== */
/* Responsive Design */
/* ==================== */

/* สำหรับหน้าจอขนาดกลาง (แท็บเล็ต) */
@media (max-width: 1024px) {
  .haha {
    padding: 80px 40px;
  }
  
  .main-header {
    padding: 1rem;
  }
  
  .logo img {
    width: 180px;
  }
  
  .main-nav ul {
    gap: 1rem;
  }
  
  .container {
    padding: 0 1.5rem;
  }
}

/* สำหรับหน้าจอขนาดเล็ก (แท็บเล็ตแนวตั้ง) */
@media (max-width: 768px) {
  .haha {
    padding: 40px 20px;
    flex-direction: column;
    gap: 1.5rem;
  }
  
  
  .container {
    margin-top: 6rem;
    padding: 0 1rem;
  }
  
  .post-form {
    padding: 1.2rem;
  }
  
  .post {
    padding: 1.2rem;
  }
  
  .post-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .post-button-tao {
    margin-left: 0;
    width: 100%;
  }
  
  .add-comment {
    flex-direction: column;
    align-items: stretch;
  }
  
  .submit-comment {
    width: 100%;
  }
}

/* สำหรับหน้าจอขนาดเล็กมาก (โทรศัพท์มือถือ) */
@media (max-width: 480px) {
  .haha {
    padding: 20px 15px;
  }
  
  
  
  .container {
    margin-top: 7rem;
    padding: 0 0.8rem;
  }
  
  .post-form {
    padding: 1rem;
  }
  
  .post-form textarea {
    padding: 0.8rem;
    min-height: 80px;
  }
  
  .file-input-label,
  .post-button-tao {
    padding: 0.7rem;
    font-size: 0.9rem;
  }
  
  .post {
    padding: 1rem;
  }
  
  .profile-pic {
    width: 40px;
    height: 40px;
  }
  
  .username {
    font-size: 1rem;
  }
  
  .post-time {
    font-size: 0.7rem;
  }
  
  .post-image {
    max-height: 300px;
  }
  
  .comment {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem;
  }
  
  .comment-profile-pic {
    width: 35px;
    height: 35px;
  }
  
  .comment-text {
    font-size: 0.9rem;
  }
  
  .message {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
}

/* สำหรับหน้าจอขนาดเล็กพิเศษ */
@media (max-width: 360px) {
  .logo img {
    width: 120px;
  }
  
  .main-nav a {
    padding: 5px 6px;
    font-size: 0.75rem;
  }
  
  .container {
    margin-top: 8rem;
  }
  
  .post-form textarea {
    font-size: 0.9rem;
  }
  
  .file-input-label span,
  .post-button-tao {
    font-size: 0.8rem;
  }
  
  .profile-pic {
    width: 35px;
    height: 35px;
  }
}
/* Header Styles */
.main-header {
  width: 100%;
  padding: 1rem 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: 1000;
}

.logo img {
  width: 200px;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--white);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid var(--neon-blue);
  background-color: var(--black);
}

.main-nav a:hover {
  color: var(--neon-blue);
  text-shadow: 0 0 5px var(--neon-blue);
  background-color: var(--white);
}

.main-nav a.active {
  background-color: var(--neon-blue);
  color: var(--black);
  font-weight: bold;
}

/* Responsive adjustments for header */
@media (max-width: 768px) {
  body {
    padding-top: 140px;
  }

  .main-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .logo img {
    width: 160px;
  }
  
  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
  }
  
  .main-nav a {
    padding: 8px;
    font-size: 0.6rem;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 150px;
  }

  .logo img {
    width: 140px;
  }
  
  .main-nav ul {
    gap: 0.5rem;
  }
  
  .main-nav a {
    padding: 6px 8px;
    font-size: 0.6rem;
  }
  }

  /* Upload Progress Bar */
  .upload-progress-container {
  width: 100%;
  background-color: var(--light-gray);
  border-radius: 5px;
  margin: 1rem 0;
  display: none;
  overflow: hidden;
  height: 20px;
  border: 1px solid var(--neon-blue);
  position: relative;
  }

  .upload-progress-bar {
  width: 0%;
  height: 100%;
  background-color: var(--neon-blue);
  box-shadow: 0 0 10px var(--neon-blue);
  transition: width 0.1s linear;
  }

  .upload-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: bold;
  text-shadow: 0 0 5px var(--black);
  z-index: 1;
  }

/* Feed Edit Post Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  padding: 20px;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--gray, #222);
  margin: 0;
  padding: 18px 18px 16px;
  border: 1px solid var(--neon-blue, #66f0ff);
  border-radius: 10px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
}

.close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover {
  color: var(--white, #fff);
}

.modal-content h2 {
  margin: 0 0 14px;
  color: var(--neon-blue, #66f0ff);
}

.modal-content label {
  display: block;
  margin: 10px 0 6px;
  color: var(--white, #fff);
  font-weight: 600;
}

.modal-content textarea {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background-color: var(--light-gray, #333);
  color: var(--white, #fff);
  resize: vertical;
}

.modal-content textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--neon-blue, #66f0ff);
}

.file-input-name {
  margin-left: 8px;
  color: #aaa;
  font-weight: 400;
  font-size: 0.85rem;
}

.modal-content button {
  margin-top: 12px;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.modal-content button[type="submit"] {
  background-color: var(--neon-blue, #66f0ff);
  color: #000;
}

.modal-content .cancel-button {
  background-color: transparent;
  color: var(--white, #fff);
  border: 1px solid rgba(102, 240, 255, 0.35);
  margin-left: 10px;
}

.modal-content .cancel-button:hover {
  background-color: rgba(102, 240, 255, 0.12);
}
