* {
  box-sizing: border-box
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;

  background-image: linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%);
  color: #1b2638;
  padding-top: 0;
}

/* Ensure main content is properly displayed when visible */
#main-content {
  position: relative;
  z-index: 1;
}

/* Navbar customizations */
.navbar-brand {
  font-weight: 600;
}

#login-container h1 {
  color: #1b2638;
  font-weight: 600;
}

/* Login Page Styles */
.login-container {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  position: relative;
  min-height: 100vh;
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 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='%231db954' 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") repeat;
  pointer-events: none;
}

.login-card {
  border-radius: 20px !important;
  border: none !important;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95) !important;
}

.login-card .card-body {
  border-radius: 20px;
}

/* Enhanced brand styling */
.bi-spotify {
  filter: drop-shadow(0 4px 8px rgba(29, 185, 84, 0.3));
}

.display-5 {
  background: linear-gradient(135deg, #1db954, #1ed760);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-control-lg {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.form-control-lg:focus {
  border-color: #1db954;
  box-shadow: 0 0 0 0.2rem rgba(29, 185, 84, 0.25);
}

.btn-primary {
  background: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1ed760 0%, #1db954 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(29, 185, 84, 0.3);
}

.btn-primary:focus {
  box-shadow: 0 0 0 0.2rem rgba(29, 185, 84, 0.5);
}

@media (max-width: 767.98px) {
  .login-container .container {
    padding: 1rem;
  }

  .login-card .card-body {
    padding: 2rem !important;
  }

  .display-5 {
    font-size: 2rem !important;
  }

  .bi-spotify {
    font-size: 3rem !important;
  }
}

h1 {
  font-size: 24px;
  margin: 0 0 16px
}

h2 {
  font-size: 18px;
  margin: 0 0 12px
}

.container {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 16px
}

/* Adjust container margin when navbar is visible */
body:has(#main-navbar[style*="block"]) .container {
  margin-top: 16px;
}

/* Navbar brand styling */
.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Login container centering when navbar is hidden */
#login-container {
  min-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Enhanced Login Screen Styles */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  /* background: linear-gradient(135deg, #1db954 0%, #1ed760 100%); */
  margin: -2rem -15px;
  padding: 2rem 15px;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
  max-width: 480px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 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='%231db954' fill-opacity='0.02'%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") repeat;
  pointer-events: none;
  z-index: 0;
}

.login-card>* {
  position: relative;
  z-index: 1;
}

/* Brand Styling */
.brand-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 8px rgba(29, 185, 84, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

.brand-title {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1db954, #1ed760);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.brand-subtitle {
  color: #6c757d;
  /* font-size: 1.1rem; */
  margin-bottom: 0;
}

/* Login Form Styling */
.login-form-container {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.login-title {
  color: #1b2638;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: #6c757d;
  margin-bottom: 0;
}

/* Enhanced Form Controls */
.form-control-lg {
  padding: 1rem 1.25rem;
  font-size: 1rem;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
}

.form-control-lg:focus {
  border-color: #1db954;
  box-shadow: 0 0 0 0.2rem rgba(29, 185, 84, 0.25);
  background: #fff;
}

.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

/* Enhanced Button */
.btn-success {
  background: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
  border: none;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-success:hover {
  background: linear-gradient(135deg, #1ed760 0%, #1db954 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(29, 185, 84, 0.4);
}

.btn-success:focus {
  box-shadow: 0 0 0 0.2rem rgba(29, 185, 84, 0.5);
}

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

/* Alert Styling */
.alert-danger {
  border-radius: 12px;
  border: none;
  background: rgba(220, 53, 69, 0.1);
  color: #721c24;
  backdrop-filter: blur(10px);
}

/* Responsive Design */
@media (max-width: 767.98px) {
  .login-wrapper {
    padding: 1rem;
    margin: -1rem -15px;
  }

  .login-card {
    padding: 2rem 1.5rem;
  }

  .login-form-container {
    padding: 1.5rem;
  }

  .brand-title {
    font-size: 2rem;
  }

  .brand-icon {
    font-size: 3rem;
  }
}

.card {
  background: #ffffff;
  border: 1px solid #e1e6ef;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .05);
  margin-bottom: 16px
}

/* label {
  display: block;
  margin: 8px 0 12px
}

input[type=text],
input[type=password],
input[type=file] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccd6e5;
  border-radius: 10px;
  background: #fff;
  color: #1b2638
}

button {
  background: #2563eb;
  border: none;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  margin: 10px 0 0;
  cursor: pointer
}

button:hover {
  background: #1d4ed8
}

button.login-btn,
button.logout-btn {
  background: #fff;
  border: 1px solid #ccd6e5;
  color: #1b2638;
  margin: 0 0 10px 0;
} */

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap
}

.row input[type=file] {
  flex: 1
}

.space-between {
  justify-content: space-between
}

/* .link {
  background: #ffffff;
  border: 1px solid #ccd6e5;
  color: #1b2638
} */

.msg {
  margin-top: 8px;
  color: #b45309
}

.result {
  background: #fff;
  border: 1px solid #e1e6ef;
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
  white-space: pre-wrap
}

/* Table */
.table-wrap {
  width: 100%;
}

.table-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #e1e6ef;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 12px 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.results-info {
  flex-grow: 1;
}

.results-info .fw-bold {
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.results-info .small {
  font-size: 0.875rem;
  opacity: 0.8;
}

.table-content {
  border: 1px solid #e1e6ef;
  border-top: none;
  border-radius: 0 0 12px 12px;
  overflow: auto
}

.table {
  width: 100%;
  border-collapse: collapse
}

.table th,
.table td {
  border: 1px solid #eef2f7;
  padding: 8px;
  font-size: 12px;
  text-align: left
}

.table th {
  background: #f8fafc;
  font-weight: 600
}

/* Sortable Table Headers */
.sortable-header {
  transition: background-color 0.2s ease;
}

.sortable-header:hover {
  background-color: #e2e8f0 !important;
}

.sortable-header.sorted {
  background-color: #dbeafe !important;
  color: #1e40af;
}

.sort-icon {
  font-size: 0.75rem;
  transition: opacity 0.2s ease;
}

.sortable-header:hover .sort-icon {
  opacity: 1 !important;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .6);
  backdrop-filter: saturate(180%) blur(4px);
  z-index: 9999
}

.loading-content {
  padding: 16px;
  border-radius: 12px
}

/* Labels table styles */
#labels-table tbody tr {
  cursor: pointer;
}

#labels-table tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.05);
}

#labels-table .label-checkbox {
  cursor: pointer;
}

#labels-table td code {
  background-color: rgba(108, 117, 125, 0.1);
  color: #6c757d;
  font-size: 0.875em;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

/* Make streams column readable */
#labels-table td:nth-child(3) {
  text-align: right;
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0d6efd;
}

/* Make financial columns more readable */
#labels-table td:nth-child(4),
#labels-table td:nth-child(6),
#labels-table td:nth-child(7),
#labels-table td:nth-child(8) {
  text-align: right;
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875rem;
}

/* Style fee amounts as negative values */
#labels-table td:nth-child(6) {
  color: #dc3545;
  /* Bootstrap's danger red color */
  font-weight: 500;
}

/* Style percentage column */
#labels-table td:nth-child(5) {
  text-align: center;
  font-weight: 500;
}

/* Style tracks count */
#labels-table td:nth-child(9) {
  text-align: center;
  font-weight: 500;
}

/* Make table header sticky and add some spacing */
#labels-table th {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

#selected-count {
  font-weight: 500;
  color: #0d6efd;
}

/* Footer pinned style: push table to bottom visually while keeping responsive */
@media (min-height:800px) {
  .container {
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column
  }

  .card:last-of-type {
    margin-top: auto
  }
}