/* ============================================================
   PROFESSIONAL DASHBOARD ENHANCEMENTS
   Premium UI with modern animations and interactions
   ============================================================ */

/* == ENHANCED CARD STYLING == */
.stat-card,
.analytics-card,
.student-card,
.material-card,
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow:
    0 6px 20px rgba(47, 109, 246, 0.08),
    0 2px 8px rgba(10, 17, 33, 0.06);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::after,
.analytics-card::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* Card hover effects */
.stat-card:hover,
.analytics-card:hover,
.student-card:hover,
.material-card:hover,
.feature-card:hover {
  border-color: #2f6df6;
  box-shadow:
    0 16px 40px rgba(47, 109, 246, 0.2),
    0 8px 16px rgba(47, 109, 246, 0.12);
  transform: translateY(-6px);
}

/* == PROFESSIONAL STAT CARDS == */
.stat-card {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
}

.stat-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #eaf0ff 0%, #f0f7ff 100%);
  color: #2f6df6;
  box-shadow: 0 4px 12px rgba(47, 109, 246, 0.15);
}

.stat-card-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #8595b8;
  margin-bottom: 0.6rem;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  color: #0e1830;
  font-family: "Syne", sans-serif;
  letter-spacing: -0.8px;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-card-sub {
  font-size: 0.8rem;
  color: #8595b8;
}

/* == PROFESSIONAL BUTTONS == */
.btn {
  font-weight: 700;
  letter-spacing: 0.4px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--x, 50%) var(--y, 50%),
    rgba(255, 255, 255, 0.3),
    transparent 80%
  );
  opacity: 0;
  pointer-events: none;
}

.btn:active::before {
  opacity: 1;
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.btn-primary {
  background: linear-gradient(135deg, #2f6df6 0%, #1f4fc2 100%);
  color: white;
  box-shadow:
    0 8px 24px rgba(47, 109, 246, 0.3),
    0 4px 12px rgba(47, 109, 246, 0.15);
}

.btn-primary:hover:not(:disabled) {
  box-shadow:
    0 12px 36px rgba(47, 109, 246, 0.4),
    0 6px 16px rgba(47, 109, 246, 0.2);
  transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* == ANALYTICS CARDS == */
.analytics-card {
  padding: 2rem;
}

.analytics-card h3 {
  font-size: 1.2rem;
  color: #0e1830;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.analytics-card canvas {
  max-height: 300px !important;
}

/* == TABLE STYLING == */
.grade-table {
  width: 100%;
  border-collapse: collapse;
}

.grade-table th {
  background: #f6f9ff;
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  color: #0e1830;
  border: 1px solid #dce3f2;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.grade-table td {
  padding: 1rem;
  border: 1px solid #dce3f2;
  color: #2d3d57;
  font-weight: 500;
}

.grade-table tr:hover td {
  background: #f6f9ff;
}

/* == SKILL BARS == */
.skill-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.skill-bar-track {
  flex: 1;
  height: 10px;
  background: #eef2f8;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #dce3f2;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2f6df6 0%, #0ea5a3 100%);
  border-radius: 5px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 12px rgba(47, 109, 246, 0.2);
}

.skill-bar-percent {
  font-weight: 700;
  min-width: 35px;
  text-align: right;
  color: #2f6df6;
  font-size: 0.9rem;
}

/* == GRADE CIRCLE == */
.grade-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eaf0ff 0%, #f0f7ff 100%);
  border: 3px solid #2f6df6;
  box-shadow: 0 8px 24px rgba(47, 109, 246, 0.15);
}

.grade-circle-percent {
  font-size: 3.2rem;
  font-weight: 800;
  color: #2f6df6;
  line-height: 1;
}

.grade-circle-grade {
  font-size: 2rem;
  font-weight: 800;
  color: #1f4fc2;
  margin-top: 0.4rem;
}

/* == PROFESSIONAL ANIMATIONS == */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Apply staggered animations */
.page-header {
  animation: slideInLeft 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card {
  animation: slideInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}

.stat-card:nth-child(1) {
  animation-delay: 0.1s;
}
.stat-card:nth-child(2) {
  animation-delay: 0.2s;
}
.stat-card:nth-child(3) {
  animation-delay: 0.3s;
}
.stat-card:nth-child(4) {
  animation-delay: 0.4s;
}

.analytics-card {
  animation: slideInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}

.analytics-card:nth-child(1) {
  animation-delay: 0.25s;
}
.analytics-card:nth-child(2) {
  animation-delay: 0.35s;
}
.analytics-card:nth-child(3) {
  animation-delay: 0.45s;
}

/* == RESPONSIVE IMPROVEMENTS == */
@media (max-width: 1024px) {
  .stat-card {
    padding: 1.4rem 1.6rem;
    min-height: 145px;
  }

  .stat-card-value {
    font-size: 1.8rem;
  }

  .stat-card-icon {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 768px) {
  .stat-card {
    padding: 1.2rem 1.4rem;
    min-height: 130px;
  }

  .stat-card-value {
    font-size: 1.6rem;
  }

  .analytics-card {
    padding: 1.5rem 1.4rem;
  }

  .grade-circle {
    width: 120px;
    height: 120px;
  }

  .grade-circle-percent {
    font-size: 2.8rem;
  }

  .grade-circle-grade {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .stat-card {
    padding: 1rem 1.2rem;
    min-height: 120px;
  }

  .stat-card-value {
    font-size: 1.4rem;
  }

  .stat-card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }
}

/* == TOAST NOTIFICATIONS == */
.toast {
  border-radius: 14px;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
  animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-weight: 600;
}

.toast.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.toast.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.toast.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.toast.info {
  background: linear-gradient(135deg, #2f6df6 0%, #1e40af 100%);
  color: white;
}

/* == FORM INPUTS == */
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  border: 2px solid #dce3f2;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: #f9fbfd;
  color: #0e1830;
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: #2f6df6;
  background: white;
  box-shadow:
    0 0 0 4px rgba(47, 109, 246, 0.1),
    inset 0 0 0 1px #2f6df6;
  outline: none;
}

/* == BADGES == */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.8rem;
  background: linear-gradient(
    135deg,
    rgba(47, 109, 246, 0.1),
    rgba(14, 165, 163, 0.08)
  );
  color: #2f6df6;
}

/* == MODALS == */
.modal-box {
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.modal-overlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0e1830;
  margin-bottom: 1.2rem;
}

.modal-close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f9ff;
  border: 1px solid #dce3f2;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-close:hover {
  background: #dce3f2;
  transform: rotate(90deg);
}

/* == CHART COLORS == */
.chart-blue {
  color: #2f6df6;
}
.chart-teal {
  color: #0ea5a3;
}
.chart-purple {
  color: #7209b7;
}
.chart-pink {
  color: #ef476f;
}
