:root {
  --primary: #4361ee;
  --primary-light: #4895ef;
  --secondary: #3f37c9;
  --dark: #1a1a2e;
  --light: #f8f9fa;
  --success: #4cc9f0;
  --danger: #f72585;
  --warning: #f8961e;
  --border-radius: 12px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background-color: #f5f7fb;
  color: var(--dark);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.logo i {
  font-size: 1.8rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--secondary);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: white;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: #d31667;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

.flashcard-form {
  background-color: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.actions-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  align-items: center;
}

.stats {
  font-size: 0.9rem;
  color: #777;
}

.flashcards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.flashcard {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.flashcard:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.flashcard-content {
  padding: 1.5rem;
  position: relative;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.flashcard-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.flashcard-body {
  color: #555;
}

.flashcard-actions {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
}

.flashcard-actions button {
  background: none;
  border: none;
  color: #777;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

.flashcard-actions button:hover {
  color: var(--primary);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  grid-column: 1 / -1;
}

.empty-state i {
  font-size: 3rem;
  color: var(--primary-light);
  margin-bottom: 1rem;
}

.empty-state button i {
  font-size: 1rem;
  margin-bottom: 0;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.empty-state p {
  color: #777;
  margin-bottom: 1.5rem;
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--dark);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
  z-index: 1001;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background-color: var(--success);
}

.toast.error {
  background-color: var(--danger);
}

.study-mode {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.study-mode.active {
  opacity: 1;
  pointer-events: all;
}

.study-card {
  background-color: white;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  min-height: 400px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.study-card.flipped {
  transform: rotateY(180deg);
}

.study-card-front,
.study-card-back {
  position: absolute;
  backface-visibility: hidden;
  padding: 2rem;
  text-align: center;
}

.study-card-back {
  transform: rotateY(180deg);
}

.study-card h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

.study-card p {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 2rem;
}

.close-study {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #777;
  cursor: pointer;
}

.close-study:hover {
  color: var(--danger);
}
