/* KrishEducation LMS - Components v2.0 */
/* Premium UI Components with Animations */

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-md); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; transition: all var(--transition-normal); border: 1px solid transparent;
  position: relative; overflow: hidden; font-family: inherit;
}
.btn::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 5px; height: 5px;
  background: rgba(255,255,255,0.5); border-radius: 50%; transform: translate(-50%, -50%) scale(0);
  transition: transform 0.5s ease;
}
.btn:active::after { transform: translate(-50%, -50%) scale(20); opacity: 0; transition: transform 0.3s; }
.btn-primary {
  background: var(--gradient-blue); color: #fff; border: none;
  box-shadow: 0 4px 15px rgba(59,130,246,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(59,130,246,0.4); filter: brightness(1.1); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: rgba(71,85,105,0.3); color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: rgba(71,85,105,0.5); color: var(--text-primary); border-color: var(--text-muted); transform: translateY(-1px); }
.btn-success { background: var(--gradient-emerald); color: #fff; box-shadow: 0 4px 12px rgba(16,185,129,0.25); }
.btn-success:hover { box-shadow: 0 6px 20px rgba(16,185,129,0.35); transform: translateY(-1px); }
.btn-danger { background: linear-gradient(135deg, #EF4444, #DC2626); color: #fff; box-shadow: 0 4px 12px rgba(239,68,68,0.25); }
.btn-danger:hover { box-shadow: 0 6px 20px rgba(239,68,68,0.35); transform: translateY(-1px); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  padding: 24px; transition: all var(--transition-normal);
  backdrop-filter: blur(12px); position: relative;
  animation: fadeInUp 0.5s ease-out both;
}
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: var(--gradient-glass); pointer-events: none; z-index: 0;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); border-color: var(--border-glow); }
.card > * { position: relative; z-index: 1; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.card-title { font-size: 1rem; font-weight: 700; background: var(--gradient-blue); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.85rem; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); color: var(--text-primary); font-size: 0.9rem; font-family: inherit;
  transition: all var(--transition-normal); backdrop-filter: blur(4px);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15), 0 0 20px rgba(59,130,246,0.08);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394A3B8'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input-group { position: relative; }
.password-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1rem; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px;
  border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600;
  backdrop-filter: blur(4px); animation: scaleIn 0.3s ease both;
}
.badge-blue { background: rgba(59,130,246,0.15); color: #60A5FA; border: 1px solid rgba(59,130,246,0.2); }
.badge-green { background: rgba(16,185,129,0.15); color: #34D399; border: 1px solid rgba(16,185,129,0.2); }
.badge-amber { background: rgba(245,158,11,0.15); color: #FBBF24; border: 1px solid rgba(245,158,11,0.2); }
.badge-red { background: rgba(239,68,68,0.15); color: #F87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-purple { background: rgba(139,92,246,0.15); color: #A78BFA; border: 1px solid rgba(139,92,246,0.2); }

/* ===== TABLE ===== */
.table-container { overflow-x: auto; border-radius: var(--radius-md); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: rgba(15,23,42,0.7); }
.data-table th { padding: 14px 16px; text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid rgba(71,85,105,0.12); font-size: 0.88rem; transition: background var(--transition-fast); }
.data-table tbody tr { transition: all var(--transition-fast); }
.data-table tbody tr:hover { background: rgba(59,130,246,0.04); }

/* ===== AVATAR ===== */
.avatar {
  width: 42px; height: 42px; border-radius: var(--radius-full);
  background: var(--gradient-blue); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.7rem; }

/* ===== STATUS DOTS ===== */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-online { background: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); animation: pulse 2s infinite; }
.status-offline { background: var(--text-muted); }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  background: rgba(15,23,42,0.95); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px); animation: fadeInRight 0.4s ease-out;
  font-size: 0.88rem; min-width: 280px;
}
.toast-success { border-left: 3px solid var(--accent-emerald); }
.toast-error { border-left: 3px solid var(--accent-rose); }
.toast-info { border-left: 3px solid var(--accent-blue); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: var(--radius-xl); width: 100%; max-width: 480px; padding: 28px;
  box-shadow: var(--shadow-lg); animation: scaleIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; transition: color var(--transition-fast); }
.modal-close:hover { color: var(--text-primary); }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 260px; background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color); z-index: 100; display: flex; flex-direction: column;
  backdrop-filter: blur(20px); transition: transform var(--transition-normal);
  animation: fadeInLeft 0.4s ease-out;
}
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border-color); }
.sidebar-brand { font-size: 1.15rem; font-weight: 800; background: var(--gradient-blue); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; color: var(--text-secondary);
  border-radius: var(--radius-md); margin-bottom: 3px; font-weight: 500; font-size: 0.88rem;
  transition: all var(--transition-normal); position: relative; overflow: hidden;
}
.nav-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gradient-blue); border-radius: 0 3px 3px 0; transform: scaleY(0);
  transition: transform var(--transition-spring);
}
.nav-item:hover { color: var(--text-primary); background: rgba(59,130,246,0.08); transform: translateX(3px); }
.nav-item.active { color: var(--accent-blue); background: rgba(59,130,246,0.1); font-weight: 600; }
.nav-item.active::before { transform: scaleY(1); }
.nav-icon { font-size: 1.1rem; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border-color); }

/* ===== MAIN CONTENT ===== */
.main-content { margin-left: 260px; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 50; padding: 16px 28px;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(6,10,20,0.8); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color); animation: fadeInDown 0.4s ease-out;
}
.topbar-title { font-size: 1.15rem; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.page-content { padding: 28px; animation: fadeInUp 0.5s ease-out; }
.menu-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.3rem; cursor: pointer; }

/* ===== GRID ===== */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== PROGRESS BAR ===== */
.progress-bar { height: 8px; background: rgba(71,85,105,0.2); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill {
  height: 100%; background: var(--gradient-blue); border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); position: relative;
}
.progress-fill::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 30px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  animation: shimmer 2s infinite;
}

/* ===== LOADER ===== */
.loader {
  display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite;
}
.page-loader { display: flex; justify-content: center; align-items: center; padding: 60px; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 48px 20px; animation: fadeInUp 0.5s ease-out; }
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; animation: float 3s ease-in-out infinite; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 0.88rem; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
  padding: 16px; background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-color); animation: fadeInDown 0.4s ease-out;
}

/* ===== TABS ===== */
.tabs {
  display: flex; gap: 4px; margin-bottom: 20px; background: rgba(15,23,42,0.5);
  padding: 4px; border-radius: var(--radius-lg); border: 1px solid var(--border-color);
}
.tab {
  padding: 10px 20px; border-radius: var(--radius-md); font-weight: 500; font-size: 0.85rem;
  cursor: pointer; transition: all var(--transition-normal); border: none; background: none;
  color: var(--text-secondary); font-family: inherit;
}
.tab.active { background: var(--gradient-blue); color: #fff; box-shadow: 0 2px 8px rgba(59,130,246,0.3); }
.tab:not(.active):hover { color: var(--text-primary); background: rgba(71,85,105,0.2); }

/* ===== TIMELINE ===== */
.timeline { position: relative; }
.timeline::before { content: ''; position: absolute; left: 16px; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, var(--accent-blue), var(--accent-purple), transparent); }
.timeline-item {
  position: relative; padding-left: 44px; padding-bottom: 20px;
  animation: fadeInLeft 0.4s ease-out both;
}
.timeline-item::before {
  content: ''; position: absolute; left: 11px; top: 4px; width: 12px; height: 12px;
  background: var(--accent-blue); border-radius: 50%; border: 2px solid var(--bg-primary);
  box-shadow: 0 0 8px rgba(59,130,246,0.4);
}
.timeline-time { font-size: 0.75rem; color: var(--text-muted); }
.timeline-content { font-size: 0.88rem; margin-top: 4px; }

/* ===== BRANDING FOOTER ===== */
.branding-footer {
  text-align: center; padding: 28px 20px; margin-top: 40px;
  border-top: 1px solid var(--border-color);
  background: linear-gradient(180deg, transparent, rgba(59,130,246,0.02));
  animation: fadeInUp 0.6s ease-out;
}
.branding-footer p { color: var(--text-muted); font-size: 0.82rem; margin: 2px 0; }
.dev-name { font-weight: 700; background: var(--gradient-blue); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-size: 0.9rem; }

/* ===== USER ROW ===== */
.user-row { display: flex; align-items: center; gap: 12px; }

/* ===== CHECKBOX ===== */
.checkbox-group { display: flex; align-items: center; gap: 8px; margin: 16px 0; }
.checkbox-group input[type="checkbox"] { accent-color: var(--accent-blue); width: 16px; height: 16px; cursor: pointer; }

/* ===== UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed var(--border-color); border-radius: var(--radius-lg);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: all var(--transition-normal); position: relative; overflow: hidden;
}
.upload-zone::before {
  content: ''; position: absolute; inset: -2px; border-radius: inherit;
  background: conic-gradient(from 0deg, var(--accent-blue), var(--accent-purple), var(--accent-emerald), var(--accent-blue));
  opacity: 0; transition: opacity var(--transition-normal); z-index: -1;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent-blue); background: rgba(59,130,246,0.04); }
.upload-zone:hover::before { opacity: 0.1; }
.upload-icon { font-size: 3rem; margin-bottom: 12px; animation: float 3s ease-in-out infinite; }

/* ===== APPROVAL CARD ===== */
.approval-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal); animation: fadeInUp 0.4s ease-out both;
}
.approval-card:hover { background: rgba(59,130,246,0.03); padding-left: 8px; }
.approval-info { display: flex; align-items: center; gap: 12px; }
.approval-actions { display: flex; gap: 8px; }

/* ===== TERMS BOX ===== */
.terms-box {
  max-height: 200px; overflow-y: auto; padding: 16px; background: var(--bg-input);
  border-radius: var(--radius-md); margin-bottom: 16px; font-size: 0.85rem;
  line-height: 1.8; color: var(--text-secondary);
}

/* ===== STAGGERED ANIMATIONS for grid children ===== */
.grid > *:nth-child(1) { animation-delay: 0s; }
.grid > *:nth-child(2) { animation-delay: 0.05s; }
.grid > *:nth-child(3) { animation-delay: 0.1s; }
.grid > *:nth-child(4) { animation-delay: 0.15s; }
.grid > *:nth-child(5) { animation-delay: 0.2s; }
.grid > *:nth-child(6) { animation-delay: 0.25s; }
.grid > *:nth-child(7) { animation-delay: 0.3s; }
.grid > *:nth-child(8) { animation-delay: 0.35s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; }
  .page-content { padding: 16px; }
}
