/*
  Community Module Styles
  עיצוב מודול הקהילה - תואם לעיצוב פרימיום של TAKE OFF
*/

:root {
  /* Color System - matching main site */
  --bg: #F9F7F5;
  --bg-light: #FFFDF8;
  --surface: #FFFDF8;
  --surface-alt: #F7F3EA;
  --border: rgba(15, 40, 69, 0.08);
  --text: #0F0F0F;
  --text-secondary: #4A4A4A;
  --text-muted: #7A7A7A;

  --gold: #D4A93B;
  --gold-dark: #B8922D;
  --brand: #0F2845;
  --brand-light: #1F3A52;

  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;

  --radius: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Assistant', sans-serif;
  background: var(--bg);
  color: var(--text-secondary);
  direction: rtl;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Suez One', serif;
  color: var(--text);
  font-weight: 400;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Community Container */
.community-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.community-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 8px rgba(15, 40, 69, 0.04);
}

.community-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.community-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
}

.community-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
}

.community-logo a:hover {
  opacity: 0.8;
}

.community-nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

.community-nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s;
}

.community-nav a:hover {
  color: var(--brand);
}

.community-auth-section {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  letter-spacing: 0.02em;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

.btn.primary:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  box-shadow: 0 8px 20px rgba(212, 169, 59, 0.28);
}

.btn.secondary {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}

.btn.secondary:hover {
  background: var(--surface);
  border-color: var(--text-muted);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn.ghost:hover {
  background: var(--surface-alt);
  border-color: var(--brand);
  color: var(--brand);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* Main Layout */
.community-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 32px;
  padding: 40px 0;
  min-height: calc(100vh - 100px);
}

/* Sidebar - Left */
.community-sidebar-left {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.sidebar-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.sidebar-section h3 {
  font-size: 15px;
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
}

.sidebar-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-section li {
  margin-bottom: 12px;
}

.sidebar-section a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.3s;
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
}

.sidebar-section a:hover {
  background: var(--bg-light);
  color: var(--brand);
}

/* Main Feed */
.community-feed {
  display: grid;
  gap: 24px;
}

.feed-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feed-item:hover {
  border-color: var(--gold);
  box-shadow: 0 12px 32px rgba(15, 40, 69, 0.1);
  transform: translateY(-2px);
}

.feed-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--brand));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.feed-author {
  flex: 1;
}

.author-name {
  font-weight: 700;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 4px;
}

.author-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.feed-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
}

.feed-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.feed-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tag {
  display: inline-block;
  background: var(--bg-light);
  border: 1px solid var(--gold);
  color: var(--brand);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feed-actions {
  display: flex;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.feed-action {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
}

.feed-action:hover {
  color: var(--gold);
}

.feed-action svg {
  width: 18px;
  height: 18px;
}

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

.comment {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--brand));
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
}

.comment-author {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.comment-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.comment-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Right Sidebar */
.community-sidebar-right {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.online-users {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.online-users h3 {
  font-size: 14px;
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
}

.online-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 14px;
}

.online-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-light);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(212, 169, 59, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* Modals & Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 40, 69, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 24px 56px rgba(15, 40, 69, 0.25);
}

.modal h2 {
  margin: 0 0 24px;
  font-size: 24px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.3s;
}

.modal-close:hover {
  color: var(--text);
}

/* Loading State */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
  .community-layout {
    grid-template-columns: 1fr 300px;
  }

  .community-sidebar-left {
    display: none;
  }
}

@media (max-width: 768px) {
  .community-layout {
    grid-template-columns: 1fr;
  }

  .community-sidebar-right {
    display: none;
  }

  .community-header-content {
    flex-direction: column;
    align-items: stretch;
  }

  .community-nav {
    flex-wrap: wrap;
    gap: 16px;
  }

  .modal {
    max-width: 90%;
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .community-container {
    padding: 0 16px;
  }

  .feed-item {
    padding: 16px;
  }

  .feed-actions {
    gap: 16px;
  }
}
