/* ============================================
   RS Webinfo - Main Stylesheet
   Brand Colors: #e63946 (Red), #1d3557 (Navy), #f1faee (Light), #a8dadc (Teal)
   ============================================ */

:root {
  --red: #e63946;
  --red-dark: #b5202d;
  --navy: #1d3557;
  --navy-light: #264a7a;
  --teal: #a8dadc;
  --cream: #f1faee;
  --gold: #f4a261;
  --text: #1a1a2e;
  --text-muted: #6c757d;
  --border: #e5e7ef;
  --card-bg: #ffffff;
  --bg: #f6f8fc;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(29,53,87,0.09);
  --shadow-hover: 0 10px 40px rgba(29,53,87,0.16);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Roboto', sans-serif; font-weight: 700; }
a { text-decoration: none; color: var(--red); transition: var(--transition); }
a:hover { color: var(--red-dark); }
img { max-width: 100%; }

/* ---- Topbar ---- */
.topbar {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  font-size: 12.5px;
  padding: 7px 0;
}
.topbar a { color: rgba(255,255,255,0.75); }
.topbar a:hover { color: #fff; }
.badge-total {
  background: var(--red);
  color: #fff;
  padding: 2px 10px;
  border-radius: 30px;
  font-size: 11.5px;
  font-weight: 600;
}

/* ---- Navbar ---- */
.main-nav {
  background: #fff;
  border-bottom: 2px solid var(--red);
  padding: 10px 0;
  box-shadow: 0 2px 16px rgba(29,53,87,0.08);
  z-index: 999;
}
.navbar-brand { display: flex; align-items: center; gap: 10px; }
.brand-text {
  font-family: 'Roboto', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--navy);
  letter-spacing: -0.3px;
}
.main-nav .nav-link {
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--navy) !important;
  padding: 6px 10px !important;
  border-radius: 6px;
  letter-spacing: 0.2px;
}
.main-nav .nav-link:hover, .main-nav .nav-link.active {
  color: var(--red) !important;
  background: rgba(230,57,70,0.07);
}
.btn-add-site {
  background: var(--red);
  color: #fff !important;
  border-radius: 8px;
  font-family: 'Roboto', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  padding: 7px 18px;
  border: none;
  transition: var(--transition);
}
.btn-add-site:hover {
  background: var(--red-dark);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(230,57,70,0.3);
}

/* ---- Nav Search ---- */
.nav-search { flex: 1; max-width: 420px; margin: 0 20px; }
.search-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 40px;
  overflow: hidden;
  transition: var(--transition);
  padding-left: 14px;
}
.search-wrap:focus-within { border-color: var(--red); background: #fff; }
.search-icon { color: var(--text-muted); font-size: 14px; }
.search-wrap .form-control {
  border: none;
  background: transparent;
  box-shadow: none;
  font-size: 13.5px;
  padding: 8px 10px;
}
.btn-search {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 0 40px 40px 0;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Roboto', sans-serif;
  white-space: nowrap;
}
.btn-search:hover { background: var(--red-dark); }
.navbar-toggler { border: none; font-size: 1.4rem; color: var(--navy); }
.navbar-toggler:focus { box-shadow: none; }

/* ---- Dropdown ---- */
.mega-drop {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 8px;
  min-width: 240px;
}
.mega-drop .dropdown-item {
  border-radius: 6px;
  font-size: 13.5px;
  padding: 8px 12px;
  font-family: 'DM Sans', sans-serif;
}
.mega-drop .dropdown-item:hover { background: var(--bg); color: var(--red); }

/* ---- Hero Section ---- */
.hero-section {
  background: linear-gradient(135deg, var(--navy) 0%, #0f2340 60%, #1a3a6b 100%);
  padding: 70px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(230,57,70,0.2);
  border: 1px solid rgba(230,57,70,0.4);
  color: #ff8a95;
  padding: 5px 16px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}
.hero-title {
  font-family: 'Roboto', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero-title span { color: var(--red); }
.hero-sub { color: rgba(255,255,255,0.7); font-size: 1.05rem; margin-bottom: 30px; }
.hero-search-box {
  background: #fff;
  border-radius: 14px;
  padding: 6px 6px 6px 20px;
  display: flex;
  align-items: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  max-width: 600px;
}
.hero-search-box input {
  border: none;
  background: transparent;
  font-size: 15px;
  flex: 1;
  outline: none;
  padding: 10px 10px 10px 0;
}
.hero-search-box .btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
}
.hero-search-box .btn:hover { background: var(--red-dark); }
.hero-stats { display: flex; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.hero-stat { color: rgba(255,255,255,0.8); font-size: 13px; }
.hero-stat strong { display: block; color: #fff; font-size: 1.5rem; font-family: 'Roboto', sans-serif; }
.hero-pattern {
  position: absolute;
  right: -60px;
  top: -60px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,57,70,0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* ---- Section Titles ---- */
.section-title {
  font-family: 'Roboto', sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--navy);
  margin-bottom: 4px;
}
.section-sub { color: var(--text-muted); margin-bottom: 0; font-size: 14.5px; }
.title-line {
  width: 48px;
  height: 4px;
  background: var(--red);
  border-radius: 4px;
  margin: 10px 0 30px;
}

/* ---- Category Cards ---- */
.cat-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: var(--text);
}
.cat-card:hover {
  border-color: var(--red);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  color: var(--text);
}
.cat-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 22px;
  transition: var(--transition);
}
.cat-card:hover .cat-icon { transform: scale(1.1); }
.cat-name { font-family: 'Roboto', sans-serif; font-weight: 700; font-size: 13.5px; }
.cat-count { font-size: 12px; color: var(--text-muted); }

/* ---- Website Cards ---- */
.site-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}
.site-card:hover {
  border-color: var(--red);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
.site-card-header {
  padding: 18px 18px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.site-favicon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  object-fit: contain;
  background: var(--bg);
  flex-shrink: 0;
}
.site-title-wrap { flex: 1; min-width: 0; }
.site-name {
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.site-url {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.site-card-body { padding: 12px 18px; flex: 1; }
.site-desc { font-size: 13.5px; color: #444; line-height: 1.6; }
.site-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.site-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 10px;
}
.site-card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}
.site-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 14px; }
.site-meta span { display: flex; align-items: center; gap: 4px; }
.btn-visit {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 6px 16px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: 'Roboto', sans-serif;
  transition: var(--transition);
}
.btn-visit:hover { background: var(--red-dark); color: #fff; transform: scale(1.03); }
.badge-featured {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--gold);
  color: #5a3000;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  font-family: 'Roboto', sans-serif;
}
.badge-verified { color: #2a9d8f; font-size: 13px; }
.star-rating { color: var(--gold); font-size: 12px; }

/* ---- List View Card ---- */
.site-card-list {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.site-card-list:hover { border-color: var(--red); box-shadow: var(--shadow); }
.site-card-list .site-favicon { width: 40px; height: 40px; }
.site-card-list .flex-1 { flex: 1; min-width: 0; }

/* ---- Filter/Sort Bar ---- */
.filter-bar {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-bar .form-select, .filter-bar .form-control {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  padding: 7px 14px;
}
.filter-bar .form-select:focus, .filter-bar .form-control:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.1);
}
.view-toggle .btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  padding: 7px 12px;
  font-size: 14px;
}
.view-toggle .btn.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ---- Sidebar ---- */
.sidebar-widget {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.sidebar-widget-title {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.cat-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.cat-list-item:last-child { border-bottom: none; }
.cat-list-item a { color: var(--text); font-weight: 500; }
.cat-list-item a:hover { color: var(--red); }
.cat-list-count {
  background: var(--bg);
  border-radius: 20px;
  font-size: 11.5px;
  padding: 2px 9px;
  color: var(--text-muted);
}

/* ---- Submit Form ---- */
.submit-form-wrap {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
}
.form-label { font-weight: 600; font-size: 13.5px; color: var(--navy); }
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  padding: 10px 14px;
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.1);
}
.form-step {
  display: none;
}
.form-step.active { display: block; animation: fadeIn 0.3s; }
.step-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}
.step-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  z-index: 1;
  transition: var(--transition);
}
.step-dot.active { background: var(--red); color: #fff; }
.step-dot.done { background: #2a9d8f; color: #fff; }
.step-line {
  flex: 1;
  height: 3px;
  background: var(--border);
  margin: 0 8px;
  transition: var(--transition);
}
.step-line.done { background: #2a9d8f; }

/* ---- Detail Page ---- */
.detail-header {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
}
.detail-favicon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 2px solid var(--border);
  object-fit: contain;
  background: var(--bg);
}
.detail-title { font-family: 'Roboto', sans-serif; font-size: 1.9rem; font-weight: 800; color: var(--navy); }
.detail-url a { color: var(--red); font-size: 14px; }
.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.badge-cat {
  background: rgba(29,53,87,0.08);
  color: var(--navy);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ---- Admin ---- */
.admin-sidebar {
  background: var(--navy);
  min-height: 100vh;
  padding: 0;
}
.admin-brand {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-nav .nav-link {
  color: rgba(255,255,255,0.65);
  padding: 11px 20px;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-left: 3px solid transparent;
  transition: var(--transition);
}
.admin-nav .nav-link:hover, .admin-nav .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-left-color: var(--red);
}
.admin-nav .nav-link i { width: 20px; }
.admin-content { background: var(--bg); min-height: 100vh; }
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 22px;
}
.stat-num {
  font-family: 'Roboto', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
}

/* ---- Breadcrumb ---- */
.breadcrumb-section {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.breadcrumb { margin: 0; font-size: 13px; }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item.active { color: var(--text); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* ---- Pagination ---- */
.page-link {
  border: 1.5px solid var(--border);
  color: var(--navy);
  border-radius: 8px !important;
  margin: 0 2px;
  padding: 8px 14px;
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 14px;
}
.page-link:hover { background: var(--red); color: #fff; border-color: var(--red); }
.page-item.active .page-link { background: var(--red); border-color: var(--red); color: #fff; }

/* ---- Footer ---- */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.7); }
.footer-top { padding: 56px 0 40px; }
.footer-bottom {
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.footer-bottom a { color: rgba(255,255,255,0.6); }
.footer-bottom a:hover { color: #fff; }
.footer-desc { font-size: 13.5px; line-height: 1.7; }
.footer-title {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 10px;
}
.footer-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 32px; height: 3px;
  background: var(--red);
  border-radius: 3px;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.65); font-size: 13.5px; }
.footer-links a:hover { color: #fff; padding-left: 4px; }
.footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13.5px;
}
.footer-contact i { color: var(--red); margin-top: 2px; flex-shrink: 0; }
.footer-contact a { color: rgba(255,255,255,0.65); }
.footer-contact a:hover { color: #fff; }
.footer-social { display: flex; gap: 8px; margin-top: 16px; }
.social-link {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: var(--transition);
}
.social-link:hover { background: var(--red); color: #fff; }
.btn-footer-cta {
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border: none;
  transition: var(--transition);
}
.btn-footer-cta:hover { background: var(--red-dark); color: #fff; }

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 999;
  box-shadow: 0 4px 12px rgba(230,57,70,0.35);
}
.back-to-top.show { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--red-dark); }

/* ---- Alerts ---- */
.alert-success { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.alert-danger { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.35; }

/* ---- Responsive ---- */
@media (max-width: 991px) {
  .submit-form-wrap { padding: 24px 20px; }
  .hero-section { padding: 48px 0 40px; }
}
@media (max-width: 576px) {
  .hero-stats { gap: 20px; }
  .detail-title { font-size: 1.5rem; }
}
