/* Page loader - hide content until loaded */
body > *:not(#page-loader) {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

body.loaded > *:not(#page-loader) {
    opacity: 1;
}

/* Base styles for editable elements */
.editable {
  transition: background-color 0.2s;
  padding: 0.5rem;
  border-radius: 0.25rem;
  min-height: 1.5rem;
  user-select: none;
  position: relative;
}

/* Hover state */
.editable:hover {
  background-color: rgba(59, 130, 246, 0.1);
  cursor: pointer;
}

/* Editing textarea */
.editing {
  font-size: 0.875rem;
  color: #374151;
  resize: vertical;
}

/* Tab links styling */
[data-tab] {
  cursor: pointer;
}

/* Modal styling */
.modal {
  display: none;
  position: fixed;
  padding: 16px;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 0.2s ease-out;
  justify-content: center;
  align-items: center;
}

.modal.open {
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background-color: #fefefe;
  border: 1px solid #888;
  width: 100%;
  max-width: 600px;
  max-height: 100%;
  border-radius: 0.5rem;
  transform-origin: center;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.7);
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
  align-self: auto;
  margin: 0;
}

.modal.open .modal-content {
  transform: scale(1);
  opacity: 1;
}

/* UI elements */
.close {
  margin-left: auto;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.rotate-180 {
  transform: rotate(180deg);
}

/* Reorder animations */
.reorder-move-up {
    animation: moveUp 0.15s ease-out;
}

.reorder-move-down {
    animation: moveDown 0.15s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes moveUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateY(-20px);
        opacity: 0.7;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes moveDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateY(20px);
        opacity: 0.7;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Smooth list transitions */
.assigned-exercises-container li {
    transition: all 0.15s ease;
}