[v-cloak] {
  display: none;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar {
  position: fixed;

  top: 0;
  left: 0;

  width: 100%;
  height: 72px;

  background: white;

  display: flex;
  align-items: center;

  padding: 0 24px;

  box-shadow: 0 2px 10px rgba(0,0,0,0.08);

  z-index: 9999;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 32px;
  height: 32px;
}

body {
    font-family: sans-serif;
    max-width: 600px;
    margin: 40px auto;
    padding: 0 16px;
    padding-top: 72px;

    background-color: white;
}

/*learning flashcard design*/
.flashcard {
  border: 1px solid #ccc;
  padding: 24px;
  margin-top: 32px;
  border-radius: 10px;

  min-height: 220px;
  transition: opacity 0.2s ease;
}

/*learning button design*/
.controls {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

/* button container in the header */
.header-buttons {
  display: flex;
  gap: 12px;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 10px 18px;
  border-radius: 12px;

  font-size: 14px;
  font-weight: 600;

  transition:
    transform 0.15s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Add Card Button */
.add-button {
  background-color: #f4f4f4;
  color: #222;
}

.add-button:hover {
  background-color: #e9e9e9;
  transform: translateY(-1px);
}

/* Learning Button */
.learn-button {
  background-color: #4a90e2;
  color: white;
}

.learn-button:hover {
  background-color: #3d7fcc;
  transform: translateY(-1px);
}

/* Exit learning button */
.exit-button {
  background-color: #f4f4f4;
  color: #333;
}

.exit-button:hover {
  background-color: #e8e8e8;
  transform: translateY(-1px);
}

/* Correct button */
.correct-button {
  background-color: #e8f7ec;
  color: #1f7a3d;
}

.correct-button:hover {
  background-color: #d7f0df;
  transform: translateY(-1px);
}

/* Wrong button */
.wrong-button {
  background-color: #fdeaea;
  color: #b42323;
}

.wrong-button:hover {
  background-color: #f8d6d6;
  transform: translateY(-1px);
}

/* Tip button */
.tip-button {
  background-color: #fff7db;
  color: #8a6a00;
}

.tip-button:hover {
  background-color: #ffefb3;
  transform: translateY(-1px);
}

/* Click animation */
.action-button:active {
  transform: scale(0.97);
}

/* general button styling */
button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

/* dark background behind the modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);

  display: flex;
  justify-content: center;
  align-items: center;
}

/* modal window styling */
.modal {
  position: relative;
  overflow: hidden;

  background: #fff6bf;
  border-radius: 5px;

  padding: 36px;

  width: 100%;
  max-width: 500px;

  display: flex;
  flex-direction: column;
  gap: 18px;

  box-shadow:
    0 12px 40px rgba(0,0,0,0.12),
    0 2px 8px rgba(232,213,163,0.25);


}



/* input field styling */
.modal input,
.modal textarea {
  width: 100%;

  padding: 14px 16px;

  border-radius: 14px;
  border: 1px solid #ddd;

  font-size: 15px;
  font-family: inherit;

  background: #fff;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;

  box-sizing: border-box;
}

/* textarea size */
.modal textarea {
  min-height: 80px;
  resize: vertical;
}

/* button layout inside the modal */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* close button styling */
.close-modal-button {
  position: absolute;

  top: 12px;
  right: 12px;

  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  border: none;

  padding: 0;
  margin: 0;

  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;

  color: #888;

  cursor: pointer;

  border-radius: 50%;

  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.close-modal-button:hover {
  background-color: #f2f2f2;
  color: #111;
}

/* create button styling */
.create-button {
  align-self: flex-end;

  background: #4a90e2;
  color: white;

  border: none;
  border-radius: 14px;

  padding: 12px 22px;

  font-size: 15px;
  font-weight: 600;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;

  box-shadow: 0 4px 14px rgba(74,144,226,0.25);
}

.create-button:hover {
  background: #3d7fcc;
  transform: translateY(-1px);
}

/* error message styling */
.error-message {
  color: red;
}

/* Card overview grid */
.card-list {
  margin-top: 32px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card-preview {
  position: relative;
  border: 1px solid #ccc;
  border-radius: 14px;
  padding: 20px;
  background-color: white;
  min-height: 130px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  overflow-wrap: break-word;
  word-break: break-word;

}

.card-preview h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.card-preview p {
  margin-bottom: 0;
  line-height: 1.4;
}

/* show card state */
.card-preview.correct {
  border-color: green;
  border-width: 3px;
  background-color: rgba(0, 128, 0, 0.08);
}

.card-preview.wrong {
  border-color: red;
  border-width: 3px;
  background-color: rgba(255, 0, 0, 0.08);
}

.empty-message {
  color: gray;
  margin-top: 16px;
}

.scene {
  perspective: 1000px;
  width: 100%;
  height: 260px;
  margin-top: 24px;
  cursor: pointer;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-inner.flipped {
  transform: rotateY(180deg); /* flip animation */
}

.card-front, .card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 12px;
}

.card-front {
  background: #fffdf7;
  border: 1px solid #e8d5a3;
  box-shadow: 0 4px 20px rgba(232,213,163,0.2)
}

.card-back {
  background: #f0f4ff;
  border: 1px solid #b3c5f0;
  box-shadow: 0 4px 20px rgba(179,197,240,0.2);
  transform: rotateY(180deg);
} 

.card-label {
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c8a84b;
}

.card-back .card-label {
  color: #6b8fd4;
}

.card-text {
  font-size: 1.15rem;
  line-height: 1.5;
  text-align: center;
  color: #1a1a1a;
  margin: 0;

}

.card-hint {
  position: absolute;
  bottom: 1rem;
  font-size: 12px;
  color: #d4bc7a;
}

.card-tip {
  font-size: 0.9rem;
  color: #8a7040;
  text-align: center;
  margin: 0;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: #eee;
  border-radius: 99px;
  margin-top: 24px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #4a90e2;
  border-radius: 99px;
  transition: width 0.4s ease;
}

.progress-label {
  text-align: center;
  font-size: 13px;
  color: #aaa;
  margin: 8px 0 0;

}
/*delete button */
.delete-card-button {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
   color: #c62828;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
}

.delete-card-button:hover {
  font-weight: bold;
}