@font-face {
  font-family: "Cuprum";
  src: url("/includes/fonts/Cuprum.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --main-dark: #2c3e50;
  --accent: #6e619e;
  --bg-color: #f7f9fc;
  --text-color: #2c3e50;
  --nav-icon: #888;
  --dynamic-content-bg: #f7f9fc;
  --card-content-icon: #2980b9;
}

.dark-theme {
  --bg-color: #2c3e50;
  --text-color: #f7f9fc;
  --nav-icon: #ccc;
  --dynamic-content-bg: #3a4b5d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.df { display: flex; }
.col { flex-direction: column; }
.aic { align-items: center; }
.jcc { justify-content: center; }
.jcb { justify-content: space-between; }
.start { justify-content: start; }
.end { justify-content: end; }
.g10 { gap: 10px; }
.align { text-align: center; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  background-color: var(--bg-color);
  font-family: "Cuprum", sans-serif;
  color: #2c3e50;
  position: relative;

  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);

  display: flex;
  justify-content: center;
}

.app-header {
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 15px;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  height: 60px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2;
  transition: background-color 0.3s, color 0.3s;
}

.app-header h1 {
  margin: 0;
  font-size: 1.8em;
  font-weight: 600;
  color: var(--text-color);
}

#changeThemeIcon {
  font-size: 1.8em;
  color: var(--text-color);
}

.app-content {
  position: absolute;
  top: 60px;
  bottom: calc(70px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background-color: var(--dynamic-content-bg);
  transition: background-color 0.3s, color 0.3s;
  
  display: flex;
  flex-direction: column;
}

.app-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#dynamic-content-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 15px;
}

#tools-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.content-section {
  display: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  flex-grow: 1;
}

.content-section.active {
  display: flex;
  flex-direction: column;
}

.card {
  position: relative;
  background-color: white;
  padding: 20px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: flex-start;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  cursor: grab;
}

.card-content {
  flex-grow: 1;
  width: 100%;
}

.card-content > img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}

.card-item {
  margin-bottom: 10px;
}

.card-item > a,
.card-item > a:active {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.card-item > .material-symbols-outlined {
  color: var(--card-content-icon);
  margin-right: 7px;
  font-size: 22px;
  font-variation-settings: 'wght' 300;
}

.card-content > h3 {
  text-align: center;
}

.card-title {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.5em;
  font-weight: 600;
  color: #4a5a70;
}

.card-text {
  line-height: 1.6;
  color: #666;
  font-size: 1em;
}

.app-footer-nav {
  background-color: var(--bg-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 5px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
  height: 70px;
  gap: 3px;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 2;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  transition: background-color 0.3s;
}

.nav-button {
  background: none;
  border: none;
  color: var(--nav-icon);
  padding: 5px 12px;
  font-size: 0.8em;
  cursor: pointer;
  transition: color 0.3s ease, background-color 0.3s ease;
  flex: 1 1 0px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.nav-button.active {
  color: var(--accent);
  font-weight: 500;
  background-color: #ede7f6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.nav-button .material-symbols-outlined {
  font-size: 26px;
  margin-bottom: 5px;
  font-variation-settings: 'wght' 100;
  transition: all 0.5s ease;
}

.nav-button.active .material-symbols-outlined {
  font-variation-settings: 'wght' 500;
  font-variation-settings: 'FILL' 1;
  animation: iconFillAnimation 0.5s ease;
}

@keyframes iconFillAnimation {
  from  { font-variation-settings: 'FILL' 0; }
  to    { font-variation-settings: 'FILL' 1; }
}

@media (min-width: 840px) {
  .app-header, .app-content, .app-footer-nav {
    width: 700px;
    margin: 0 auto;
    left: auto;
    right: auto;
  }
}

.loading-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-color);
  animation: loadContentAnimation 0.3s ease;
}

@keyframes loadContentAnimation {
  from { opacity: 0; }
  to { opacity: 1; }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  border-top-color: var(--text-color);
  animation: spinnerAnimation 1.2s ease-in-out infinite;
  margin-bottom: 30px;
}

@keyframes spinnerAnimation {
  to { transform: rotate(360deg); }
}