* {
    box-sizing: border-box;
}

:root {
    --yellow: #F0B80E;
    --yellow-shade: #D49B0D;

    --gray-900: #191919;
    --gray-800: #212121;
    --gray-700: #262626;
    --gray-600: #2D2D2D;
    --gray-500: #3D3D3D;
    --gray-400: #4D4D4D;
    --gray-300: #666666;
    --gray-200: #808080;
    --gray-100: #A6A6A6;
    --gray-000: #BDBDBD;

    /* HANKO DEFAULT STYLES, DON'T RENAME ---------------------------*/
    /* Color Scheme */
    --color: #fff;
    --color-shade-1: var(--gray-300);
    --color-shade-2: var(--gray-200);

    --brand-color: var(--yellow);
    --brand-color-shade-1: var(--yellow-shade);
    --brand-contrast-color: var(--gray-900);

    --background-color: var(--gray-600);
    --error-color: #EA6962;
    --link-color: #20B574;

    /* Font Styles */
    --font-weight: 400;
    --font-size: 13px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;

    /* Border Styles */
    --border-radius: 2px;
    --border-style: solid;
    --border-width: 1px;

    /* Item Styles */
    --item-height: 34px;
    --item-margin: 0.5rem 0;

    /* Container Styles */
    --container-padding: 30px;
    --container-max-width: 410px;

    /* Headline Styles */
    --headline1-font-size: 24px;
    --headline1-font-weight: 600;
    --headline1-margin: 0 0 1rem;

    --headline2-font-size: 16px;
    --headline2-font-weight: 600;
    --headline2-margin: 1rem 0 0.5rem;

    /* Divider Styles */
    --divider-padding: 0 42px;
    --divider-visibility: visible;

    /* Link Styles */
    --link-text-decoration: none;
    --link-text-decoration-hover: underline;

    /* Input Styles */
    --input-min-width: 14em;

    /* Button Styles */
    --button-min-width: max-content;
    /* END HANKO DEFAULT STYLES ---------------------------*/

}

hanko-profile::part(headline1) {
  font-size: 16px;
  margin-bottom: 0px;
  margin-top: 1.75rem;
}
.hanko_paragraph {
  margin-top: 0px;
}
/* center login component on screen */
hanko-auth {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  padding: 1rem;
}

html, body {
    font-family: var(--font-family);
    color: #fff;
    background-color: var(--gray-700);
    font-size: var(--font-size);
}

button, input, select, textarea {
  font: inherit;
}

/* global styles --------------------- */
* {
  box-sizing: border-box;
}

hidden {
  display: none !important;
}

label, legend {
  color: var(--gray-100);
  margin-bottom: 0.25rem;
}
input[type="text"], textarea {
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-300);
  background-color: inherit;
  color: inherit;
  padding: 0.5rem;
}
input:not([type="radio"]), button {
  height: var(--item-height);
}
input[type="text"]:focus,
textarea:focus,
button:focus {
  outline: none; 
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}
input[type="text"]:disabled {
  border: none;
}
button {
  border-radius: var(--border-radius);
  border: none;
  background-color: var(--gray-400);
  color: inherit;
  padding: 0.6rem 1rem;
  transition: background 0.2s ease;
  font-weight: 500;
  cursor: pointer;
}
button:hover {
  background-color: var(--gray-500);
}
button.primary {
  background: var(--yellow);
  color: #000;
}
button.primary:hover {
  background: var(--yellow-shade);
}

/* DASHBOARD ----------------- */

body { margin: 0; }
.container {
  padding: 2rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.no-projects {
  color: var(--gray-100);
  text-align: center;
  font-style: italic;
  margin: 2rem 0;
  width: 100%;
}

.project-card {
  background: var(--gray-600);
  border: 1px solid var(--gray-500);
  padding: 1.2rem;
  border-radius: var(--border-radius);
  flex: 0 1 calc((100% - 1.5rem) / 2); /* two-column layout */
  min-width: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-card .title {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}

.project-card .desc {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
  color: var(--gray-100);
}

.project-card .time {
  font-size: 0.8rem;
  color: var(--gray-100);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.ellipsis-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.ellipsis-btn:hover {
  color: #fff;
}

/* HEADER BAR -----------------------*/
#header-bar {
  height: 35px;
  box-sizing: border-box;
  z-index: 1000;
  background-color: var(--gray-800);
  display: flex !important; /* override the web component loading display: none */
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  color: var(--gray-100);
  flex-shrink: 0;
}
#header-bar a {
  text-decoration: none;
  color: inherit;
}
#header-bar #logo {
    color: var(--yellow);
}
#header-bar svg {
  height: 1.2rem;
  width: auto;
  vertical-align: text-bottom;
  color: inherit;
}
#header-bar #nav-links {
  display: flex;
  gap: 2rem;
}

#header-bar .project-header button#edit-project {
  padding: 0 0.25rem;
}
#header-bar #nav-links > button,
#header-bar #nav-links > apptron-dropdown > button,
#header-bar .project-header button {
  cursor: pointer;
  background-color: inherit;
  color: inherit;
  padding: 0;
  vertical-align: middle;
}
#header-bar #nav-links > button:focus,
#header-bar #nav-links > apptron-dropdown > button:focus,
#header-bar .project-header button:focus {
  box-shadow: none;
}
.header-container {
  height: 35px;
}
.project-header .name {
  vertical-align: middle;
}
.project-header.private .name::before {
  content: "";
  display: inline-block;
  width: 1.1em; height: 1.1rem;
  vertical-align: middle;
  margin-right: 0.25rem;
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13 7H12V5C12 3.93913 11.5786 2.92172 10.8284 2.17157C10.0783 1.42143 9.06087 1 8 1C6.93913 1 5.92172 1.42143 5.17157 2.17157C4.42143 2.92172 4 3.93913 4 5V7H3L2 8V14L3 15H13L14 14V8L13 7ZM5 5C5 4.20435 5.31607 3.44129 5.87868 2.87868C6.44129 2.31607 7.20435 2 8 2C8.79565 2 9.55871 2.31607 10.1213 2.87868C10.6839 3.44129 11 4.20435 11 5V7H5V5ZM13 14H3V8H13V14Z" fill="currentColor"/></svg>') no-repeat center / contain;
  mask: url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13 7H12V5C12 3.93913 11.5786 2.92172 10.8284 2.17157C10.0783 1.42143 9.06087 1 8 1C6.93913 1 5.92172 1.42143 5.17157 2.17157C4.42143 2.92172 4 3.93913 4 5V7H3L2 8V14L3 15H13L14 14V8L13 7ZM5 5C5 4.20435 5.31607 3.44129 5.87868 2.87868C6.44129 2.31607 7.20435 2 8 2C8.79565 2 9.55871 2.31607 10.1213 2.87868C10.6839 3.44129 11 4.20435 11 5V7H5V5ZM13 14H3V8H13V14Z" fill="currentColor"/></svg>') no-repeat center / contain;
}

/* Dialog Styles ---------------------------*/
dialog#modal {
  position: fixed !important;
  /* anchored to top 25% of screen, not sure why this works */
  top: -25% !important;  
  font: inherit;
  background-color: var(--gray-600);
  border: 1px solid var(--gray-500);
  border-radius: var(--border-radius);
  padding: 2rem 3rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  color: #fff;
  z-index: 1000;
  pointer-events: auto !important;
  width: 464px;
}
dialog#modal::backdrop {
  background-color: rgba(0, 0, 0, 0.6);
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* this should match the hanko h1 that is used in the sign in dialog header */
#modal .dialog-header h2 {
  margin: 0;
  font-size: 24px;
  padding: 1rem 1rem 0 1rem;
}
.dialog-close {
    background: none;
    border: none;
    color: var(--gray-100);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}
.dialog-close:hover {
    color: #fff;
}

.dialog-body p {
    margin-top: 0;
    color: var(--gray-100);
}
.dialog-body input[type=text],
.dialog-body textarea, 
.dialog-body label {
  display: block;
  width: 100%;
}
.dialog-body input[type=text],
.dialog-body textarea,
.dialog-body fieldset {
  margin-bottom: 1.5rem;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 2rem;
}

/* Create project modal */
/* === Visibility fieldset === */
.visibility-group {
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* === Radio options === */
.radio-option {
  display: grid !important;
  grid-template-columns: auto 1fr;
  column-gap: 0.6rem;
  row-gap: 0.25rem;
  align-items: start;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}
.radio-option:hover {
  background-color: rgba(255, 255, 255, 0.05);
}
.radio-option input[type="radio"] {
  margin-top: 0.2rem; /* vertically aligns circle with title */
  accent-color: #2e7aff; /* blue highlight */
  cursor: pointer;
}
/* === Option text === */
.option-title {
  color: #fff;
}
.option-help {
  grid-column: 2;
  font-size: 0.85rem;
  color: #9a9a9a;
  line-height: 1.3;
}



/* otherwise there's too much space between the close button and the dialog contents... */
.auth-container {
  margin-top: -1rem;
}


/* Top bar login state */
#logout, #account, #dashboard, #account-dropdown, #edit-project {
  display: none !important;
}
.signedin #account,
.signedin #logout,
.signedin #dashboard,
.signedin #account-dropdown {
  display: block !important;
}
.signedin #edit-project {
  display: inline !important;
}
.signedin #signin {
  display: none !important;
}

/* Project header, if on project page state */
.project-header {
  display: none !important;
}
.project .project-header {
  display: block !important;
}

/* Dashboard popover menu */
.card-menu[popover] {
  color: inherit;
  font: inherit;
  min-width: 220px;
  padding: 0.5rem;
  background: var(--gray-600);
  border: 1px solid var(--gray-500);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

/* Menu items */
.menu-item {
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--border-radius);
}
.card-menu .menu-item:hover { background: var(--gray-500); }
.card-menu .menu-item.danger { color: #ffb4b4; }
.card-menu .menu-item.danger:hover { background: rgba(255, 80, 80, 0.12); }

#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  outline: none;
  pointer-events: none;
  font: inherit;
  color: #fff;
}

#loader .spinner {
  width: 200px;
  height: 200px;
  background-image: url("/img/loader.svg");
}

#loader.fade-out, #loader.fade-out::backdrop {
  animation: fadeOut 0.2s ease forwards;
}

#loader > * {
  pointer-events: none;
  user-select: none;
}


#loader::backdrop {
  background-color: var(--gray-700);
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}