/* === Base Reset & Typography === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f9fbfd;
  color: #2c3e50;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* === Main Container to center all content === */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === Navbar === */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #1e90ff;
  padding: 12px 20px;
  color: white;
  position: sticky;
  top: 0;
  z-index: 999;
  user-select: none;
  flex-wrap: wrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 1px;
  user-select: none;
}

.navbar-links {
  display: flex;
  gap: 20px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  max-height: none;
  opacity: 1;
}

.navbar-links a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 5px;
  transition: background-color 0.25s ease, transform 0.15s ease;
  cursor: pointer;
}

.navbar-links a:hover,
.navbar-links a:focus-visible,
.navbar-toggle:hover,
.navbar-toggle:focus-visible {
  background-color: #0d6efd;
  outline-offset: 2px;
  outline: 3px solid #0d6efd;
  transform: scale(1.05);
}

.navbar-toggle {
  display: none;
  font-size: 2rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 10px 15px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

/* === Headings === */
h1, h2, h3, h4, h5, h6 {
  color: #1e90ff;
  font-weight: 700;
  margin-bottom: 0.8rem;
  line-height: 1.25;
}

/* === Forms === */
.auth-form, form {
  background: white;
  padding: 25px;
  margin: 25px auto;
  max-width: 520px;
  border-radius: 14px;
  box-shadow: 0 4px 15px rgba(30, 144, 255, 0.2);
  font-size: 1rem;
  transition: box-shadow 0.3s ease;
}

.auth-form:hover,
form:hover {
  box-shadow: 0 6px 25px rgba(30, 144, 255, 0.3);
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 24px;
  font-weight: 700;
  color: #0d6efd;
}

.auth-form label, form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: #34495e;
}

.auth-form input,
form input,
form textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 20px;
  border: 1.8px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.auth-form input:focus,
form input:focus,
form textarea:focus {
  border-color: #1e90ff;
  outline: none;
  box-shadow: 0 0 10px rgba(30, 144, 255, 0.5);
}

.auth-form button,
form button {
  width: 100%;
  padding: 14px;
  background-color: #1e90ff;
  color: white;
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 6px 15px rgba(30, 144, 255, 0.4);
}

.auth-form button:hover,
form button:hover,
.auth-form button:focus-visible,
form button:focus-visible {
  background-color: #0d6efd;
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.6);
  outline-offset: 2px;
  outline: 3px solid #0d6efd;
}

/* === Alerts === */
.errors {
  background: #fcebea;
  color: #c82333;
  border: 1px solid #f5c6cb;
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: inset 0 0 6px rgba(200, 35, 51, 0.3);
}

.success {
  background: #e6ffed;
  color: #2f6627;
  border: 1px solid #c3e6cb;
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: inset 0 0 6px rgba(47, 102, 39, 0.3);
}

/* === Post List === */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul li {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px 18px;
  margin-bottom: 14px;
  transition: box-shadow 0.25s ease;
  cursor: pointer;
  user-select: none;
}

ul li:hover,
ul li:focus-visible {
  box-shadow: 0 0 12px rgba(30, 144, 255, 0.3);
  border-color: #1e90ff;
  outline-offset: 2px;
  outline: 3px solid #1e90ff;
}

ul li a {
  font-weight: 700;
  color: #1e90ff;
  display: block;
  margin-bottom: 6px;
  text-decoration: none;
  transition: color 0.3s ease;
}

ul li a:hover,
ul li a:focus-visible {
  color: #0d6efd;
  outline-offset: 2px;
  outline: 3px solid #0d6efd;
}

small {
  color: #7f8c8d;
  font-size: 0.85rem;
  font-style: italic;
}

/* === Media === */
.post-media {
  margin-top: 25px;
  text-align: center;
}

.post-media img,
img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(30, 144, 255, 0.15);
  display: block;
  margin: 15px auto;
  object-fit: contain;
}

.post-media video,
.post-media audio {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(30, 144, 255, 0.15);
  display: block;
  margin: 15px auto;
  object-fit: contain;
}

.post-media .iframe-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(30, 144, 255, 0.15);
  margin: 15px auto;
}

.post-media .iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
  border-radius: 12px;
}

.post-media iframe {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  border: none;
}

/* === Post Content Area === */
.post-content {
  background: white;
  padding: 20px 25px;
  margin-top: 25px;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(30, 144, 255, 0.15);
  font-size: 1.05rem;
  line-height: 1.7;
  color: #2c3e50;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 1.2rem;
  margin-bottom: 0.7rem;
  font-weight: 700;
  color: #1e90ff;
}

.post-content img {
  max-width: 100%;
  margin: 15px auto;
  display: block;
  border-radius: 12px;
}

.post-content ul,
.post-content ol {
  padding-left: 25px;
  margin-bottom: 1rem;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.post-content table th,
.post-content table td {
  border: 1px solid #ddd;
  padding: 10px 12px;
}

.post-content iframe {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

/* === Ranking Table === */
.ranking-table {
  width: 100%;
  margin-top: 25px;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(30, 144, 255, 0.15);
  overflow-x: auto;
  display: block;
  white-space: nowrap;
}

.ranking-table th,
.ranking-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid #e1e8f0;
  font-weight: 600;
  color: #34495e;
}

.ranking-table th {
  background-color: #1e90ff;
  color: white;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.ranking-table td:nth-child(3),
.ranking-table td:nth-child(4),
.ranking-table td:nth-child(5),
.ranking-table td:nth-child(6),
.ranking-table td:nth-child(7) {
  text-align: right;
}

.ranking-table tr:hover,
.ranking-table tr:focus-visible {
  background-color: #f0f6ff;
  outline-offset: 2px;
  outline: 3px solid #1e90ff;
}

/* === Action Links Buttons === */
.action-links a.btn {
  margin-right: 8px;
  font-size: 1.3rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.3s ease;
  user-select: none;
}

.action-links a.btn:hover,
.action-links a.btn:focus-visible {
  transform: scale(1.2);
}

.action-links a.btn[title="Approve"]:hover,
.action-links a.btn[title="Approve"]:focus-visible {
  color: #28a745;
}

.action-links a.btn[title="Reject"]:hover,
.action-links a.btn[title="Reject"]:focus-visible {
  color: #dc3545;
}

/* === Register Form === */
form#registerForm {
  background: white;
  padding: 30px 35px;
  max-width: 480px;
  margin: 35px auto 45px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(30, 144, 255, 0.2);
  font-size: 1.05rem;
  line-height: 1.65;
}

form#registerForm label {
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
  color: #0d47a1;
}

form#registerForm input[type="text"],
form#registerForm input[type="password"] {
  border: 2px solid #ccc;
  padding: 14px 16px;
  border-radius: 9px;
  font-size: 1.05rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

form#registerForm input[type="text"]:focus,
form#registerForm input[type="password"]:focus {
  border-color: #1e90ff;
  outline: none;
  box-shadow: 0 0 10px rgba(30, 144, 255, 0.6);
}

form#registerForm button[type="submit"] {
  margin-top: 16px;
  background-color: #1e90ff;
  padding: 16px;
  font-size: 1.2rem;
  border-radius: 10px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(30, 144, 255, 0.3);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

form#registerForm button[type="submit"]:hover,
form#registerForm button[type="submit"]:focus-visible {
  background-color: #0d6efd;
  box-shadow: 0 8px 25px rgba(13, 110, 253, 0.7);
  outline-offset: 2px;
  outline: 3px solid #0d6efd;
}

/* === Dashboard Buttons and Stats === */
.btn {
  display: inline-block;
  background-color: #1e90ff;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 6px 15px rgba(30, 144, 255, 0.4);
  cursor: pointer;
  user-select: none;
}

.btn:hover,
.btn:focus-visible {
  background-color: #0d6efd;
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.6);
  outline-offset: 2px;
  outline: 3px solid #0d6efd;
}

/* Stats boxes */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 1rem;
  margin-bottom: 30px;
  list-style: none;
  padding: 0;
}

.stats li, .stat-box {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
  color: #34495e;
  box-shadow: 0 3px 10px rgba(30, 144, 255, 0.1);
  transition: box-shadow 0.25s ease;
  flex: 1 1 200px;
  text-align: center;
  min-width: 180px;
  cursor: default;
}

.stats li:hover, .stat-box:hover {
  box-shadow: 0 0 12px rgba(30, 144, 255, 0.25);
  border-color: #1e90ff;
}

.stat-box h3 {
  font-size: 2.8rem;
  margin: 0 0 8px;
  color: #007bff;
}

.stat-box p {
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0;
  color: #555;
}

/* Logout Button */
.logout-btn {
  font-size: 0.9rem;
  padding: 8px 12px;
  background-color: #e74c3c;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
}

.logout-btn:hover,
.logout-btn:focus-visible {
  background-color: #c0392b;
  outline-offset: 2px;
  outline: 3px solid #c0392b;
}

/* Revenue breakdown list */
.stats ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-top: 10px;
  text-align: left;
}

.stats ul li {
  font-weight: 500;
  color: #2c3e50;
  background: none;
  border: none;
  padding: 4px 0;
  box-shadow: none;
  cursor: default;
}

/* === Center Top Earners Page === */
.table-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  overflow-x: auto;
}

.table-container table {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-collapse: collapse;
}

h2 {
  text-align: center;
  color: #1e90ff;
  margin: 25px 0 15px;
  font-weight: 700;
}

/* === Responsive Rules === */
@media (max-width: 600px) {
  .navbar-toggle {
    display: block;
  }

  .navbar-links {
    width: 100%;
    flex-direction: column;
    display: flex;
    margin-top: 12px;
    gap: 12px;
    background-color: #1e90ff;
    border-radius: 0 0 8px 8px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.35s ease;
  }

  .navbar-links.active {
    max-height: 600px;
    opacity: 1;
  }

  .navbar-links a {
    padding: 14px 18px;
    font-size: 1.3rem;
  }

  form {
    padding: 18px;
    margin: 15px 12px;
  }

  .navbar-brand {
    margin-bottom: 14px;
    flex-basis: 100%;
  }

  .ranking-table {
    font-size: 0.85rem;
  }

  .ranking-table th,
  .ranking-table td {
    padding: 8px 12px;
  }

  .logout-btn {
    width: 100%;
    text-align: center;
  }

  .stats li, .stat-box {
    font-size: 0.95rem;
    min-width: auto;
    flex: 1 1 100%;
  }

  .stats ul li {
    font-size: 0.85rem;
  }
}
