/* /var/www/amisphereV3/actus-web/css/style.css */

:root {
  --primary: #4CAF50;
  --primary-light: #81C784;
  --primary-dark: #2E7D32;
  --secondary: #FF9800;
  --background: #f5f5f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-light: #666666;
  --text-lighter: #999999;
  --border: #e0e0e0;
  --error: #f44336;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 300px;
  --header-height: 60px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar.open {
  left: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.logo {
  font-size: 28px;
  margin-right: 10px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
}

.close-btn {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 28px;
  color: white;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.close-btn:hover {
  opacity: 1;
}

.sidebar-section {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-text {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 20px;
  background: var(--background);
  text-align: center;
}

.sidebar-footer p {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.sidebar-links {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.sidebar-links a {
  font-size: 12px;
  color: var(--text-lighter);
  text-decoration: none;
}

.sidebar-links a:hover {
  color: var(--primary);
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* ========================================
   CATEGORIES
   ======================================== */

.categories-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
  border: 2px solid transparent;
}

.category-item:hover {
  background: var(--background);
}

.category-item.active {
  background: var(--primary-light);
  background: rgba(76, 175, 80, 0.15);
  border-color: var(--primary);
}

.category-icon {
  font-size: 18px;
  margin-right: 10px;
}

.category-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.category-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.category-item.active .category-check {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ========================================
   AUTH
   ======================================== */

.user-card {
  display: flex;
  align-items: center;
  padding: 12px;
  background: var(--background);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 12px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
}

.user-email {
  font-size: 12px;
  color: var(--text-light);
}

.message {
  font-size: 13px;
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
}

.message.success {
  background: #E8F5E9;
  color: var(--primary-dark);
}

.message.error {
  background: #FFEBEE;
  color: var(--error);
}

/* ========================================
   HEADER
   ======================================== */

.header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s;
}

.header-title {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  margin-left: 10px;
  color: var(--primary-dark);
}

.logo-small {
  font-size: 24px;
  margin-right: 8px;
}

.header-actions {
  margin-left: auto;
}

/* ========================================
   MAIN
   ======================================== */

.main {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* Active filters */
.active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.filter-label {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(76, 175, 80, 0.15);
  border-radius: 20px;
  font-size: 13px;
  color: var(--primary-dark);
}

.filter-tag-remove {
  cursor: pointer;
  opacity: 0.7;
}

.filter-tag-remove:hover {
  opacity: 1;
}

/* ========================================
   POSTS
   ======================================== */

.posts-container {
  padding: 16px;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.post-card:hover {
  box-shadow: var(--shadow-lg);
}

.post-header {
  display: flex;
  align-items: center;
  padding: 16px;
}

.post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  margin-right: 12px;
}

.post-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.post-meta {
  flex: 1;
}

.post-author {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.post-group {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}

.post-group:hover {
  text-decoration: underline;
}

.post-date {
  font-size: 12px;
  color: var(--text-lighter);
  margin-left: auto;
}

.post-content {
  padding: 0 16px 16px;
}

.post-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.post-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  margin-top: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}

.post-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.post-actions {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  gap: 20px;
}

.post-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-light);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

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

.post-action.seeded {
  color: var(--primary);
  background: rgba(76, 175, 80, 0.1);
}

.post-action .seed-icon {
  font-size: 18px;
}

.post-action .count {
  font-weight: 600;
}

.share-btn {
  margin-left: auto;
}

/* Share dropdown */
.share-dropdown {
  position: relative;
}

.share-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  min-width: 180px;
  display: none;
  z-index: 10;
}

.share-dropdown.open .share-menu {
  display: block;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s;
}

.share-option:hover {
  background: var(--background);
}

/* ========================================
   LOADING & EMPTY
   ======================================== */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
  color: var(--text-light);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

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

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 16px;
  color: var(--text-light);
}

.empty-subtitle {
  font-size: 14px !important;
  color: var(--text-lighter) !important;
  margin-top: 8px;
}

.load-more {
  display: block;
  width: 100%;
  margin-top: 20px;
}

/* ========================================
   MODAL
   ======================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--background);
  border: none;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  z-index: 10;
}

.modal-close:hover {
  background: var(--border);
}

/* Comments section in modal */
.comments-section {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.comments-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.comment-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.comment-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  resize: none;
}

.comment-input:focus {
  outline: none;
  border-color: var(--primary);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  display: flex;
  gap: 12px;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
}

.comment-author {
  font-weight: 600;
  font-size: 14px;
}

.comment-date {
  font-size: 12px;
  color: var(--text-lighter);
  margin-left: 8px;
}

.comment-text {
  font-size: 14px;
  margin-top: 4px;
  color: var(--text);
}

/* ========================================
   TOAST
   ======================================== */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 3000;
  animation: slideUp 0.3s ease;
}

.toast.hidden {
  display: none;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ========================================
   BUTTONS & INPUTS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  width: 100%;
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
  width: auto;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #F57C00;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
}

.hidden {
  display: none !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (min-width: 768px) {
  .sidebar {
    left: 0;
    box-shadow: none;
    border-right: 1px solid var(--border);
  }
  
  .close-btn {
    display: none;
  }
  
  .overlay {
    display: none !important;
  }
  
  .main {
    margin-left: var(--sidebar-width);
    max-width: calc(100% - var(--sidebar-width));
    padding: 0 20px 40px;
  }
  
  .menu-btn {
    display: none;
  }
  
  .header {
    padding-left: 20px;
  }
  
  .header-title {
    margin-left: 0;
  }
  
  .posts-container {
    padding: 20px 0;
  }
}

@media (min-width: 1024px) {
  .main {
    max-width: 700px;
    margin-left: calc((100% - 700px) / 2 + var(--sidebar-width) / 2);
  }
}
