/* ========================================
   CCTU SRC Community Hub - Main Stylesheet
   Responsive Social Feed Design
   ======================================== */

/* ===== Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  -webkit-tap-highlight-color: transparent;
  background: #f8f9ff;
}

/* ===== Hide Scrollbar Utility ===== */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ===== Top App Bar ===== */
.top-app-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #f8f9ff;
  border-bottom: 1px solid #c3c6d1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  height: 64px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #003366;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #c3c6d1;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #001e40;
}

.notif-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #001e40;
}

.notif-btn:hover {
  background: #e5eeff;
}

.notif-btn:active {
  transform: scale(0.95);
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 128px;
}

/* ===== Trending Tags Section ===== */
.trending-section {
  padding: 16px 0;
}

.tags-carousel {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 0 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tags-carousel::-webkit-scrollbar {
  display: none;
}

.tag {
  flex: none;
  padding: 8px 16px;
  background: #dce9ff;
  color: #43474f;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tag:hover {
  background: #d3e4fe;
  transform: translateY(-1px);
}

.tag.active {
  background: #003366;
  color: white;
}

.tag:active {
  transform: scale(0.95);
}

/* ===== Tab Switcher ===== */
.tab-section {
  padding: 0 16px;
  margin-bottom: 16px;
}

.tab-container {
  display: flex;
  background: #eff4ff;
  padding: 4px;
  border-radius: 8px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #43474f;
}

.tab-btn.active {
  background: white;
  color: #001e40;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-btn:active {
  transform: scale(0.97);
}

/* ===== Post Input Section ===== */
.post-input-section {
  padding: 0 16px;
  margin-bottom: 24px;
}

.post-card {
  background: white;
  border: 1px solid #c3c6d1;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.post-input-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.user-avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #dce9ff;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-textarea {
  flex: 1;
  background: transparent;
  border: none;
  resize: none;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  padding: 8px 0;
  height: 56px;
}

.post-textarea:focus {
  outline: none;
}

.post-textarea::placeholder {
  color: #737780;
}

.post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #c3c6d1;
}

.action-buttons {
  display: flex;
  gap: 16px;
}

.action-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #001e40;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.action-icon-btn:hover {
  background: #e5eeff;
}

.action-icon-btn:active {
  transform: scale(0.9);
}

.action-icon-btn .material-symbols-outlined {
  font-size: 20px;
}

.post-submit-btn {
  background: #fecb00;
  color: #001e40;
  padding: 6px 24px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-submit-btn:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.post-submit-btn:active {
  transform: scale(0.95);
}

/* ===== Feed Container ===== */
.feed-container {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== Post Card ===== */
.post-item {
  background: white;
  border: 1px solid #c3c6d1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.post-user-info {
  display: flex;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #dce9ff;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-details {
  flex: 1;
}

.user-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.user-name h3 {
  font-size: 14px;
  font-weight: 700;
  color: #001e40;
}

.verified-badge {
  color: #001e40;
  font-size: 14px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.post-time {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #43474f;
}

.post-category {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #745b00;
  background: #ffe08b;
  padding: 2px 8px;
  border-radius: 9999px;
}

.more-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #43474f;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s;
}

.more-btn:hover {
  background: #e5eeff;
}

.post-content {
  padding: 0 16px 12px 16px;
}

.post-text {
  font-size: 14px;
  line-height: 1.5;
  color: #0b1c30;
  margin-bottom: 12px;
}

.post-media {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #c3c6d1;
  margin-top: 8px;
}

.post-media img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-video {
  aspect-ratio: 16 / 9;
}

.post-stats {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #c3c6d1;
  font-size: 12px;
  color: #43474f;
}

.post-interactions {
  display: flex;
  gap: 24px;
  padding: 8px 16px;
  border-top: 1px solid #c3c6d1;
}

.interaction-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #43474f;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.15s ease;
  font-size: 12px;
  font-weight: 500;
}

.interaction-btn:hover {
  background: #e5eeff;
}

.interaction-btn:active {
  transform: scale(0.95);
}

.interaction-btn.liked {
  color: #ba1a1a;
}

.interaction-btn .material-symbols-outlined {
  font-size: 20px;
}

/* ===== Floating Action Button ===== */
.fab {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: #fecb00;
  color: #001e40;
  border: none;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 51, 102, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
  transition: all 0.2s ease;
}

.fab:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 28px rgba(0, 51, 102, 0.2);
}

.fab:active {
  transform: scale(0.95);
}

.fab .material-symbols-outlined {
  font-size: 28px;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 64px;
  padding: 0 16px;
  background: #f8f9ff;
  z-index: 50;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 12px rgba(0, 51, 102, 0.08);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
  color: #737780;
  padding: 8px 12px;
  border-radius: 8px;
}

.nav-item.active {
  color: #001e40;
  font-weight: 700;
}

.nav-item.active::after {
  content: '';
  width: 4px;
  height: 4px;
  background: #f1c100;
  border-radius: 50%;
  margin-top: 4px;
}

.nav-item:hover {
  background: #e5eeff;
  transform: translateY(-2px);
}

.nav-item:active {
  transform: scale(0.95);
}

.nav-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.nav-item .material-symbols-outlined {
  font-size: 24px;
}

.nav-item .material-symbols-outlined.filled {
  font-variation-settings: 'FILL' 1;
}

/* ===== Toast Notification ===== */
.custom-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #001e40;
  color: white;
  padding: 12px 20px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
  white-space: nowrap;
  max-width: 90%;
  white-space: normal;
  text-align: center;
  font-family: 'Inter', sans-serif;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 480px) {
  .post-interactions {
    gap: 12px;
  }
  
  .interaction-btn {
    padding: 6px 8px;
  }
  
  .fab {
    right: 16px;
    bottom: 88px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  
  .fab .material-symbols-outlined {
    font-size: 24px;
  }
  
  .post-submit-btn {
    padding: 6px 18px;
  }
}

@media (min-width: 768px) {
  .feed-container {
    max-width: 700px;
    margin: 0 auto;
  }
  
  .post-input-section {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .trending-section {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .tab-section {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }
}