/* ============================================
   KARTU PELAJAR DIGITAL - SMKN 1 BUKITTINGGI
   Main Stylesheet
   ============================================ */

:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --secondary: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  --gradient-info: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
  --dark: #0f172a;
  --light: #f8fafc;
  --gradient-primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  --gradient-secondary: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
}

/* ============ NAVBAR ============ */
.navbar-custom {
  background: var(--gradient-primary);
  box-shadow: var(--shadow-md);
  padding: 0.8rem 0;
}

.navbar-custom .navbar-brand {
  color: white !important;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-custom .navbar-brand img {
  height: 40px;
}

.navbar-custom .nav-link {
  color: rgba(255,255,255,0.9) !important;
  font-weight: 500;
  transition: all 0.3s;
}

.navbar-custom .nav-link:hover {
  color: white !important;
  transform: translateY(-1px);
}

/* ============ LOGIN PAGE ============ */
.login-wrapper {
  min-height: 100vh;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-wrapper::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  top: -200px;
  right: -200px;
  animation: float 6s ease-in-out infinite;
}

.login-wrapper::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  bottom: -150px;
  left: -150px;
  animation: float 8s ease-in-out infinite reverse;
}

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

.login-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 450px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 10;
  animation: slideUp 0.6s ease-out;
}

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

.school-logo {
  width: 80px;
  height: 80px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  padding: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.school-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.login-title {
  text-align: center;
  color: var(--dark);
  font-weight: 700;
  margin-bottom: 5px;
}

.login-subtitle {
  text-align: center;
  color: #64748b;
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.form-control-custom {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 1rem;
  transition: all 0.3s;
}

.form-control-custom:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

.btn-primary-custom {
  background: var(--gradient-primary);
  border: none;
  padding: 12px 30px;
  border-radius: 12px;
  font-weight: 600;
  color: white;
  transition: all 0.3s;
  width: 100%;
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.role-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 25px;
}

.role-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  color: #64748b;
  transition: all 0.3s;
}

.role-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ============ DASHBOARD ============ */
.dashboard-header {
  background: var(--gradient-primary);
  color: white;
  padding: 30px 0;
  margin-bottom: 30px;
  border-radius: 0 0 30px 30px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 25px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s;
  border: none;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  margin-bottom: 15px;
}

.stat-icon.primary { background: var(--gradient-primary); }
.stat-icon.success { background: var(--gradient-success); }
.stat-icon.warning { background: var(--gradient-secondary); }
.stat-icon.danger { background: linear-gradient(135deg, #ef4444, #f87171); }
.stat-icon.info { background: linear-gradient(135deg, #06b6d4, #22d3ee); }

.stat-label {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 5px;
  font-weight: 500;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

.stat-progress {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* ============ TABLE ============ */
.content-card {
  background: white;
  border-radius: 16px;
  padding: 25px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.content-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.content-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

.table-custom {
  border-collapse: separate;
  border-spacing: 0;
}

.table-custom thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  padding: 15px;
}

.table-custom tbody td {
  padding: 15px;
  vertical-align: middle;
  border-top: 1px solid #f1f5f9;
}

.table-custom tbody tr:hover {
  background: #f8fafc;
}

.avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.badge-status {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success-soft { background: #dcfce7; color: #166534; }
.badge-warning-soft { background: #fef3c7; color: #92400e; }
.badge-danger-soft { background: #fee2e2; color: #991b1b; }
.badge-info-soft { background: #cffafe; color: #155e75; }

/* ============ UPLOAD AREA ============ */
.upload-area {
  border: 3px dashed #cbd5e1;
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #f8fafc;
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary);
  background: #eff6ff;
}

.upload-area i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 15px;
}

.upload-area p {
  margin: 0;
  color: #475569;
  font-weight: 500;
}

.upload-area small {
  color: #94a3b8;
}

/* ============ BUTTONS ============ */
.btn-gradient {
  background: var(--gradient-primary);
  border: none;
  color: white;
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-success-gradient {
  background: var(--gradient-success);
  border: none;
  color: white;
}

.btn-info-gradient {
  background: var(--gradient-info);
  border: none;
  color: white;
}

.btn-warning-gradient {
  background: var(--gradient-secondary);
  border: none;
  color: white;
}

/* ============ MODAL CROPPER ============ */
.cropper-container-custom {
  max-height: 500px;
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
}

/* ============ CHART CONTAINER ============ */
.chart-container {
  position: relative;
  height: 300px;
}

/* ============ ALERTS ============ */
.alert-custom {
  border: none;
  border-radius: 12px;
  padding: 15px 20px;
  border-left: 4px solid;
}

.alert-custom.alert-success {
  background: #dcfce7;
  color: #166534;
  border-left-color: var(--success);
}

.alert-custom.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border-left-color: var(--danger);
}

.alert-custom.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border-left-color: var(--warning);
}

/* ============ LOADER ============ */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  gap: 15px;
}

.loader-overlay.active {
  display: flex;
}

.spinner-custom {
  width: 60px;
  height: 60px;
  border: 5px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .login-card { padding: 25px; }
  .dashboard-header { padding: 20px 0; border-radius: 0 0 20px 20px; }
  .stat-value { font-size: 1.5rem; }
  .content-card { padding: 15px; }
  .table-custom thead { display: none; }
  .table-custom tbody td { display: block; padding: 8px; }
}

/* ============ ANIMATIONS ============ */
.fade-in {
  animation: fadeIn 0.5s ease-out;
}

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

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
