/* Style flash messages */

.flash-messages {
  position: fixed;
  top: 10px; /* Distance from the top of the window */
  left: 50%;
  transform: translateX(-50%); /* Center the messages horizontally */
  z-index: 2000; /* Ensure the messages appear above other content */
  width: 90%; /* Adjust width as needed */
  max-width: 400px; /* Set a max-width for better presentation */
}

.flash-message {
  padding: 10px 20px;
  margin-bottom: 10px;
  border-radius: 5px;
  color: #721c24;
  opacity: 1; 
  transition: opacity 0.5s ease; 
  animation: fadeOut 2s forwards; 
}

.flash-message {
  padding: 10px;
  margin-bottom: 10px;
}

.flash-message.error {
  background-color: #f8d7da;
  color: #721c24;
}

.flash-message.success {
  background-color: #d4edda;
  color: #155724;
}

.flash-message.warning {
  background-color: #fff3cd;  
  color: #856404;             
}

/* Keyframes for fade-out animation */
@keyframes fadeOut {
  0% {
      opacity: 1; /* Fully visible */
      margin-top: 0; /* Keep the message in place */
  }
  80% {
      opacity: 1; /* Remain visible until near the end */
      margin-top: 0; /* Keep the message in place */
  }
  100% {
      opacity: 0; /* Fully transparent */
      margin-top: -7%; /* Move the message up so it doesn't block UI*/
  }
}

/* Navbar */
.navbar {
  background-color: #333333;
  padding:10px;
}

.navbar {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%; 
  background-color: #333333; 
  z-index: 1000; 
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem 2rem; 
  display: flex; 
  align-items: center;
  justify-content: space-between; 
}

.navbar ul {
  list-style: none; 
  display: flex; 
  gap: 1.5rem; 
  margin: 0; 
  padding: 0; 
}

.navbar li a {
  color: #ffffff; 
  font-weight: bold;
  text-decoration: none; 
  font-size: 1rem; 
  padding: 0.5rem 1rem; 
  transition: background-color 0.3s ease, color 0.3s ease; 
  border-radius: 5px; 
}

/* Hover effect */
.navbar li a:hover {
  background-color: #555555; 
  color: #af5fd7;
  text-decoration: none;
}

body {
  padding-top: 60px;
  padding-left: 20px; 
}

.navbar li.logout-button{
  margin-left: auto;
}

.navbar li form button{
  background-color: #dc3545; 
  color: white;
  border: none;
  padding: 5px 15px;
  border-radius: 5px;
  cursor: pointer;
}

/* Dropdown stuff */
/*
.navbar .dropdown {
  position: relative;
  display: inline-block;
}

.navbar .dropbtn {
  color: #ffffff;
  font-weight: bold;
  text-decoration: none;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  border-radius: 5px;
}

.navbar .dropbtn:hover {
  background-color: #555555;
  color: #ffcc00;
}

.navbar .dropdown-content {
  display: none; 
  position: absolute;
  top: calc(100%); 
  left: 0;
  background-color: #333333;
  min-width: 180px; 
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  border-radius: 5px;
  overflow: hidden;
  padding: 5px 0; 
}

.navbar .dropdown-content li {
  display: block;
  text-align: left;
  padding: 0; 
}

.navbar .dropdown-content li a {
  color: #ffffff;
  padding: 15px 20px; 
  text-decoration: none;
  display: block;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar .dropdown-content li a:hover {
  background-color: #555555;
  color: #ffcc00;
}

.navbar .dropdown:hover .dropdown-content,
.navbar .dropdown-content:hover {
  display: block;
}
  */

.navbar .spacer {
  flex-grow: 10; 
}

.signout-btn {
  background-color: #dc3545; 
  color: white;
  padding: 5px 10px;
  text-decoration: none;
  margin-left: 10px;
  border-radius: 4px;
}

.signout-btn:hover {
  background-color: #bd2130;
}

/* Welcome container */
.welcome-container {
  position: absolute; 
  right: 80px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px; 
  color: #ffffff;
}

/* Welcome message text */
.welcome-message {
  font-size: 1rem;
  color: #ffffff;
}

/* Chart styling */
.chart-header {
  position: relative;
  height: 60px;
  margin-bottom: 10px;
}

.chart-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-size: 1.5rem;
}

.chart-menu-wrapper {
  position: absolute;
  top: 10px;
  right: 10px;
}

.chart-menu {
  position: relative;
  display: inline-block;
}

.download-btn {
  background-color: #6c757d;
  color: white;
  padding: 8px 14px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.95rem;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 5px;
  min-width: 150px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.dropdown-content a {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
}

.dropdown-content a:hover {
  background-color: #f2f2f2;
}

.chart-menu:hover .dropdown-content {
  display: block;
}

.chart-scroll-container {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100vw;
  border: 1px solid #ccc;
  padding-bottom: 10px;
}

/* ───────── Search bar ───────── */
.search-container{
  margin:20px 0;
  width:260px;
}
#file-search{
  padding:6px 10px;
  border:1px solid #ccc;
  border-radius:6px;
  width:100%;
}

/* ───────── Scrollable file window ───────── */
.file-window{
  max-height:300px;          /* fixed window size */
  overflow-y:auto;
  border:1px solid #ccc;
  border-radius:6px;
  padding:4px 0;
  width:260px;
}
.file-list{
  list-style:none;
  margin:0;
  padding:0;
}
.file-list li{ margin-bottom:4px; }

/* ───────── File item style & hover highlight ───────── */
.file-list a{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:4px;
  text-decoration:none;
  color:inherit;
  transition:background .2s;
}
.file-list a:hover{
  background:#eaeaea;        /* simple highlight, no pop‑out */
}

/* icons via pseudo‑element */
.file-list a::before{
  content: attr(data-filetype) " ";
  width:18px; height:18px;
  display:inline-block;
}
.file-list a[data-filetype="csv"]::before{ content:"📊"; }
.file-list a[data-filetype="json"]::before{content:"🗂"; }