/* Global Styles */
:root {
  --main-top-margin: 1rem;
  --main-top-padding: 1rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
  padding-top: 3.5rem; /* Adjust based on your header height */
  font-size: 16px;
}

h1 {
  text-align: center;
  margin-bottom: 1.25rem;
  color: #333;
  font-size: 1.5rem;
}

/* Container */
.container {
  width: 100%;
  padding: 0 1rem;
  margin: 0 auto;
}

.main-container {
  margin-top: var(--main-top-margin);
  padding-top: var(--main-top-padding);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.625rem 0.9375rem;
  background-color: #007bff;
  color: white;
  text-align: center;
  text-decoration: none;
  font-size: 1rem;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%;
  margin-bottom: 0.625rem;
}

.btn:hover, .btn:focus {
  background-color: #0056b3;
}

.btn-danger {
  background-color: #dc3545;
}

.btn-danger:hover, .btn-danger:focus {
  background-color: #c82333;
}

.btn-action {
  margin-bottom: 1rem;
  padding: 1rem;
  font-size: 1.1rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.3125rem;
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  font-size: 1rem;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  background-color: #fff;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #f2f2f2;
  font-weight: bold;
}

/* Images */
img, .image-preview {
  max-width: 100%;
  height: auto;
}

.image-preview {
  max-height: 6.25rem;
}

#thumbnail {
  max-width: 12.5rem;
  max-height: 12.5rem;
  cursor: pointer;
}

/* Navigation */
.nav-link {
  padding: 0.5rem 1rem;
}

.nav-container {
  margin-bottom: 1.25rem;
}

.nav-btn {
  display: block;
  width: 100%;
  padding: 0.625rem;
  background-color: #007bff;
  color: white;
  text-align: left;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
}

.nav-menu {
  display: none;
  background-color: #f9f9f9;
  border-radius: 0 0 0.25rem 0.25rem;
}

.nav-menu a {
  display: block;
  padding: 0.625rem;
  text-decoration: none;
  color: #333;
}

.nav-menu a:hover {
  background-color: #ddd;
}

.show {
  display: block;
}

/* Misc */
#errorText {
  color: red;
  margin-top: 0.625rem;
}

#thumbnailContainer {
  text-align: center;
  margin-top: 1.25rem;
}

#loginStatus {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #dee2e6;
  visibility: hidden; /* This makes the text invisible */
}

/* Batch upload progress */
#progress-container {
  margin-top: 1.25rem;
}

.progress-bar {
  height: 1.25rem;
  background-color: #e0e0e0;
  border-radius: 0.625rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: #4CAF50;
  transition: width 0.3s ease-in-out;
}

#batch-controls {
  margin-top: 1.25rem;
}

/* Top Stores */
#topStoresContainer {
  margin-bottom: 2rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1rem;
}

#topStoresList {
  padding: 0;
}

.top-store-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.top-store-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.store-rank-and-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 0.25rem;
}

.store-avg-pay {
  font-size: 1.1rem;
  color: #28a745;
  margin-bottom: 0.25rem;
}

.store-total-pickups {
  font-size: 0.9rem;
  color: #6c757d;
}

/* Cards */
.platform-card,
.overall-card {
  transition: transform 0.2s ease-in-out;
  margin-bottom: 1rem;
}

.platform-card:hover,
.overall-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
}

.platform-card .card-header,
.overall-card .card-header {
  background-color: #f8f9fa;
}

.platform-card .card-header {
  border-bottom: 2px solid #007bff;
}

.platform-card .card-title,
.overall-card .card-title {
  margin-bottom: 0;
  color: #007bff;
}

.platform-card .card-body,
.overall-card .card-body {
  padding: 1.25rem;
}

.platform-card .card-text,
.overall-card .card-text {
  margin-bottom: 0.5rem;
}

.platform-card .highlight,
.overall-card .highlight {
  font-size: 1.2em;
  font-weight: bold;
  color: #28a745;
}

.earnings-card .card-header { border-bottom-color: #28a745; }
.orders-card .card-header { border-bottom-color: #007bff; }
.distance-card .card-header { border-bottom-color: #ffc107; }
.platforms-card .card-header { border-bottom-color: #17a2b8; }

/* Edit order page */
.edit-order-page .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.edit-order-page .container > *:not(#thumbnailContainer) {
  align-self: flex-start;
  width: 100%;
}

/* Sticky Delete Button Styles */
.sticky-container {
  position: sticky;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 0.625rem 0;
  transition: box-shadow 0.3s ease;
  z-index: 1000;
}

.is-sticky {
  box-shadow: 0 -0.125rem 0.625rem rgba(0, 0, 0, 0.1);
}

.table-responsive {
  padding-bottom: 4.375rem;
}

.sticky-bottom {
  width: 100%;
}

/* Upload page specific styles */
.upload-container {
  max-width: 100%;
  margin: 0 auto;
}

#file-input {
  display: none;
}

.custom-file-upload {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: background-color 0.3s, color 0.3s;
  text-align: center;
  line-height: 1.5;
  font-size: 1rem;
  height: 100%;
  min-height: 2.375rem;
}

.custom-file-upload:hover {
  background-color: #e9ecef;
}

.upload-page .btn {
  height: 100%;
  min-height: 2.375rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

#preview {
  margin-top: 0.9375rem;
}

.upload-page .progress {
  height: 1.5625rem;
}

/* Specific styles for display_uploads.html */
.uploads-page .main-container {
    max-width: 100%;
    padding: 0 1rem;
}

.uploads-page .table-responsive {
    overflow-x: visible;
}

.uploads-page #uploadsTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.uploads-page #uploadsTable thead {
    display: none;
}

.uploads-page #uploadsTable tbody tr {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.uploads-page #uploadsTable tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.uploads-page #uploadsTable tbody td:last-child {
    border-bottom: none;
}

.uploads-page #uploadsTable tbody td::before {
    content: attr(data-label);
    font-weight: bold;
    margin-right: 0.5rem;
}

.uploads-page #uploadsTable .image-preview {
    max-width: 100px;
    max-height: 100px;
}

.uploads-page #uploadsTable .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.uploads-page .sticky-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0.625rem 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.uploads-page .sticky-container .btn {
    width: 100%;
}

.uploads-page {
    padding-bottom: 4rem;
}

/* Media Queries */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }

    .btn {
        width: auto;
        margin-right: 0.625rem;
    }

    .navbar-nav {
        flex-direction: row;
    }

    .nav-item {
        width: auto;
    }

    #topStoresContainer {
        padding: 1rem;
    }

    .top-store-item {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .store-rank-and-name {
        font-size: 1.2rem;
    }
    
    .store-avg-pay {
        font-size: 1.1rem;
    }
    
    .store-total-pickups {
        font-size: 0.95rem;
    }

    #batch-controls button {
        margin-bottom: 0;
        margin-right: 0.625rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }

    body {
        font-size: 18px;
    }

    h1 {
        font-size: 2rem;
    }

    .upload-page .custom-file-upload,
    .upload-page #upload-button {
        height: 2.375rem;
    }

    .uploads-page #uploadsTable thead {
        display: table-header-group;
    }

    .uploads-page #uploadsTable tbody tr {
        display: table-row;
        border: none;
        background-color: transparent;
        margin-bottom: 0;
        padding: 0;
    }

    .uploads-page #uploadsTable tbody td {
        display: table-cell;
        text-align: left;
        padding: 0.75rem;
        border-bottom: 1px solid #dee2e6;
    }

    .uploads-page #uploadsTable tbody td::before {
        display: none;
    }

    .uploads-page .sticky-container {
        position: sticky;
        bottom: 0;
    }

    .uploads-page {
        padding-bottom: 0;
    }

    #orderCount {
        text-align: right;
    }
    
    .national-gig-stats-page .platform-card {
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }

    .uploads-page .main-container {
        max-width: 960px;
        margin: 0 auto;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .uploads-page .main-container {
        max-width: 1140px;
    }
}

.user-stats-pay {
    padding-left: 110px;
    margin-top: -10px;
    color: #007bff;
}

/* National Gig Stats Page Styles */
.national-gig-stats-page .platform-card {
    margin-bottom: 1.5rem; /* Changed from 2rem to 1.5rem to match Bootstrap's g-4 class */
}

.national-gig-stats-page #platformSummary {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.national-gig-stats-page #platformSummary > div {
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

@media (min-width: 768px) {
    .national-gig-stats-page #platformSummary > div {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

/* Rest of the national gig stats styles remain the same */
.national-gig-stats-page .card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #007bff;
    padding: 0.75rem 1.25rem;
}

.national-gig-stats-page .card-title {
    margin-bottom: 0;
    color: #007bff;
    font-size: 1.5rem;
    font-weight: bold;
}

.national-gig-stats-page .card-body {
    padding: 1.25rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: bold;
}

.card-text {
    font-size: 1rem;
}

.highlight {
    color: #28a745;
    font-weight: bold;
}

/* Add these new styles */
.national-gig-stats-page .pay-pickup-container {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.national-gig-stats-page .pay-pickup-row {
    display: flex;
    align-items: center;
}

.national-gig-stats-page .pay-pickup-label {
    min-width: 85px;
    font-weight: bold;
    margin-right: 0.5rem;
}

.national-gig-stats-page .pay-pickup-values {
    display: flex;
    flex-direction: column;
}

.national-gig-stats-page .national-pay,
.national-gig-stats-page .user-pay {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.national-gig-stats-page .user-pay {
    color: #28a745;
    font-weight: bold;
}

.national-gig-stats-page .pay-value {
    flex: 1;
    text-align: center;
}


.national-gig-stats-page .national-pay {
    color: #ffc107;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

/* Update existing styles */
.national-gig-stats-page .card-body {
    padding: 1.25rem;
}

.card-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.highlight {
    color: #28a745;
    font-weight: bold;
}

/* Media query for smaller screens */
@media (max-width: 576px) {
    .national-gig-stats-page .pay-pickup-label {
        min-width: 70px;
    }
}