/** @format */

body {
	padding: 5px;
	font-family: 'Montserrat', Helvetica, Arial, sans-serif;
	font-size: 18px;
	background-color: rgb(255, 255, 238);
	overflow: scroll;
	height: auto;
}

h1 {
	font-size: 40px;
	margin: 10px;
}

.header-container {
	position: relative;
	text-align: center;
}

h2 {
	font-size: 30px;
	text-align: center;
}

h3 {
	font-size: 20px;
	text-align: left;
}

h3, p {
	margin: 1em 5em 0 5em;
}

.leftControlBox {
	position: absolute;
	left: 0px;
	top: 0px;
	font-size: 12px;
	padding-left: 10px;
}

.rightControlBox {
	position: absolute;
	right: 0px;
	top: 0px;
	font-size: 12px;
	padding-right: 10px;
}

th,
td {
	padding: 10px;
	text-align: center;
	border: 1px solid black;
}

input[type=checkbox] {
    transform: scale(1.5);
}

.modal {
  display: none; 
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}

.modal .buttons {
  display: flex;
  justify-content: space-between; /* buttons to edges */
  margin-top: 20px;               /* some spacing from form fields */
}

.modal .buttons .button {
  flex: 0 0 auto; /* don't stretch buttons */
}

/* +++ WELCOME PAGE +++ */
#albums {
	float: left;
	width: 45%;
	overflow: auto;
	padding-left: 2%;
	height: 50%;
}
#serverInfo {
    position: fixed;           /* stays in one place */
    bottom: 0;                 /* at the very bottom */
    left: 0;
    width: 100%;               /* span full width */
    color: #666;               /* grey text */
    font-size: 12px;           /* small print */
    padding: 5px 10px;         /* some breathing room */
    text-align: center;        /* center the text */
    border-top: 1px solid #ddd;/* subtle top border */
    z-index: 1000;             /* stay on top */
  }

.albumList td {
	border-collapse: collapse;
	text-align: left;
	border-style: none;
	border: 0;
	padding-bottom: 0;
}

/* +++ ADMIN PAGE +++ */
.userInput {
	font-size: 16px;
	text-align: left;
	display: block;
	margin: 0 auto;
	width: 120px;
}

.userList {
	font-size: 16px;
	width: 95%;
	border-collapse: collapse;
	margin: 0 auto;
	max-height: 400px;
  	overflow-y: auto;
}

.userList tr:hover {
	background-color: coral;
}

.userList td, userList th {
	text-align: left;
}

.userList thead th {
	background-color: wheat;	
	position: sticky;
	top: 0;
}

.userList td:first-child,
.userList td:nth-child(7),
.userList td:nth-child(8) {
	text-align: center;
}

.modal-content {
  background: rgb(211, 235, 235);
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.close {
  float: right;
  font-size: 24px;
  cursor: pointer;
}

.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
}

.form-row label {
  width: 100px;  /* adjust for alignment */
}

.form-row input,
.form-row div {
  flex: 1;
  font-size: 16px;
}

.form-row input[type="checkbox"] {
  flex: 0;                 /* don’t stretch checkbox */
  margin-left: 0;          /* align to left of column */
  transform: scale(1.5);   /* optional: make it a bit bigger */
  margin-top: 0;           /* center vertically */
}

/* +++ SETTINGS PAGE +++ */
.settingsTable {
	width: 80%;
	padding: 20px;
	border-collapse: collapse;
	border-spacing: 0;
	margin: 0 auto;
}

.settingsTable th {
	background-color: wheat;
}

.settingsInput {
	font-size: 20px;
	text-align: center;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
}

/* +++ ALBUM PICKER PAGE +++ */
.albumPicker {
	width: 80%;
	padding: 20px;
	border-collapse: collapse;
	border-spacing: 0;
	margin: 0px auto;
}

.albumPicker th,
.albumPicker td {
	text-align: left;
}

.albumPicker th {
	background-color: wheat;
}

.albumPicker th:nth-child(3),
.albumPicker td:nth-child(3) {
	text-align: center;
}

/* +++ LOG VIEWER PAGE +++ */
.logViewer {
	width: calc(100vw - 40px);
	padding: 0 20px;
	table-layout: inherit;
	border-collapse: collapse;
	box-sizing: border-box;
	margin: 0 auto;
	font-size: clamp(10px, 1vw, 22px);
}

.logViewer tr:hover {
	background-color: coral;
}

.logViewer th {
	position: sticky;
	top: 0;
	background-color: wheat;
	text-align: left;
}

.logViewer td {
	text-align: left;
	border-bottom: 1px solid cornsilk;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.logViewer td:nth-last-child(1),
th:nth-last-child(1) {
	max-width: 60vw;
}

.payload-cell {
    white-space: nowrap; /* prevent wrapping */
    overflow-x: auto;    /* horizontal scroll */
    display: block;      /* required for overflow to take effect */
	/* Hide scrollbar but keep scroll functionality */
	scrollbar-width: none;       /* Firefox */
  	-ms-overflow-style: none;    /* IE/Edge */
}

.payload-cell::-webkit-scrollbar {
  display: none;  /* Chrome, Safari */
}

#scrollArea {
	width: 100%;
	height: 600px;
	overflow-y: scroll;
	border: none;
}

select#logType {
	position: absolute;
	right: 0px;
	top: 0px;
	margin: 0.5rem;
	font-size: 30px;
	padding-right: 10px;
	width: 100px;
}

/* +++ GALLERY +++ */
select#selectAlbum {
	position:relative;
	left: 0px;
	top: 0px;
	margin: 0.5rem;
	font-size: 50px;
	padding-right: 10px;
	width: 300px;
}
.album-toolbar {
    display: flex;
    align-items: center;     /* vertically center */
    justify-content: space-between; /* push left + right apart */
    gap: 10px;               /* small spacing */
    margin-bottom: 10px;
  }

  .album-toolbar select {
    margin-left: 5px;
  }

  .album-toolbar .button {
    margin-left: auto;       /* ensures button goes to far right */
  }

div#gallery {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 20px;
}
 span#photoFileName {
	display: inline-block;
	max-width: 200px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
 }

img#modalImg {
	max-width: 90%;
	max-height: 90%;
	border: 4px solid white;
	border-radius: 4px;
}

.thumb {
	max-width:200px;
	max-height:200px;
	display:block;
	margin-bottom:5px;
	cursor:pointer;
	border: 4px solid transparent
}

.thumb.selected {
  border: 4px solid red;               /* highlight */
}

#modal .prev,
#modal .next {
  position: absolute;
  top: 50%;
  background-color: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 30px;
  padding: 10px 15px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
  transform: translateY(-50%);
  text-decoration: none;
}

#modal .prev { left: 20px; }
#modal .next { right: 20px; }

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

/* Dropdown content (hidden by default) */
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #5c7cbc;
  min-width: 100%;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.3);
  z-index: 1;
  flex-direction: column;
  border-radius: 0 0 10px 10px;
}

/* Links inside dropdown */
.dropdown-content a {
  display: block;
  padding: 10px;
  color: white;
  text-decoration: none;
  width: 100%;
}

.dropdown-content a:hover {
  background: #e44e4e;
  width: 88%;
}

/* Show dropdown on hover */
.dropdown:hover .dropdown-content {
  display: block;
}

/* Optional: style arrow */
.dropbtn::after {
  content: " ▾";
  font-size: 0.8em;
}

/* +++ INPUT FORMS +++ */
label {
	padding: 12px 12px 12px 0;
	display: inline-block;
}

.form-container {
  display: flex;
  gap: 20px; /* space between the two textareas */
  justify-content: center;
  align-items: flex-start;
  margin: 20px 0;
}

.form-item {
  display: flex;
  flex-direction: column; /* label on top of textarea */
}

.form {
	display: flex;
	flex-direction: row;
	width: fit-content;
	margin: 0px auto;
	text-align: left;
}

.text {
  font-family: monospace;
  font-size: 14px;
  padding: 8px;
  resize: vertical; /* allow vertical resizing only */
}

.login {
	margin: 100px auto 20px auto;
	width: fit-content;
}

.login .button {
	display: block;
	margin: 0 auto 10px;
}

.form-row {
	display: flex;
	align-items: center; /* Vertical center */
	margin-bottom: 10px;
}

.form-row label {
	width: 150px; /* fixed width for alignment */
	margin-right: 10px; /* spacing between label and input */
	text-align: right; /* optional: aligns text to right side of label box */
}

.loginInput {
	font-size: 20px;
	flex: 1;
	padding: 5px;
	box-sizing: border-box;
}

/* +++ STANDARD BUTTONS +++ */
.button {
	border: none;
	background-color: rgb(215, 202, 202);
	color: rgb(224, 60, 60);
	padding: 10px 26px;
	font-size: 18px;
	font-weight: bold;
	cursor: pointer;
	border-radius: 12px;
	display: inline-block;
	margin: 0;
}

.button:hover {
	background-color: rgb(152, 163, 222);
	transition: 0.7s;
}

.buttons {
	display: flex;
	width: 90%;
	position: static;
	padding-top: 30px;
}
