@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #e0e7ff;
  --secondary: #ec4899;
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: rgba(203, 213, 225, 0.6);
  --glass-blur: blur(16px);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, hsla(253,16%,7%,0.05) 0, transparent 50%), 
    radial-gradient(at 100% 0%, hsla(225,39%,30%,0.05) 0, transparent 50%), 
    radial-gradient(at 50% 100%, hsla(339,49%,30%,0.05) 0, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.5rem 0;
  position: relative;
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--primary);
  transition: var(--transition);
  border-radius: 4px;
}

.nav-links a.active::after, .nav-links a:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(99, 102, 241, 0.35);
}

.btn-icon {
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.container {
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  gap: 2rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: sticky;
  top: 6rem;
}

.board-card {
  background: var(--surface-solid);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.board-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.board-card.active {
  border-left: 4px solid var(--primary);
  background: linear-gradient(to right, var(--primary-light), var(--surface-solid));
}

.board-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.board-info h3 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
  color: var(--text-main);
}

.board-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

#posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.post-card {
  background: var(--surface-solid);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.post-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.8rem;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  transition: var(--transition);
  height: 3.3rem; /* Fixed height for title to align cards */
}

.post-card:hover .post-title {
  color: var(--primary);
}

.post-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-action {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  background: var(--bg);
}

.post-action:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.post-action i {
  font-size: 1.1rem;
}

.post-composer {
  background: var(--surface-solid);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  display: flex;
  gap: 1.25rem;
  position: relative;
}

.post-composer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #cbd5e1;
  border: 2px solid var(--surface-solid);
  box-shadow: var(--shadow-sm);
}

.composer-input {
  flex: 1;
}

.composer-input textarea {
  width: 100%;
  border: none;
  resize: none;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5rem 0;
  outline: none;
  background: transparent;
  color: var(--text-main);
}

.composer-input textarea::placeholder {
  color: var(--text-muted);
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.action-icons {
  display: flex;
  gap: 0.5rem;
  color: var(--text-muted);
}

.post-card {
  background: var(--surface-solid);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.post-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.post-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.user-info {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.user-meta h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-meta span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.board-tag {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.35rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--primary);
}

.post-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  display: inline-block;
}

.post-title:hover {
  color: var(--primary);
}

.post-content {
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.post-actions {
  display: flex;
  gap: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.post-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  background: transparent;
}

.post-action:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.post-action i {
  font-size: 1.2rem;
}

.right-aside {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 6rem;
}

.widget {
  background: var(--surface-solid);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.widget::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 3px;
  background: var(--primary-light);
}

.widget-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.widget-list {
  list-style: none;
}

.widget-list li {
  margin-bottom: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.4;
}

.widget-list li:last-child {
  margin-bottom: 0;
}

.widget-list a {
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.widget-list a:hover {
  color: var(--primary);
}

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

.animate-fade-in {
  opacity: 0;
  animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@media (max-width: 1024px) {
  .container {
    grid-template-columns: 220px 1fr;
  }
  .right-aside { display: none; }
}

@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    margin-top: 1.5rem;
  }
  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    position: static;
  }
  .board-card {
    min-width: 180px;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* --- Premium Modal (Auth) --- */
.modal {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.5) !important;
}
.modal-content {
  background: #ffffff !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.95) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.input-premium {
  background: #f8fafc;
  transition: all 0.2s;
}
.input-premium:focus {
  background: #fff;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

/* --- Avatar & Dropdown Menu --- */
.avatar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 150px;
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transform-origin: top right;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}
.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.dropdown-item {
  padding: 0.6rem 0.8rem;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  cursor: pointer;
}
.dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.dropdown-item.danger {
  color: #ef4444;
}
.dropdown-item.danger:hover {
  background: #fef2f2;
}

/* --- Social Interaction Feedbacks --- */
.liked {
  color: var(--secondary) !important;
  animation: heartBeat 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.liked i {
  color: var(--secondary) !important;
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
