/* General body */
body {
  font-family: 'Open Sauce One', -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 20px;
  font-size: 16px; /* base font */
}

/* FIX: invalid selector text removed */
h2 {
  display: block;
  font-size: 1.7em;
  margin-block-start: 0.3em;
  margin-block-end: 0.3em;
  margin-inline-start: 0;
  margin-inline-end: 0;
  font-weight: bold;
  unicode-bidi: isolate;
}

/* Banner */
.full-banner {
  width: 100%;          /* FIX: let container control width */
  overflow: hidden;
}

.banner-img {
  display: block;
  width: 100%;          /* FIX: scale with container */
  height: auto;
  max-width: 100%;
}

/* (Removed stray extra brace here) */

.content-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

/* Header area */
header {
  background-color: #2c2d36;
  padding: 0.3rem;
  text-align: center;
}

header table {
  width: 100%;          /* FIX: match container width */
}

/* Banner text */
.banner {
  color: white;
  padding: 12px 15px;
  margin-bottom: 12px;
  border-radius: 6px;
  font-size: 1.1em;
}

/* Password container */
.password-container {
  max-width: 300px;
  margin: 100px auto;
  text-align: center;
  border-radius: 6px;
}

#loginForm {
  margin:30px;
}

.password-container input,
.password-container button {
  width: 100%;
  padding: 20px;
  font-size: 1em;
  box-sizing: border-box;
  display: block;
}

.password-container input
{  font-color: black;}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #afafaf;   /* FIX: add style */
  border-radius: 4px;
}

.password-wrapper input {
  width: 100%;
  padding: 15px;
  padding-right: 40px; /* space for icon */
  font-size: 1em;
  box-sizing: border-box;
  border: none;                      /* inside wrapper border */
  outline: none;
}

.toggle-password {
  position: absolute;
  right: 10px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  color: #666;
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: #000;
}

/* File list container */
#fileList {
  font-family: inherit;
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 800px;
  font-size: 1.2em; /* base font for file list */
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
}

/* --- GRID LAYOUT FOR ROWS + HEADER (single source of truth) --- */
#fileList li,
#fileList li.file-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto; /* name | size | actions/icon */
  align-items: center;          /* FIX: 'left' is invalid; center contents */
  gap: 0.75rem;
  padding: 8px 10px;
}

/* Alternate row backgrounds (exclude header) */
#fileList li:not(.file-list-header):nth-child(even) { background-color: #f9f9f9; }
#fileList li:not(.file-list-header):nth-child(odd)  { background-color: #ffffff; }

/* Header style */
#fileList li.file-list-header {
  font-weight: 600;
  background: #eef2f6;
}

/* Header text */
#fileList li.file-list-header span {
  font-size: 1em;
  font-weight: 700;
}

/* Make the first column (filename) shrinkable with ellipsis */
#fileList .file-name {
  min-width: 0;               /* allow shrinking inside grid */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  padding: 10px;
}

/* Prevent utility columns from collapsing & keep them vertically centered */
#fileList .file-size,
#fileList .cache-icon,
#fileList button,
#fileList .link-style {
  white-space: nowrap;
  display: inline-flex;       /* removes baseline wobble */
  align-items: center;
}

/* File size cell */
.file-size {
  font-family: inherit;
  color: #2c2d36;
  font-size: 0.98em;
  margin-left: 10px;
  text-align: right;
  padding: 8px;
}

/* Cache icon column */
.cache-icon {
  display: inline-flex;       /* FIX: inline-flex for vertical centering */
  justify-content: center;
  align-items: center;
  width: 60px;                /* adjust as needed */
  margin-right: 0;
  flex-shrink: 0;
  font-size: 1em;
  white-space: nowrap;
  border: none;
}

/* Remove image/icon baseline gaps inside cache icon */
.cache-icon img,
.cache-icon svg {
  display: block;
  height: 1em;
  width: auto;
}

/* --- Alignment normalizer to keep rows perfectly straight --- */
#fileList li > *,
#fileList li.file-list-header > * {
  align-self: center;
  margin: 0;                 /* kill stray top/bottom margins */
  line-height: 1.2;          /* consistent line-height */
}


/* Links */
#fileList li a {
  font-family: inherit;
  text-decoration: none;
  color: #00b2ef;
  font-weight: 500;
  word-break: break-word;
  text-decoration: underline;
}
#fileList li a:hover { text-decoration: underline; }

/* Buttons (cache/refresh, etc.) */
button {
  font-family: inherit;
  padding: 20px 30px;
  font-size: 1.05em;   
  border-radius: 0px;
  cursor: pointer;
  background-color: #00b2ef;
  border: none;
  
   transition: background-color 0.2s ease; /* smooth hover effect */
}


/* Optional hover/focus state */
button:hover,
button:focus {
  background-color: #0e95e0; /* SafetySpear brand blue */
  font-color: #ffffff ;
    transition: background-color 0.2s ease; /* smooth hover effect */
}

/* Link-style button (Logout) */
.link-style {
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 0 10px;   /* left spacing only */
  font: inherit;
  color: #00b2ef;
  text-decoration: underline;
  cursor: pointer;
}
.link-style:hover {
  color: #2c2d36;
}

/* Responsive: tablets */
@media (max-width: 1024px) {
  #fileList {
    max-width: 95%;
    font-size: 0.98em;
  }
  .banner {
    font-size: 1em;
    padding: 10px 12px;
  }
  button {
    font-size: 1em;
  }
  .file-size {
    font-size: 0.95em;
  }
  .cache-icon {
    font-size: 0.9em;
  }
  #fileList li.file-list-header {
    padding: 0; /* FIX: keep header aligned at tablet size too */
    font-size: 1em;
  }
  .link-style {
    font-size: 1em;
  }
}


/* Extra small phones — keep a single row, just scale down */
@media (max-width: 600px) {
  #fileList {
    width: 95%;
    font-size: clamp(0.9em, 2.8vw, 0.95em);
  }

  /* Keep the same grid, just tighten spacing and sizes */
  #fileList li,
  #fileList li.file-list-header {
    /* DO NOT stack — remove any flex-direction: column */
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.5rem;
    align-items: left;
    padding: 8px 10px; /* compact for touch while fitting */
  }

  /* Filename stays on one line with ellipsis (set in base rules) */

  .file-size {
    margin: 0; /* avoid pushing to new lines */
    font-size: clamp(0.9em, 2.5vw, 1em);
  }

  .cache-icon {
    width: auto;            /* avoid fixed width causing wraps */
    font-size: 0.9em;
  }

  .banner {
    font-size: clamp(0.9em, 3vw, 0.95em);
    padding: 10px 14px;
  }

  button {
    font-size: clamp(0.9em, 3vw, 1em);
    padding: 8px 12px;
    border: none;
  }

  .link-style {
    font-size: clamp(0.9em, 3vw, 1em);
    margin: 0;                 /* keep on the same row */
    display: inline-block;     /* avoid wrapping weirdness */
  }

  .password-container input,
  .password-container button {
    font-size: clamp(0.95em, 3.2vw, 1.1em);
    padding: 8px 10px;
    border: none;
    padding-top: 20px;
  }
}


/* below CSS from ChatGPT as banner width fix - committed by Hannah */ 

/* Optional: declare a single source of truth for content width */
:root { --content-max: 800px; }

/* Content containers */
.content-wrapper,
#fileList,
.full-banner,
header table {
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Banner wrapper: just constrain + hide overflow if ever needed */
.full-banner {
  overflow: hidden;
}

/* Banner image: scale with its container, never exceed it */
.banner-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* Header area */
header {
  background-color: #2c2d36;
  padding: 0.3rem;
  text-align: center;
}

/* (Remove previous 70% widths) */
/* header table { width: 100%; }  <-- handled by the grouped rule above */

/* File list stays at the same max width */
#fileList {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: var(--content-max);
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1em;
  line-height: 1.5;
}



#passwordMessage {
  padding-top: 50px;
}


