/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2d6a4f;
  --primary-light: #40916c;
  --primary-dark: #1b4332;
  --accent: #52b788;
  --accent-light: #74c69d;
  --bg: #f0f4f0;
  --bg-card: #ffffff;
  --text: #1b1b1b;
  --text-light: #555;
  --text-muted: #888;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(.4,0,.2,1);
  --font: 'Outfit', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== NAV ===== */
nav {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: #fff;
}

.nav-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-light);
  box-shadow: 0 0 12px rgba(82,183,136,0.4);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.nav-logo:hover {
  transform: scale(1.1) rotate(5deg);
}

nav h1 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

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

.nav-buttons a {
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.admin-button {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.admin-button:hover {
  background: rgba(255,255,255,0.25);
}

.profile-button {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.profile-button:hover {
  background: rgba(255,255,255,0.25);
}

.login-button {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.login-button:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  transform: translateY(-1px);
}

.logout-button {
  background: rgba(255,80,80,0.15);
  color: #ffaaaa;
  border: 1px solid rgba(255,80,80,0.3);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.logout-button:hover {
  background: rgba(255,80,80,0.3);
}

.view-site {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.view-site:hover {
  background: rgba(255,255,255,0.25);
}

/* ===== HERO ===== */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 48px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(30px, 20px); }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-content h2 {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero-content p {
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
  font-weight: 300;
}

/* ===== FEED ===== */
.feed-container {
  max-width: 640px;
  margin: 32px auto;
  padding: 0 16px;
}

/* ===== POST CARD ===== */
.post {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeInUp 0.5s ease both;
}

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

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

.post-header {
  padding: 18px 20px 10px;
}

.post-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary-dark);
}

/* ===== GALLERY ===== */
.gallery-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #e8e8e8;
}

.gallery-images {
  width: 100%;
  height: 100%;
  position: relative;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.gallery-image.active {
  opacity: 1;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  padding: 0 10px;
  pointer-events: none;
}

.gallery-btn {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  pointer-events: all;
  transition: all var(--transition);
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.gallery-btn:hover {
  background: #fff;
  transform: scale(1.1);
}

.gallery-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all var(--transition);
}

.gallery-dot.active {
  background: #fff;
  transform: scale(1.3);
  box-shadow: 0 0 6px rgba(255,255,255,0.6);
}

/* ===== POST DESCRIPTION ===== */
.post-description {
  padding: 16px 20px 8px;
}

.post-description p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ===== POST ACTIONS ===== */
.post-actions {
  display: flex;
  gap: 6px;
  padding: 8px 16px 16px;
}

.action-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font);
}

.action-btn:hover {
  background: var(--bg);
  color: var(--primary);
}

.action-btn.active {
  color: #e74c3c;
}

.like-btn.active i {
  animation: heartPop 0.4s ease;
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.save-btn.active {
  color: var(--accent);
}

/* ===== COMMENTS ===== */
.comments-section {
  background: var(--bg);
  padding: 16px 20px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.comments-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.comment {
  background: var(--bg-card);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.88rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.comment strong {
  color: var(--primary);
}

.delete-comment-btn {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 0.78rem;
  margin-left: 8px;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.delete-comment-btn:hover {
  opacity: 1;
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.comment-form input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid rgba(0,0,0,0.08);
  border-radius: 50px;
  font-size: 0.88rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}

.comment-form input:focus {
  border-color: var(--accent);
}

.comment-form button {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}

.comment-form button:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

/* ===== AUTH / LOGIN PAGE ===== */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 170px);
  padding: 40px 16px;
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 440px;
  padding: 40px 32px;
  animation: fadeInUp 0.5s ease both;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-light);
  box-shadow: 0 0 20px rgba(82,183,136,0.3);
  margin-bottom: 16px;
}

.auth-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

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

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 50px;
  padding: 4px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(45,106,79,0.3);
}

.tab-btn:hover:not(.active) {
  color: var(--primary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form.hidden {
  display: none;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group label i {
  color: var(--accent);
  font-size: 0.8rem;
}

.form-group input {
  padding: 12px 16px;
  border: 2px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--bg);
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(82,183,136,0.15);
  background: #fff;
}

.auth-button {
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.auth-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45,106,79,0.35);
}

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

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.1);
}

/* ===== PROFILE PAGE ===== */
.profile-container {
  max-width: 700px;
  margin: 32px auto;
  padding: 0 16px;
}

.profile-section,
.saved-posts-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 28px;
  animation: fadeInUp 0.5s ease both;
}

.saved-posts-section {
  animation-delay: 0.1s;
}

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

.section-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 4px 14px rgba(82,183,136,0.3);
}

.section-icon i {
  color: #fff;
  font-size: 1.4rem;
}

.section-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.saved-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 40px;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
  nav h1 {
    font-size: 1.15rem;
  }

  .nav-logo {
    width: 38px;
    height: 38px;
  }

  .nav-buttons a {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .nav-buttons a i {
    display: none;
  }

  .hero-content h2 {
    font-size: 1.4rem;
  }

  .hero-content p {
    font-size: 0.95rem;
  }

  .feed-container {
    margin: 20px auto;
  }

  .auth-card {
    padding: 28px 20px;
  }

  .profile-section,
  .saved-posts-section {
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .nav-container {
    flex-direction: column;
    height: auto;
    padding: 12px 0;
    gap: 10px;
  }

  .nav-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .saved-posts-grid {
    grid-template-columns: 1fr 1fr;
  }
}
