/* ===== OFFROAD FORUM - Стили ===== */
:root {
  --primary: #2d5a27;
  --primary-light: #3d7a37;
  --accent: #e67e22;
  --accent-hover: #d35400;
  --dark: #121212;
  --darker: #0a0a0a;
  --card: #1e1e1e;
  --card-hover: #252525;
  --text: #e8e8e8;
  --text-muted: #a0a0a0;
  --border: #333;
  --success: #27ae60;
  --danger: #c0392b;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --radius: 12px;
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', 'Segoe UI', system-ui, sans-serif;
  background: var(--darker);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Анимации ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fade-up {
  animation: fadeInUp 0.7s ease-out forwards;
}

.animate-fade {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }
.delay-5 { animation-delay: 0.5s; opacity: 0; }

/* ===== Header / Nav ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.header.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.5px;
  transition: var(--transition);
}

.logo:hover {
  color: var(--accent);
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  animation: float 3s ease-in-out infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(45, 90, 39, 0.3);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-auth {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 15px rgba(45, 90, 39, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 90, 39, 0.5);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 126, 34, 0.5);
}

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

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

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0d1f0c 0%, #1a2e18 40%, #2a1f0a 100%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1533473359331-0135ef1b58bf?w=1600&q=80') center/cover no-repeat;
  opacity: 0.25;
  animation: gradientShift 20s ease infinite;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(10,10,10,0.9) 0%, rgba(10,10,10,0.5) 60%, transparent 100%);
}

.hero-content {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 24px;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(230, 126, 34, 0.2);
  border: 1px solid rgba(230, 126, 34, 0.4);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease-out;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  max-width: 650px;
  animation: fadeInUp 0.7s ease-out 0.1s both;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--accent), #f39c12);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 32px;
  animation: fadeInUp 0.7s ease-out 0.2s both;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  animation: fadeInUp 0.7s ease-out 0.3s both;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 50px;
  animation: fadeInUp 0.7s ease-out 0.4s both;
}

.stat-item {
  text-align: left;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Sections ===== */
.section {
  padding: 70px 0;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.section-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 20px auto 0;
}

/* ===== Cards ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.card:hover {
  transform: translateY(-6px);
  background: var(--card-hover);
  box-shadow: var(--shadow);
  border-color: rgba(230, 126, 34, 0.3);
}

.card:hover::before {
  transform: scaleX(1);
}

.card-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(45,90,39,0.3), rgba(230,126,34,0.2));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 18px;
  transition: var(--transition);
}

.card:hover .card-icon {
  transform: scale(1.1) rotate(-5deg);
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-meta i {
  margin-right: 4px;
  color: var(--accent);
}

/* ===== Forum Categories ===== */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.category-item:hover {
  background: var(--card-hover);
  border-color: rgba(45, 90, 39, 0.5);
  transform: translateX(6px);
  box-shadow: var(--shadow);
}

.category-icon {
  width: 64px;
  height: 64px;
  min-width: 64px;
  background: linear-gradient(135deg, var(--primary), #1a3a16);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  transition: var(--transition);
}

.category-item:hover .category-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  transform: scale(1.08);
}

.category-info {
  flex: 1;
}

.category-info h3 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

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

.category-stats {
  text-align: right;
  min-width: 100px;
}

.category-stats .num {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}

.category-stats .label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Topics ===== */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topic-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.topic-item:hover {
  background: var(--card-hover);
  border-color: rgba(230, 126, 34, 0.3);
}

.topic-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
}

.topic-content {
  flex: 1;
  min-width: 0;
}

.topic-content h4 {
  font-size: 1.05rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-content .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.topic-stats {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.topic-stats span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ===== Forms ===== */
.form-section {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(45,90,39,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(230,126,34,0.1) 0%, transparent 40%),
    var(--darker);
}

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.6s ease-out;
}

.form-card h2 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 1.8rem;
}

.form-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 30px;
  font-size: 0.95rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group label i {
  margin-right: 6px;
  color: var(--accent);
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.25);
}

.form-control::placeholder {
  color: #666;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.form-footer a:hover {
  text-decoration: underline;
}

.alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

.alert-success {
  background: rgba(39, 174, 96, 0.15);
  border: 1px solid rgba(39, 174, 96, 0.4);
  color: #2ecc71;
}

.alert-error {
  background: rgba(192, 57, 43, 0.15);
  border: 1px solid rgba(192, 57, 43, 0.4);
  color: #e74c3c;
}

.alert.show {
  display: block;
}

/* ===== Features / About ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.feature-item {
  text-align: center;
  padding: 30px 20px;
}

.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, rgba(45,90,39,0.25), rgba(230,126,34,0.15));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  transition: var(--transition);
}

.feature-item:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
  background: linear-gradient(135deg, rgba(45,90,39,0.4), rgba(230,126,34,0.3));
}

.feature-item h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.feature-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== Gallery ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/10;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay span {
  font-weight: 600;
  font-size: 1.05rem;
}

/* ===== Footer ===== */
.footer {
  background: var(--dark);
  border-top: 1px solid var(--border);
  padding: 50px 0 30px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 14px;
  font-size: 0.95rem;
  max-width: 300px;
}

.footer h4 {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 10px;
}

.footer ul a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.95rem;
}

.footer ul a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  font-size: 1.1rem;
}

.social-links a:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-3px);
}

/* ===== User badge ===== */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--card);
  border-radius: 50px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.user-badge:hover {
  border-color: var(--accent);
}

.user-badge .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .nav-links {
    display: none;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--dark);
    padding: 20px;
    border-bottom: 1px solid var(--border);
    gap: 4px;
  }
  
  .hero-stats {
    gap: 24px;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-buttons {
    flex-direction: column;
  }
  
  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }
  
  .category-item {
    flex-wrap: wrap;
  }
  
  .category-stats {
    width: 100%;
    text-align: left;
    display: flex;
    gap: 20px;
  }
  
  .form-card {
    padding: 28px 20px;
  }
  
  .topic-stats {
    display: none;
  }
}

/* ===== Page specific ===== */
.page-title {
  padding: 40px 0 20px;
  text-align: center;
}

.page-title h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.page-title p {
  color: var(--text-muted);
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Topic view */
.topic-header {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

.topic-header h1 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.post {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.post:hover {
  border-color: rgba(45,90,39,0.4);
}

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

.post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
}

.post-meta .author {
  font-weight: 600;
}

.post-meta .date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-body {
  line-height: 1.7;
  color: var(--text);
}

.post-actions {
  margin-top: 16px;
  display: flex;
  gap: 16px;
}

.post-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  font-family: inherit;
}

.post-actions button:hover {
  color: var(--accent);
}

/* Reply form */
.reply-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}

.reply-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  margin-bottom: 16px;
}

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

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

/* Toast notification */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  padding: 16px 24px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 360px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  border-left-color: var(--danger);
}
