:root {
  --color-background: #141c27;
  --color-background-secondary: #171e2b;
  --color-background-tertiary: #111721;

  --color-foreground: #e4ecff;
  --color-foreground-secondary: #b0b8c7;
  --color-accent: #90959d;
  --color-muted: #58636e;
  --color-border: #212730;

  --color-primary: #5f88fe;
  --color-on-primary: #e1e9f7;

  --color-secondary: #6a5bfd;
  --color-on-secondary: #e1e9f7;

  --color-blue: #192231;
  --color-blue-text: #6e8dbb;
  --color-on-blue: #6e8dbb;

  --color-green: #609397;
  --color-green-text: #609397;
  --color-on-green: #053535;

  --color-red: #311919;
  --color-red-text: #bb6e6e;
  --color-on-red: #bb6e6e;

  --color-purple: #804582;
  --color-purple-text: #b483b6;
  --color-on-purple: #d2b5f3;

  --color-orange: #712f1b;
  --color-orange-text: #b6837c;
  --color-on-orange: #e08f5c;
}

/* MAIN LAYOUT */
body {
  display: flex;
  gap: 1rem;
  background-color: var(--color-background);
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--color-foreground);
}

body.sidebar-open main {
  overflow-y: hidden;
}

main {
  flex: 1;
  max-height: 100dvh;
  overflow-y: auto;
}

main .content {
  padding: 0 1rem;
}

main .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
}

main .top div {
  display: flex;
  align-items: center;
  gap: 1rem;
}

main .top h1 {
  font-weight: 500;
  font-size: 1.75rem;
}

main .top #sidebar-toggle {
  display: none;
}

.profile-img {
  border-radius: 50%;
  width: 32px;
  height: 32px;
  object-fit: cover;
}

.profile-img-container {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
  min-width: 32px;
  max-width: 32px;
  min-height: 32px;
  max-height: 32px;
  color: var(--color-on-primary);
  font-size: 1rem;
}

/* LOCKED */
.locked {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  width: 100%;
  height: 100dvh;
}

.locked .icon-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
  width: 100px;
  height: 100px;
}

.locked .icon-wrapper i {
  color: var(--color-on-primary);
  font-size: 5rem;
}

.locked h1 {
  color: var(--color-foreground);
  font-size: 2rem;
}

.locked p {
  color: var(--color-foreground-secondary);
  font-size: 1.25rem;
  text-align: center;
}

/* LOGIN */
.login {
  display: flex;
  justify-content: center;
  align-items: center;
}

.login .card {
  width: 100%;
  max-width: 400px;
}

/* CARDS */
.card {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background-color: var(--color-background-secondary);
  padding: 1rem;
}

.card .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  width: 100%;
}

.card .header .title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.card .header .title h2 {
  font-weight: 500;
  font-size: 1.25rem;
}

.card .header .title .icon-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
  width: 2rem;
  height: 2rem;
  color: var(--color-on-primary);
  font-size: 1.1rem;
}

.card .header .title span {
  margin-left: 0.5rem;
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* TOAST */
.toast {
  display: flex;
  position: fixed;
  right: 20px;
  bottom: 20px;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transform: translateY(10px);
  opacity: 0;
  z-index: 9999;
  animation: fadein 0.4s forwards;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  min-width: 250px;
  max-width: 90%;
  overflow: hidden;
  font-size: 0.875rem;
}

.toast.fadeout {
  animation: fadeout 0.4s forwards;
}

.toast .icon-btn {
  color: inherit !important;
  font-size: 1.1rem;
}

.toast .progress {
  position: absolute;
  bottom: 0;
  left: 0;
  animation: progress 5s linear forwards;
  width: 100%;
  height: 4px;
}

.toast.info {
  background-color: var(--color-blue);
  color: var(--color-on-blue);
}

.toast.info .progress {
  background-color: var(--color-on-blue);
}

.toast.success {
  background-color: var(--color-green);
  color: var(--color-on-green);
}

.toast.success .progress {
  background-color: var(--color-on-green);
}

.toast.error {
  background-color: var(--color-red);
  color: var(--color-on-red);
}

.toast.error .progress {
  background-color: var(--color-on-red);
}

@keyframes fadein {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeout {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(10px);
    opacity: 0;
  }
}

@keyframes progress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* SETTINGS */
.edit-profile-picture {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
}

.edit-profile-picture .profile-img,
.edit-profile-picture .profile-img-container {
  width: 100px;
  height: 100px;
}

.edit-profile-picture .right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.edit-profile-picture .right .actions {
  display: flex;
  gap: 0.5rem;
}

.edit-profile-picture .right p {
  color: var(--color-accent);
  font-size: 0.8rem;
}

/* SESSIONS */
.sessions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.session {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0;
}

.session .details {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;
}

.session .details h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-foreground);
  font-weight: 500;
  font-size: 0.875rem;
}

.session .details p {
  color: var(--color-foreground-secondary);
  font-size: 0.875rem;
}

.session:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* MODAl */
#modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  width: fit-content;
  min-width: 500px;
  max-width: 90%;
  height: fit-content;
  min-height: 200px;
  max-height: 90%;
  overflow: auto;
}

#modal.active {
  display: flex;
}

#modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 100%;
}

#modal-overlay.active {
  display: block;
}

/* TABLES */
table thead {
  color: var(--color-foreground);
}

table th:first-child {
  border-radius: 8px 0 0 8px;
}

table th:last-child {
  border-radius: 0 8px 8px 0;
}

table thead th {
  background-color: var(--color-background-tertiary);
  padding: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-align: start;
}

table tbody {
  color: var(--color-foreground-secondary);
}

table tbody tr td {
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem;
  font-size: 0.875rem;
  text-align: start;
}

table tbody tr:last-child td {
  border-bottom: none;
}

table .links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  text-align: right;
}

/* ASSETS */
#assets-list .assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

#assets-list .assets-grid .asset-card {
  background-color: var(--color-background-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
}

.assets-grid .asset-card .file-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}

.assets-grid .asset-card .file-image:has(i) {
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
}

.assets-grid .asset-card .file-image i {
  font-size: 3rem;
  color: var(--color-muted);
}

.assets-grid .asset-card .description {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.assets-grid .asset-card .description h3 {
  color: var(--color-foreground);
  font-size: 1rem;
  font-weight: 500;
}

.assets-grid .asset-card .description .title p, 
.assets-grid .asset-card .description .title h3 {
  max-height: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assets-grid .asset-card .description p {
  color: var(--color-foreground-secondary);
  font-size: 0.875rem;
  flex-grow: 1;
}

.assets-grid .asset-card .description .details {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* MEDIA */
@media screen and (max-width: 1200px) {
  main .top #sidebar-toggle {
    display: block;
  }

  main .top {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-background-secondary);
    padding: 0.5rem 1rem;
  }

  main .top h1 {
    font-size: 1.2rem;
  }

  main .content {
    padding: 1rem;
  }
}

@media screen and (max-width: 768px) {
  .card .header span {
    display: none;
  }

  .toast {
    top: 20px;
    bottom: auto;
    transform: translateY(-10px);
    width: 100%;
    height: fit-content;
  }

  .edit-profile-picture {
    flex-direction: column;
    width: 100%;
  }

  .edit-profile-picture .right .actions {
    flex-direction: column;
    width: 100%;
  }

  .edit-profile-picture .right .actions button,
  .edit-profile-picture .right {
    width: 100%;
  }

  .edit-profile-picture .right p {
    text-align: center;
  }

  #modal {
    width: 90%;
    min-width: 0;
    max-width: 100%;
  }

  table .remove {
    display: none;
  }
}

@media screen and (max-width: 480px) {
  #modal {
    border-radius: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
  }
}
