:root {
  /* Ocean Deep Theme */
  --bg-dark: #050b14;
  --bg-primary: #0a192f;
  --bg-card: rgba(16, 33, 61, 0.6);
  --bg-card-hover: rgba(23, 42, 69, 0.8);

  --accent-primary: #ffd700;
  --accent-secondary: #ffae00;
  --accent-hover: #ffea00;

  --text-main: #e6f1ff;
  --text-muted: #8892b0;
  --border-color: rgba(255, 215, 0, 0.2);

  --glass-effect: blur(12px);
  --shadow-main: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
  --transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 215, 0, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 215, 0, 0.05) 0%, transparent 40%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1,
h2,
h3,
h4 {
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 1rem;
}

h1 {
  font-size: 1.5rem;
  color: var(--accent-primary);
}

h2 {
  font-size: 2rem;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  display: block;
  width: 50%;
  height: 2px;
  background: var(--accent-primary);
  margin-top: 0.5rem;
  border-radius: 2px;
}

p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Layout */
#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--accent-primary);
}

nav#main-nav {
  display: flex;
  gap: 1.5rem;
}

nav button {
  background: transparent;
  color: var(--text-main);
  border: none;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 0.5rem 0;
  position: relative;
  transition: var(--transition);
}

nav button::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: var(--transition);
}

nav button:hover {
  color: var(--accent-primary);
}

nav button:hover::after,
nav button.active::after {
  width: 100%;
}

nav button.active {
  color: var(--accent-primary);
}

main#main-content {
  flex: 1;
  padding-bottom: 4rem;
}

/* Glassmorphism Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-effect);
  -webkit-backdrop-filter: var(--glass-effect);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  transition: var(--transition);
  box-shadow: var(--shadow-main);
}

.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-5px);
  border-color: var(--accent-primary);
}

/* Grid Layouts */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.fishermen-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.fisherman-card {
  padding: 1.5rem 1rem;
}

.fisherman-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 2px solid var(--accent-primary);
}

.fisherman-name {
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  background: rgba(255, 215, 0, 0.1);
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-dark);
  border-color: var(--accent-primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--bg-dark);
}

.btn-back {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(136, 146, 176, 0.3);
  padding: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  margin-right: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  transition: var(--transition);
  vertical-align: middle;
}

.btn-back:hover {
  background: rgba(136, 146, 176, 0.1);
  color: var(--text-main);
  border-color: rgba(136, 146, 176, 0.6);
  transform: translateX(-3px);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

input,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(2, 12, 27, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-main);
  font-family: inherit;
  transition: var(--transition);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}

/* Tables */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-effect);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(136, 146, 176, 0.1);
}

th {
  color: var(--text-main);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  background: rgba(2, 12, 27, 0.4);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background: rgba(255, 215, 0, 0.05);
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--bg-dark);
  font-weight: bold;
}

/* Utilities */
.text-accent {
  color: var(--accent-primary);
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 2rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

/* Dashboard specific */
.stage-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.stage-card h3 {
  margin-bottom: 0.25rem;
}

.stage-card .stage-date {
  font-family: monospace;
  color: var(--accent-primary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.stage-card .stage-actions {
  margin-top: auto;
  padding-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

/* Footer & Discrete Login */
footer#main-footer {
  margin-top: 2rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 215, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.footer-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 300;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 850px) {
  #app {
    padding: 0 1rem;
  }

  .top-nav {
    flex-direction: column;
    padding: 1rem 0;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .logo {
    flex-direction: column;
    text-align: center;
  }

  .logo h1 {
    font-size: 1.2rem;
  }

  nav#main-nav {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  nav button {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .fishermen-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .fisherman-card {
    padding: 1rem 0.5rem;
  }

  .fisherman-avatar {
    width: 50px;
    height: 50px;
    margin-bottom: 0.5rem;
  }

  .fisherman-name {
    font-size: 0.9rem;
  }

  .card {
    padding: 1.25rem;
  }

  /* Table to Card Transformation */
  .table-container {
    border: none;
    background: transparent;
    backdrop-filter: none;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  tr {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow-main);
  }

  td {
    border: none;
    padding: 0.5rem 0;
    padding-left: 45%;
    position: relative;
    text-align: right;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(136, 146, 176, 0.05);
  }

  td:last-child {
    border-bottom: none;
    margin-top: 0.5rem;
    padding-left: 0;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 1rem;
  }

  td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 40%;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent-primary);
  }

  .rank-pill {
    float: right;
  }
}

@media (max-width: 480px) {
  nav#main-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  nav button {
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: rgba(2, 12, 27, 0.3);
  }

  nav button::after {
    display: none;
  }

  nav button.active {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--accent-primary);
  }
}