* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: sans-serif; background: #f5f5f5; color: #222; }

nav {
  background: #1a535c; color: white; padding: 12px 24px;
  display: flex; align-items: center; flex-wrap: wrap;
}
.logo { color: white; font-weight: bold; font-size: 1.1rem; text-decoration: none; }
nav a { color: #ccc; text-decoration: none; font-size: 0.9rem; }
nav a:hover { color: white; }
#navLinks { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-left: auto; }

.page { display: none; }
.page.active { display: block; }

.hero { background: #1a535c; color: white; padding: 40px 24px; text-align: center; }
.hero h1 { font-size: 2rem; margin-bottom: 8px; }
.hero p { color: #acd8dd; margin-bottom: 16px; }
.search-input {
  padding: 10px 16px; width: 100%; max-width: 480px; border: none;
  border-radius: 6px; font-size: 0.95rem; outline: none;
}

.container { max-width: 1000px; margin: 0 auto; padding: 24px; }
.form-page { max-width: 420px; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar select { padding: 6px 10px; border: 1px solid #ccc; border-radius: 6px; }
.result-count { font-size: 0.85rem; color: #888; }

h2 { margin-bottom: 16px; }
h3 { margin-bottom: 8px; }
form { display: flex; flex-direction: column; gap: 10px; }
input, select, textarea {
  padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px;
  font-size: 0.93rem; font-family: sans-serif; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: #1a535c; outline: none; }
button { padding: 10px 18px; background: #1a535c; border: none; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
button:hover { background: #0f3840; }
p { margin-top: 12px; font-size: 0.88rem; color: #555; }
p a { color: #1a535c; }

/* GRID */
#siteGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.site-card { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); cursor: pointer; transition: transform 0.15s; }
.site-card:hover { transform: translateY(-3px); }
.site-img { height: 160px; object-fit: cover; width: 100%; display: block; }
.site-img-placeholder { height: 160px; background: #e0e0e0; display: flex; align-items: center; justify-content: center; color: #999; font-size: 2rem; }
.site-body { padding: 14px; }

/* PAGINATION */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.page-btn { padding: 6px 14px; background: white; border: 1px solid #ccc; border-radius: 6px; cursor: pointer; font-size: 0.88rem; }
.page-btn:hover { background: #e0e0e0; }
.page-btn.active { background: #1a535c; color: white; border-color: #1a535c; }

/* DETAIL */
.detail-img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 8px; margin-bottom: 16px; }
.detail-img-placeholder { width: 100%; height: 200px; background: #e0e0e0; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 3rem; margin-bottom: 16px; }
.detail-name { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.detail-by { font-size: 0.8rem; color: #999; margin-bottom: 12px; }
.detail-desc { color: #444; line-height: 1.6; margin-bottom: 16px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }

/* BADGES */
.site-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; margin-bottom: 8px; }
.badge-AAA { background: #d4f5e2; color: #1a7a4a; }
.badge-AA  { background: #d4eaff; color: #1a4a7a; }
.badge-A   { background: #fff4cc; color: #7a5c00; }
.badge-fail{ background: #fde8e8; color: #c0392b; }

.site-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.site-desc { font-size: 0.85rem; color: #555; line-height: 1.5; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.site-by   { font-size: 0.75rem; color: #999; margin-bottom: 10px; }
.site-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.vote-btn { background: #f0f0f0; color: #555; border: 1px solid #ddd; padding: 4px 12px; font-size: 0.82rem; border-radius: 6px; }
.vote-btn.voted-up   { background: #d4f5e2; color: #27ae60; border-color: #27ae60; }
.vote-btn.voted-down { background: #fde8e8; color: #e74c3c; border-color: #e74c3c; }
.visit-btn { background: #1a535c; color: white; padding: 4px 12px; font-size: 0.82rem; border-radius: 6px; text-decoration: none; }
.del-btn { background: #e74c3c; color: white; padding: 4px 12px; font-size: 0.82rem; border-radius: 6px; border: none; cursor: pointer; }
.del-btn:hover { background: #c0392b; }
.report-btn { background: none; color: #aaa; border: 1px solid #ddd; padding: 4px 10px; font-size: 0.82rem; border-radius: 6px; cursor: pointer; }
.report-btn:hover { background: #fff4e0; color: #e67e22; border-color: #e67e22; }

/* COMMENTS */
.comment-card { background: white; border: 1px solid #e0e0e0; border-radius: 8px; padding: 14px; margin-bottom: 10px; }
.comment-name { font-weight: 600; font-size: 0.88rem; }
.comment-date { font-size: 0.75rem; color: #999; margin-bottom: 6px; }
.comment-text { font-size: 0.9rem; color: #444; line-height: 1.5; margin-bottom: 8px; }
.comment-img { max-width: 100%; max-height: 300px; border-radius: 6px; margin-bottom: 10px; display: block; }
.comment-actions { display: flex; gap: 8px; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
details { background: white; border: 1px solid #ddd; border-radius: 6px; padding: 12px 16px; }
summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
details p { margin-top: 8px; color: #555; }

/* ADMIN PANEL */
.report-card {
  background: white; border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 16px; margin-bottom: 12px;
}
.report-card .report-meta { font-size: 0.78rem; color: #999; margin-bottom: 6px; }
.report-card .report-type { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; margin-bottom: 8px; }
.report-type-site    { background: #d4eaff; color: #1a4a7a; }
.report-type-comment { background: #fff4cc; color: #7a5c00; }
.report-card .report-content { font-size: 0.88rem; color: #444; border-left: 3px solid #ddd; padding-left: 10px; margin-bottom: 10px; }
.report-card .report-actions { display: flex; gap: 8px; }
.report-resolve-btn { background: #27ae60; color: white; padding: 4px 14px; font-size: 0.82rem; border-radius: 6px; border: none; cursor: pointer; }
.report-resolve-btn:hover { background: #1e8449; }

#toast { position: fixed; bottom: 20px; right: 20px; background: #333; color: white; padding: 10px 18px; border-radius: 6px; font-size: 0.88rem; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
#toast.show { opacity: 1; }
#toast.success { background: #27ae60; }
#toast.error   { background: #e74c3c; }
.empty { text-align: center; padding: 40px; color: #888; }

@media (max-width: 600px) {
  .detail-name { font-size: 1.2rem; }
  #siteGrid { grid-template-columns: 1fr; }
}