html, body {
  margin: 0;
  padding: 0;
}
/* headers */

.navbar {display: flex;justify-content:space-between;align-items: center;min-height: 70px;}

.navbar a {text-decoration: none;}

.nav-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2em;
  /* margin-left: -25px; */
}

.navbar a:hover {text-decoration: underline;}

.nav-links {
  display: flex;
  gap: 15px;
  justify-content: left;
  align-items: center;
  padding: 10px;
  font-size: x-large;
}

.nav-user {display: flex;position: absolute;right:0; justify-content: space-around;}

.nav-user span, .nav-user a {
  display: flex;
  vertical-align: middle;
  align-items: center;
}

.nav-user a {font-size: larger;}

.nav-username {font-weight: bold;font-size: larger;}

.nav-user img {
    vertical-align: middle;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 3px;
    margin-right: 15px;
}

/* portal content */

.portal-fronttext { /*basically the welcome text of login and portal main page*/
    text-align: center;
    margin: 3% 15%;
}

.portal-fronttext a {color: #984447}

.service-item {border-radius: 8px;}

.services-list  {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  gap: 1.5rem;
  padding: 1.2rem;
  white-space: nowrap;
  height: 100%; /* or a specific value like 300px */
  margin: auto 1%;
  max-height: 300px;
}

.services-list a {
  flex: 0 0 23%;
  max-width: 300px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  overflow-y: hidden;
}

.services-list article {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: auto;
  padding: 1rem;
  box-sizing: border-box;
  border-radius: 8px;
  min-height: auto;
  white-space: normal;
  font-size: 1.2em;
}

.services-list article h3 {font-size: 1.5em;margin-top: 0;}

.services-list img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: 8px;

}

.service-note {padding: 3px;}

.service-item p {
    margin-bottom: 36px;
    overflow-wrap: break-word;
    word-break: break-word; /* just in case */
    white-space: normal;
}

.services-list.dragging {cursor: grabbing;user-select: none;}

.text-section {
    text-align: center;
    font-size: 1.2em;
    margin: 20px auto;
    padding: 0;
    width: 97%;
    border-radius: 8px;
}


/* LOGIN PAGE */

/* CSS is clean here... because its not mine : https://www.codewithfaraz.com/content/6/create-a-pure-css-simple-login-page-html-and-css#css-code */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 6%;
}

.login-page {
    width: 29vw;
    background: white;
    border-radius: 10px;
    border: 1px solid  #281B1E;
    box-shadow: 3.0px 6.1px 6.1px hsl(0deg 0% 0% / 0.41);
}

.login-page h2 {
    text-align: center;
    padding: 0 0 20px 0;
    border-bottom: 1px solid silver;
    font-size: 2em;
}

.login-page form {padding: 0 40px;box-sizing: border-box;}

form .txt_field{
  position: relative;
  border-bottom: 2px solid #adadad;
  margin: 30px 0;
}

.txt_field input{
  width: 100%;
  padding: 0 5px;
  height: 40px;
  font-size: 16px;
  border: none;
  background: none;
  outline: none;
}

.txt_field label{
  position: absolute;
  top: 50%;
  left: 5px;
  color: #adadad;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}

.txt_field span::before{
  content: '';
  position: absolute;
  top: 40px;
  left: 0;
  width: 0px;
  height: 2px;
  background: #984447;
  transition: .5s;
}

.txt_field input:focus ~ label,.txt_field input:valid ~ label{top: -5px;color: #984447;}

.txt_field input:focus ~ span::before,.txt_field input:Valid ~ span::before{width: 100%;}


.submit-Button{
  width: 100%;
  height: 50px;
  border: 1px solid;
  border-radius: 25px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.submit-Button:hover{background: #984447;color: #e9f4fb;transition: .5s;}

.signup_link{
  margin: 30px 0;
  text-align: center;
  font-size: 16px;
  color: #666666;
}

.signup_link a{color: #984447;text-decoration: none;}

.signup_link a:hover{text-decoration: underline;}

.error-message {color: red;text-align: center;margin-top: 10px;}


/* no account page */

.image-container-noaccount {
    display: flex;
    justify-content: center;
    width: 100%;
}

#no-account-image {width: 60%;}

/* footer */

footer p {text-align: center;margin: 50px auto 25px auto;width: fit-content;font-size: 1.2em;}

footer a {text-decoration: none;color: #984447;}

/* General colors : */

body {background-color: #EDDDD4;} /*background color*/

.navbar {
    background-color: #281B1E; /*navbar (header bar)*/
    color: #245779; /*username color (when connected)*/
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.navbar a {color: white; /*text of navbar (except username when connected)*/}


.portal-fronttext {
    color: #281B1E; /* default color for the text of the portal page (welcome message) */
    font-size: 1.3em;
}

.portal-fronttext h1 {font-size: 1.1em;}

.admin-privileges {
    color:#984447; /*color of the "administrative privileges" text when connected as admin*/
}

#portal-message-admin {
    background-color: #984447; /*background of the admin text section (bottom of page before admin services)*/
    color: white; /*text of the text section*/
    border-color: #281B1E;
}

.service-item article {
    color: #245779; /* color of the text of the services*/
}

.service-item article h3 {
    color:#281B1E; /* color of the names of the services*/
}


.service-item {
    border: 1px solid #281B1E; /*border for the normal services*/
    box-shadow: 3.0px 6.1px 6.1px hsl(0deg 0% 0% / 0.41);
}

.service-item:hover {
    box-shadow: 0.6px 1.3px 1.3px hsl(0deg 0% 0% / 0.48); /* shadow when hovering over the services */
}

#admin-services .service-item{
    border-color: #984447; /*color of the border for the admin services (comment to keep the same as normal ones)*/
}

.text-section {
    background-color: #f0f0f0; /*background for the text section (normal one when a message is set)*/
    border: 2px solid #281B1E; /*border of all text section */
}


/* footer */

html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {flex: 1;padding: 1rem;}

footer {
  padding: 1rem;
  text-align: center;
  color: #281B1E;
}



/* Files page : */
.files-page {
  font-family: monospace;
  padding: 2rem;
  color: #281B1E;
}

.files-page h1 {font-size: 2.5em;margin-left: 6%;}

#directory-listing {
  list-style: none;
  padding: 0;
  margin: 0 5%;
  border: 2px groove #281B1E;
  overflow: hidden;
  border-style:outset;
}

#directory-listing li {margin: 0.25rem 0;font-size: 1.5em;}

#directory-listing a {
  text-decoration: none;
  padding: 0.5rem 1rem;
  display: inline-block;
  border-radius: 8px;
  transition: background 0.2s;

}

#directory-listing { margin: 1%; padding: 1%;}

#directory-listing .dir a {color: #245779;font-weight: bold;}

#directory-listing .file a {color: #281B1E;}

#directory-listing .dir a::before {content: "📁 ";}

#directory-listing .file a::before {content: "📄 ";}

#directory-listing .file {display: flex;justify-content: space-between;}

#directory-listing .file .downloadlink::before {content: "📦 ";}

#directory-listing .file .downloadlink {font-size: large;}

#directory-listing a:hover {background-color: #f0f0f0;}

/* upload page */

.upload-page {display: flex;justify-content: center;align-items: center;}

.upload-container {
  width: 100%;
  margin-right: 2%;
  margin-left: 1%;
}

.upload-targets {
  display: inline-flex;   
  width: 100%;
  margin: 0;
  justify-content: center;
  align-items: center;
  background: transparent;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  border-spacing: 0 50px;
  background: rgba(0,0,0,0.02);
}

.upload-targets input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.upload-targets .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 13%;
  font-size: 1.5rem;
  border-radius: 999px;  
  cursor: pointer;
  user-select: none;
  color: #281B1E;
  transition: background 160ms ease, transform 120ms ease, box-shadow 160ms ease;
  box-shadow: none;
}

.upload-targets .badge:hover,
.upload-targets .badge:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
  background-color: #984447;
}

.upload-targets input[type="radio"]:checked + label {background:#281B1E;color: white;}

 .upload-page input[type="file"] {display: none;}

.upload-page {margin: 5%;}

.upload-file {
  border: 2px solidX rgba(0,0,0,0.12);
  border-radius: 12px;
  background: linear-gradient(180deg, #af5154, #503239);
  margin: 7% 0 0;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, transform .08s;
  user-select: none;
  min-height: 110px;
  color: #edddd4;
}

.drop-content { display:flex; gap: 1rem; align-items:center; z-index:0; }
.drop-text .muted { font-size: .9rem; color: #af9585; margin-top:4px; }

.upload-file.dragover {
  border-color: #2563eb;
  box-shadow: 0 10px 30px rgba(37,99,235,0.08);
  transform: translateY(-2px);
}

.file-list { margin-top: .75rem; font-size: .95rem; color: #111; }
.file-item { display:flex; justify-content:space-between; align-items:center; gap: 0.75rem; padding: .45rem .6rem; border-radius: 8px; background: rgba(0,0,0,0.02); margin-bottom: .45rem; }
.file-item .name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:60%; }
.file-item .size { color: rgba(0,0,0,0.5); font-size:.85rem; }

.upload-actions { margin-top: .75rem; display:flex; gap:.6rem; }
.btn {
  background: #281B1E;
  color: #fff;
  border: none;
  padding: .55rem 0.9rem;
  border-radius: 12px;
  cursor: pointer;
}
.btn:disabled { background: #9bb7ff; cursor: not-allowed; }

@media (max-width:480px) {
  .upload-file { padding: .9rem; min-height:90px; }
  .file-item .name { max-width: 50%; }
}

input[type=radio]:disabled + label {
  opacity:0.5;
}