:root {
  --primary: #2e86ab;
  --secondary: #f18f01;
  --dark: #333;
  --light: #f9f9f9;
  --success: #5cb85c;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--light);
}

header {
  background: linear-gradient(135deg, var(--primary), #1b5299);
  color: white;
  text-align: center;
  padding: 3rem 1rem;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  border-bottom: 2px solid var(--secondary);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

section {
  margin-bottom: 3rem;
}

/* Search and Filters */
.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #777;
}

select,
.filter-btn,
.load-more-btn {
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  font-size: 1rem;
  cursor: pointer;
}

.filter-btn,
.load-more-btn {
  background: var(--primary);
  color: white;
  border: none;
  transition: all 0.3s;
}

.filter-btn:hover,
.load-more-btn:hover {
  background: #1b5299;
}

/* Grid Layout */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-img {
  height: 180px;
  background-size: cover;
  background-position: center;
}

.card-content {
  padding: 1.5rem;
}

.card-location {
  display: flex;
  align-items: center;
  color: #777;
  margin-bottom: 0.5rem;
}

.card-location i {
  margin-right: 0.5rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tag {
  background: #f0f0f0;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
}

.tag.wifi {
  background: #e3f2fd;
  color: #1565c0;
}
.tag.coworking {
  background: #e8f5e9;
  color: #2e7d32;
}
.tag.event {
  background: #fff3e0;
  color: #e65100;
}
.tag.hackathon {
  background: #fce4ec;
  color: #ad1457;
}
.tag.cafe {
  background: #efebe9;
  color: #5d4037;
}
.tag.coliving {
  background: #e0f7fa;
  color: #00838f;
}

/* Detail View */
.detail-view {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  overflow-y: auto;
  padding: 2rem;
}

.detail-content {
  max-width: 800px;
  margin: 2rem auto;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.detail-header {
  height: 300px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.detail-header-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 2rem;
}

.detail-body {
  padding: 2rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-item i {
  color: var(--primary);
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Newsletter Form */
#newsletter {
  background: var(--primary);
  color: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
}

#newsletter h2 {
  color: white;
  border-bottom: 2px solid var(--secondary);
}

#signup-form {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
}

#signup-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 4px 0 0 4px;
  font-size: 1rem;
}

#signup-form button {
  padding: 0.75rem 1.5rem;
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

#signup-form button:hover {
  background: #e67e00;
}

.success-message {
  display: none;
  background: var(--success);
  color: white;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
}

.error-message {
  display: none;
  background: #ff6b6b;
  color: white;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--primary);
  color: white;
  margin-top: 3rem;
}

.load-more-container {
  text-align: center;
  margin-top: 2rem;
}
/* Voting buttons */
.vote-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-left: 1rem;
}

.vote-btn {
  background: #f0f0f0;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}

.vote-btn:hover {
  background: #e0e0e0;
}

.vote-btn.upvote.active {
  background: #e8f5e9;
  color: #2e7d32;
}

.vote-btn.downvote.active {
  background: #ffebee;
  color: #c62828;
}

/* Bookmark button */
.bookmark-btn {
  position: absolute;
  top: 0.1rem;
  right: 0.2rem;
  margin-left: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.bookmark-btn:hover {
  background: white;
}

.bookmark-btn.active {
  color: var(--secondary);
}

/* Comment section */
.comments-section {
  margin-top: 2rem;
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

.comment-form {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.comment-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.comment-list {
  margin-top: 1rem;
}

.comment {
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #666;
}

/* Save for later feature */
.save-for-later {
  position: fixed;
  bottom: 2rem;
  right: -1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

.save-for-later .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--secondary);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 768px) {
  .search-filters {
    flex-direction: column;
  }

  #signup-form {
    flex-direction: column;
  }

  #signup-form input {
    border-radius: 4px;
    margin-bottom: 0.5rem;
  }

  #signup-form button {
    border-radius: 4px;
    width: 100%;
  }

  .detail-header {
    height: 200px;
  }

  .detail-view {
    padding: 1rem;
  }
}
