*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navigation-bg: #222;
  /* Base colors */
  --base-100: #ffffff;
  --base-200: #f9f6f2;
  --base-300: #e8e0d5;
  /* brownish base-content
  --base-content: #3d2e1d;
  --base-content-secondary: #5d4a36;
  --base-content-tertiary: #8a7b6a; 
  */
  --base-content: #30313d;
  --base-content-secondary: #5c5b61;
  --base-content-tertiary: #aaa;
  /* Primary colors - based on the gold/amber from the owl's eyes */
  --primary: #3b9e9c;
  --primary-darker: #2d7a78;
  --primary-content: #ffffff;
  /* Secondary colors - teal/blue-green that complements the amber */
  --secondary: #e09c23;
  --secondary-darker: #c48113;
  --secondary-content: #ffffff;
  /* Tertiary colors - the owl's brown body color */
  --tertiary: #8b5e3c;
  --tertiary-darker: #6a472d;
  --tertiary-content: #ffffff;
  /* Accent colors - complementary to the amber/gold */
  --accent: #4a6fcc;
  --accent-darker: #3a5aaf;
  --accent-content: #ffffff;
  /* Beta logo */
  --beta: #f39c12;
  --beta-bg: #f5a62333;
  /* Status colors - redesigned for clear distinction */
  --success: #3b9d6a;
  --success-darker: #2d7a52;
  --success-content: #ffffff;
  --warning: #d75db6; /* Changed to a purple-pink that's distinct from amber */
  --warning-darker: #b64a98;
  --warning-content: #ffffff;
  --error: #d55e3f;
  --error-darker: #b24930;
  --error-content: #ffffff;
  --info: #4a90cc;
  --info-darker: #3777af;
  --info-content: #ffffff;
  /* Sizing */
  --container-narrow: 900px;
  --container-normal: 1100px;
  --container-wide: 1400px;
  /* Fonts */
  --font-middle: 500;
  /* transitions*/
  --transition: all 0.25s ease;
}

body {
  font-family: 'Open Sans', sans-serif;
  /* font-family: 'News Cycle', sans-serif; */
  line-height: 1.6;
  background-color: var(--base-200);
  color: var(--base-content);
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: var(--base-content);
}

/* Top Navigation Bar */
.top-navbar {
  background-color: #222;
  color: var(--primary-content);
  border-bottom: 1px solid var(--base-300);
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 42px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  font-weight: bold;
  color: var(--primary-content);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  user-select: none;
  text-transform: uppercase;
}

.beta {
  color: var(--beta);
  position: relative;
  top: -0.5em;
  font-size: 0.65em;
  font-weight: bold;
  background: var(--beta-bg);
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.main-menu {
  display: flex;
  list-style: none;
  margin: 0;
  height: 100%;
}

.nav-section {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-center {
  flex: 1;
  justify-content: center;
}

.main-menu-item {
  padding: 0 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--primary-content);
  transition: var(--transition);
  text-decoration: none;
  height: 100%;
  border-bottom: 3px solid transparent;
  position: relative;
}

.main-menu-item i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
  font-size: 1.1em;
}

.main-menu-item:hover {
  color: var(--primary);
  background-color: var(--base-content);
}

.main-menu-item.active {
  color: white;
  border-bottom: 3px solid var(--secondary);
  font-weight: 600;
  cursor: default;
  /* Disable hover and other pointer interactions */
  pointer-events: none;
}

.main-menu-item.active i {
  color: var(--secondary);
}

.nav-right .main-menu-item {
  justify-content: center;
  margin-left: 5px;
}

/* Upgrade */
.actions {
  display: flex;
  gap: 15px;
  align-items: center;
  margin: 0 20px;
}

.btn-upgrade {
  /* todo: height hack - hardcoded value */
  height: 38px;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  outline: none;
  text-decoration: none;
  color: white;
  background-color: var(--success);
}

.btn-upgrade:hover {
  background-color: var(--success-darker);
  transform: translateY(-1px);
}

.btn-upgrade:active {
  transform: translateY(0);
}

/* Credits Bar */
.credits-bar {
  margin: 0.5rem 1rem;
  padding: 0 1rem;
  color: var(--base-200);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--primary);
  border-radius: 2px;
}

.credits-bar i {
  color: var(--primary);
}

/* Containers */
.container {
  width: 100%;
  max-width: var(--container-normal);
  margin: 0 auto;
  padding: 0 1rem;
  padding-top: 2rem;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.main-container {
  width: 100%;
  max-width: 90%;
  margin: 0 auto;
  padding: 0 1rem;
  padding-top: 2rem;
}

/* Temporary for plans page */
.continer-wide {
  max-width: var(--container-wide);
}

.container-vert-flex {
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.container-orizontal-flex {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  gap: 1rem;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
}

/* Card Styles */
.card-container {
  width: 100%;
  max-width: 400px; /* Fixed width for larger screens */
}

.card-container-large {
  max-width: 600px;
}

.card {
  border: 1px solid var(--base-300);
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  width: 100%;
}

.card p,
h3,
h5 {
  margin-bottom: 1rem;
}

.card-header {
  margin-bottom: 1.5rem;
}

.card-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.card-header p {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

/* Api Keys page */
.api-keys-list {
  text-align: left;
  /* limited by card-container-large width */
  min-width: 550px;
}

.api-keys-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--base-300);
  padding-bottom: 0.5rem;
}

.api-key-info {
  font-size: 0.9rem;
  color: var(--base-content);
  background: var(--base-200);
  padding: 1rem;
  border-radius: 0.25rem;
  margin-top: 0.5rem;
}

.api-key-example {
  font-family: monospace;
  background: var(--base-100);
  padding: 0.25rem;
  border-radius: 0.25rem;
}

.api-key-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--base-300);
}

.api-key-item:last-child {
  border-bottom: none;
}

.project-name {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.api-key-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--base-100);
  padding: 0.5rem;
  border-radius: 0.25rem;
  word-break: break-all;
}

.api-key {
  font-family: monospace;
  flex-grow: 1;
}

.key-preview,
.key-full {
  display: inline-block;
}

.key-full.hidden {
  display: none;
}

.key-actions {
  display: flex;
  white-space: nowrap;
}

.toggle-btn,
.copy-btn {
  background-color: var(--base-200);
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.toggle-btn:hover,
.copy-btn:hover {
  background-color: var(--base-300);
}

.no-projects {
  text-align: center;
  color: var(--base-300);
}

/* Buttons */
.vstack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 0.75rem;
}

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.6;
  font-weight: var(--font-middle);
  padding: 0.5rem 1rem;
  text-decoration: none;
  text-align: center;
  border-radius: 0.25rem;
  border: none;
  background: var(--primary);
  color: var(--primary-content);
  cursor: pointer;
}

.btn:hover {
  opacity: 0.8;
}

.btn-secondary {
  color: var(--base-200);
  background-color: var(--base-content-secondary);
}

.btn-sm {
  max-width: 50%;
  align-self: center;
}

/* Utils */
.primary-highlight {
  color: var(--primary);
  font-weight: bold;
}

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

.text-on-left {
  text-align: left;
}

/* Profile Page */
.activity-log {
  border: 1px solid var(--base-content);
  margin: 0.5rem;
  padding: 0.5rem;
}

/* Forms controls */
form {
  text-align: left;
}

.form-input-container {
  margin-bottom: 1rem;
}

.form-label {
  display: inline-block;
  margin-bottom: 0.5rem;
}

.form-control {
  display: block;
  width: 100%;
  line-height: 1.6;
  padding: 0.375rem 0.75rem;
  color: var(--base-content);
  background-color: var(--base-200);
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
}

.form-control:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Captcha */
.g-recaptcha {
  margin: 1rem auto;
}

/* Custom Alerts */
.custom-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  margin: 10px 0;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 14px;
}

.custom-alert.success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.custom-alert.error {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.close-btn {
  background: none;
  border: none;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  color: #000;
  cursor: pointer;
  padding: 0 5px;
}

.close-btn:focus {
  outline: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .container {
    padding-top: 3rem; /* Less top padding on small screens */
  }

  .card {
    padding: 1.25rem;
  }

  .card-container-large {
    max-width: 400px;
  }

  .card-header h1 {
    font-size: 2rem;
  }

  .card-header p {
    font-size: 1.1rem;
  }
}

/* Responsive Nav Bar */
@media (max-width: 992px) {
  .top-navbar {
    padding: 0 15px;
  }

  .nav-center .main-menu-item {
    padding: 0 15px;
  }
}

@media (max-width: 768px) {
  .top-navbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 15px;
  }

  .nav-section {
    width: 100%;
    justify-content: center;
    margin: 5px 0;
  }

  .nav-right {
    justify-content: flex-end;
  }

  .logo {
    justify-content: flex-start;
    padding-left: 0;
  }

  .actions {
    margin: 0;
  }

  .main-menu-item {
    padding: 0 10px;
  }

  .nav-center .main-menu-item {
    height: 40px;
    border-radius: 6px;
  }

  .nav-center .main-menu-item.active {
    border-bottom: none;
    background-color: var(--primary-light);
  }
}

@media (max-width: 576px) {
  .main-menu-item span {
    display: none;
  }

  .main-menu-item i {
    margin-right: 0;
    font-size: 1.2em;
  }

  .btn-upgrade {
    padding: 8px 12px;
  }

  .actions {
    gap: 8px;
  }
}
