/* ==================== Root Variables ==================== */
:root {
  --primary: #288098;
  --dark: #212121;
  --accent: #00838F;
  --light: #bfd9dc;
  --white: #FFFFFF;
}

/* ==================== Base Styles ==================== */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background-color: var(--light);
  color: var(--dark);
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ==================== Headings ==================== */
h1, h2 {
  color: var(--primary);
  margin-top: 1em;
  text-align: center;
}

/* ==================== Navigation Bar ==================== */
nav.navbar {
  background-color: var(--primary);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1000;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-left a,
.nav-right a,
nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

.nav-left a:hover,
.nav-right a:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Hamburger Icon (Mobile Only) */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  margin-left: auto;
}

.hamburger div {
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 4px 0;
  border-radius: 2px;
  transition: 0.4s;
}

/* ==================== Forms (Updated for Alignment) ==================== */
.form-card {
  background-color: var(--white);
  padding: 1.5rem;
  border-radius: 10px;
  flex: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin: 1.5rem auto;
  max-width: 600px;
  min-width: 300px;
  width: 100%;
}

.form-card form {
  display: flex;
  flex-direction: column;
}

input[type="text"],
input[type="password"],
select,
input[type="file"] {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 1em;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background-color: #f9f9f9;
  font-family: inherit;
  font-size: 1rem;
  box-sizing: border-box;
  height: 44px; /* Match height across all inputs */
}

/* Make file input font look like regular input */
input[type="file"]::file-selector-button {
  padding: 0.2rem 0.4rem;
  background-color: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

input[type="file"]::file-selector-button:hover {
  background-color: rgba(8, 130, 152, 0.521);
}

/* Button Consistency */
button {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  background-color: var(--accent);
  border: none;
  border-radius: 6px;
  color: var(--white);
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: rgba(8, 130, 152, 0.521);
}

.file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ccc;
  padding: 10px 0;
}

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

.download-button {
  background-color: #2d89ef;
  color: white;
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  margin-right: 10px;
}

.download-button:hover {
  background-color: #1b5dbf;
}

.delete-button {
  background-color: #b22222;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.delete-button:hover {
  background-color: #8b0000;
}


.filename-pill {
  display: inline-block;
  background-color: #f1f1f1;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}


.file-name {
  font-style: italic;
  margin-left: 5px;
}

.upload-date {
  margin-left: 5px;
  color: #555;
  font-size: 0.85em;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin: 2rem auto;
  max-width: 1000px;
}

.drop-zone {
  border: 2px dashed #ccc;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  transition: border-color 0.3s;
}

.drop-zone.dragover {
  border-color: #007bff;
  background-color: #f1f9ff;
}

/* ==================== File List ==================== */
ul {
  list-style-type: none;
  padding: 0;
  max-width: 700px;
  margin: 2em auto;
}

ul li {
  background-color: var(--white);
  margin-bottom: 0.5em;
  padding: 1em;
  border-left: 5px solid var(--primary);
  box-shadow: 0 0 5px rgba(0,0,0,0.05);
}

/* ==================== Empty State ==================== */
.empty-state {
  text-align: center;
  background-color: var(--white);
  border-left: 5px solid var(--primary);
  margin: 2rem auto;
  padding: 1.5rem;
  max-width: 500px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  color: var(--dark);
  font-size: 1.1rem;
}

/* ==================== Buttons ==================== */
.logout-button {
  background-color: var(--accent);
  color: var(--white);
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.logout-button:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* ==================== Footer ==================== */
footer {
  text-align: center;
  padding: 1em;
  background-color: var(--primary);
  color: var(--white);
  margin-top: 2em;
}

/* ==================== Flash Messages ==================== */
.messages {
  max-width: 700px;
  margin: 1rem auto;
  padding: 0 1rem;
}

.alert {
  padding: 1em;
  border-radius: 4px;
  margin-bottom: 1em;
  font-weight: bold;
  opacity: 1;
  transition: opacity 1s ease-out;
}

.alert.success {
  background-color: #dff0d8;
  color: #3c763d;
}

.alert.error {
  background-color: #f2dede;
  color: #a94442;
}

.form-container {
  max-width: 600px;
  margin: 0 auto;
  background-color: #d0e7ea;
  padding: 40px;
  border-radius: 8px;
}

.help-text ul {
  list-style: none;
  padding-left: 0;
  margin-top: 1rem;
}

.help-text li {
  margin: 6px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-text li .icon {
  font-weight: bold;
  width: 20px;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  nav.navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  .nav-left,
  .nav-right {
    flex-direction: column;
    width: 100%;
    display: none;
    margin-top: 0.5rem;
  }

  .nav-left.show,
  .nav-right.show {
    display: flex;
  }

  .hamburger {
    display: flex;
    margin-left: auto;
  }

  .nav-left a,
  .nav-right form {
    margin: 0.5em 0;
  }

  .top-controls {
    flex-direction: column;
  }

  .form-card,
  .messages {
    padding: 0 1rem;
  }

  .logout-button,
  .delete-button,
  form button {
    width: 100%;
    box-sizing: border-box;
  }
}
