/* Enhanced styles for Almira's Database Learning Website */

/* Base styles and variables */
:root {
  --primary-gradient: linear-gradient(to right, #4a00e0, #8e2de2);
  --secondary-gradient: linear-gradient(to right, #00c6ff, #0072ff);
  --accent-gradient: linear-gradient(to right, #f857a6, #ff5858);
  --success-gradient: linear-gradient(to right, #00b09b, #96c93d);
  --dark-bg: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --glow-purple: 0 0 15px rgba(142, 45, 226, 0.6);
  --glow-blue: 0 0 15px rgba(0, 114, 255, 0.6);
  --glow-pink: 0 0 15px rgba(248, 87, 166, 0.6);
  --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Global styles */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  color: white;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

/* Navigation styles */
.nav-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: white;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 80%;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: 0.375rem;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Pulse button animation */
.pulse-button {
  position: relative;
}

.pulse-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background: inherit;
  opacity: 0.7;
  z-index: -1;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* 3D Floating Database Elements */
.database-element {
  transform-style: preserve-3d;
  perspective: 1000px;
  animation: float 6s infinite ease-in-out;
}

.database-element:nth-child(2) {
  animation-delay: -1.5s;
}

.database-element:nth-child(3) {
  animation-delay: -3s;
}

.database-element:nth-child(4) {
  animation-delay: -4.5s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

.database-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--glow-purple);
  transition: all 0.3s ease;
}

.database-icon:hover {
  transform: scale(1.1) rotate(5deg);
}

.table-icon {
  background: var(--primary-gradient);
}

.query-icon {
  background: var(--secondary-gradient);
}

.relation-icon {
  background: var(--accent-gradient);
}

.key-icon {
  background: var(--success-gradient);
}

.database-label {
  text-align: center;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Module Cards */
.module-card {
  background-color: var(--card-bg);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  transition: all 0.5s var(--transition-bounce);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.module-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.module-card.active {
  border: 1px solid rgba(142, 45, 226, 0.5);
  box-shadow: var(--glow-purple);
}

.module-card.locked {
  opacity: 0.7;
}

.module-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.2);
}

.module-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--primary-gradient);
  box-shadow: var(--glow-purple);
}

.module-card.active .module-icon {
  animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
  0%, 100% {
    box-shadow: 0 0 15px rgba(142, 45, 226, 0.6);
  }
  50% {
    box-shadow: 0 0 25px rgba(142, 45, 226, 0.9);
  }
}

.module-body {
  padding: 1.5rem;
}

.module-lessons {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.module-lessons li {
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
}

.module-lessons li:hover {
  transform: translateX(5px);
}

.module-lessons li.completed {
  color: #96c93d;
}

.module-lessons li.active {
  color: #f857a6;
  font-weight: 600;
}

.lesson-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.module-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.module-progress {
  height: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.module-progress .progress-bar {
  height: 100%;
  background: var(--success-gradient);
  border-radius: 3px;
  transition: width 1.5s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.module-button {
  display: block;
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.module-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-purple);
}

.module-button.locked {
  background: #4b5563;
  cursor: not-allowed;
}

/* Feature Cards */
.feature-card {
  background-color: var(--card-bg);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  transition: all 0.5s var(--transition-bounce);
  border: 1px solid rgba(255, 255, 255, 0.1);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
  background: var(--secondary-gradient);
  box-shadow: var(--glow-blue);
}

.feature-card:nth-child(2) .feature-icon {
  background: var(--accent-gradient);
  box-shadow: var(--glow-pink);
}

.feature-card:nth-child(3) .feature-icon {
  background: var(--success-gradient);
  box-shadow: 0 0 15px rgba(0, 176, 155, 0.6);
}

.feature-card h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.feature-card p {
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.feature-button {
  padding: 0.75rem 1.5rem;
  background: var(--secondary-gradient);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  align-self: center;
}

.feature-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-blue);
}

.feature-card:nth-child(2) .feature-button {
  background: var(--accent-gradient);
}

.feature-card:nth-child(2) .feature-button:hover {
  box-shadow: var(--glow-pink);
}

.feature-card:nth-child(3) .feature-button {
  background: var(--success-gradient);
}

.feature-card:nth-child(3) .feature-button:hover {
  box-shadow: 0 0 15px rgba(0, 176, 155, 0.6);
}

/* Avatar Animation */
.avatar-container {
  position: relative;
}

.avatar-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: var(--glow-purple);
}

.avatar-inner {
  font-size: 5rem;
  font-weight: 900;
  color: white;
}

.avatar-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--primary-gradient);
  opacity: 0.5;
  filter: blur(20px);
  animation: pulse-avatar 3s infinite;
}

@keyframes pulse-avatar {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.3;
  }
}

/* Challenge Card */
.challenge-card {
  background-color: var(--card-bg);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  transition: all 0.5s var(--transition-bounce);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 600px;
  margin: 0 auto;
}

.challenge-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.challenge-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.2);
}

.challenge-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--accent-gradient);
  box-shadow: var(--glow-pink);
  animation: rotate 10s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.challenge-body {
  padding: 1.5rem;
}

.challenge-rewards {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.reward {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

.reward-icon {
  color: #f857a6;
}

.challenge-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.challenge-button {
  padding: 0.75rem 1.5rem;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.challenge-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-pink);
}

/* Footer styles */
.footer-link {
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: white;
  transform: translateX(5px);
  display: inline-block;
}

/* Notification System */
.notification {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-left: 4px solid #8e2de2;
  animation: slide-in 0.5s forwards;
  transform: translateX(100%);
}

@keyframes slide-in {
  to {
    transform: translateX(0);
  }
}

.notification.success {
  border-left-color: #00b09b;
}

.notification.error {
  border-left-color: #ff5858;
}

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

.notification-title {
  font-weight: 600;
}

.notification-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .database-element {
    transform: scale(0.8);
  }
  
  .avatar-circle {
    width: 140px;
    height: 140px;
  }
  
  .avatar-inner {
    font-size: 4rem;
  }
  
  .avatar-glow {
    width: 160px;
    height: 160px;
  }
}

@media (max-width: 640px) {
  .database-element {
    transform: scale(0.7);
  }
  
  .challenge-rewards {
    flex-direction: column;
  }
}
