/* VUIchallenge Styles */
:root {
  --primary: #fd85e4;
  --primary-light: #fe9de9;
  --secondary: #a155b9;
  --background: #111827;
  --card-bg: rgba(255, 255, 255, 0.7);
  --text: #1a202c;
  --text-secondary: #4a5568;
  --success: #65cdc9;
  --locked: #6b7280;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #ffffff 0%, #fef7ff 25%, #fdf2ff 50%, #fcecff 75%, #fae5ff 100%);
  color: var(--text);
  min-height: 100vh;
  background-attachment: fixed;
  line-height: 1.6;
}

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

.glass {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}

/* Header Styles */
header {
  text-align: center;
  padding: 2rem 0;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding: 1rem 2rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary);
}

.home-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  margin-bottom: 2rem;
}

.user-name {
  font-weight: 600;
  color: var(--text);
}

.logout-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Progress Styles */
.progress-container {
  width: 100%;
  border-radius: 15px;
  height: 24px;
  position: relative;
  margin-bottom: 0.2rem;
}

.progress-fill {
  height: 100%;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
}

.milestone-label {
  position: absolute;
  top: -2px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  transform: translateX(-50%);
  white-space: nowrap;
  line-height: 1;
}

.milestone-label-mobile {
  display: none;
  font-size: 0.6rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  line-height: 1;
}

#certificate-btn {
  background: linear-gradient(135deg, var(--success), #4ade80);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
}

#certificate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(101, 205, 201, 0.3);
}

/* Challenge Grid */
.challenge-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.challenge-card {
  padding: 1.5rem;
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.challenge-card.unlocked {
  cursor: pointer;
}

.challenge-card.locked {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.7;
}

.challenge-card.completed {
  border: 2px solid var(--success);
}

.challenge-card:hover.unlocked {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.challenge-completion-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--success);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.challenge-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.challenge-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.challenge-day {
  color: var(--text-secondary);
}

.status-completed {
  background-color: var(--success);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-block;
  margin-top: 4px;
}

.status-locked {
  color: var(--text-secondary);
}

/* Detail Page Styles */
.back-button {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  text-decoration: none;
  transition: all 0.3s ease;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.detail-card {
  padding: 2rem;
  margin-bottom: 2rem;
}

.challenge-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-title {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.challenge-description {
  margin-bottom: 2rem;
  line-height: 1.6;
  font-size: 1rem;
}

.tip-text {
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
  margin-bottom: 2rem;
}

.notes-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.notes-textarea {
  width: 100%;
  min-height: 100px;
  max-height: 200px;
  padding: 0.75rem;
  border: 2px solid rgba(253, 133, 228, 0.4);
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  resize: none;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  outline: none;
  transition: border-color 0.3s ease;
  margin-bottom: 1rem;
}

.notes-textarea:focus {
  border-color: var(--primary);
}

.save-notes-btn {
  background: var(--success);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.save-notes-btn:not(:disabled) {
  opacity: 1;
}

.save-notes-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(101, 205, 201, 0.3);
}

.notes-save-container {
  text-align: right;
}

/* Completion Section */
.completion-section {
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: center;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.completion-label {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text);
  font-weight: 500;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.completion-checkbox-wrapper {
  display: inline-block;
  background: none;
  border: none;
  margin: 0;
}

.custom-checkbox {
  width: 40px;
  height: 40px;
  border: 2px solid #ccc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  background: white;
}

/* Navigation Cards */
.navigation-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

.nav-card {
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.nav-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.nav-card.disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Coffee Footer */
.coffee-footer {
  padding: 1.5rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(253, 133, 228, 0.2);
}

.coffee-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.coffee-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  flex-shrink: 0;
}

.speech-bubble {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  padding: 1rem 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(253, 133, 228, 0.3);
  flex: 1;
  min-width: 200px;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-right: 12px solid rgba(255, 255, 255, 0.9);
  z-index: 2;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  left: -13px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-right: 13px solid rgba(253, 133, 228, 0.3);
  z-index: 1;
}

.speech-author {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.speech-message {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.coffee-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.coffee-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  border-top: 1px solid rgba(253, 133, 228, 0.2);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* Loading */
.loading {
  text-align: center;
  padding: 2rem;
  font-size: 1.2rem;
  color: var(--text-secondary);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 32, 44, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: white;
  padding: 1.5rem;
  z-index: 10000;
  border-top: 2px solid var(--primary);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cookie-text {
  flex: 1;
  min-width: 300px;
}

.cookie-text p {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.cookie-text a {
  color: var(--primary);
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.cookie-btn.accept:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.cookie-btn.decline {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn.decline:hover {
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
  }
  
  .cookie-buttons {
    width: 100%;
    justify-content: center;
  }
}

/* Modal Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .user-info {
    padding: 1rem;
  }
  
  .challenge-list {
    grid-template-columns: 1fr;
  }
  
  .coffee-content {
    flex-direction: column !important;
    text-align: center !important;
  }
  
  .speech-bubble {
    margin: 1rem 0 !important;
  }
  
  .speech-author {
    display: none !important;
  }
  
  .milestone-label:not(:first-child):not(:last-child) {
    display: none;
  }
  
  .milestone-label-mobile {
    display: block;
  }
}