/* ===== VARIABLES & RESET ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #7c3aed;
  --accent: #f59e0b;
  --accent-alt: #10b981;
  --danger: #ef4444;
  --warning: #fbbf24;
  --success: #10b981;
  --light: #f8fafc;
  --light-gray: #f1f5f9;
  --gray: #64748b;
  --dark: #1e293b;
  --dark-blue: #0f172a;

  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-secondary: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --gradient-accent: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.2);
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --border-radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: "Inter", sans-serif;
  color: var(--dark);
  background-color: var(--light);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s;
}

.btn:hover::after {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-3px);
}

.btn-accent {
  background: var(--gradient-accent);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-accent:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
}

.logo-img {
  height: 50px;
  width: auto;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.logo-subtitle {
  font-size: 0.9rem;
  color: var(--gray);
  font-weight: 500;
}

.nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
}

.nav-link {
  color: var(--dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

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

.nav-link.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-profile {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--light-gray);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  min-width: 180px;
}

.user-btn:hover {
  background: var(--primary-light);
  color: white;
}

.user-btn:hover .user-icon {
  background: white;
  color: var(--primary);
}

.user-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.user-name {
  font-weight: 600;
  flex-grow: 1;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 280px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-xl);
  margin-top: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  z-index: 100;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-info {
  padding: 20px;
  border-bottom: 1px solid var(--light-gray);
}

.user-email {
  color: var(--gray);
  font-size: 0.9rem;
  margin-top: 5px;
}

.dropdown-links {
  padding: 15px;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  color: var(--dark);
  text-decoration: none;
}

.dropdown-link:hover {
  background: var(--light-gray);
  color: var(--primary);
}

.dropdown-link i {
  width: 20px;
  color: var(--primary);
}

.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--dark);
}

/* ===== PROFILE STYLES ===== */
.profile-container {
  padding: 120px 20px 80px;
  max-width: 1280px;
  margin: 0 auto;
}

.profile-header {
  background: white;
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: var(--shadow-md);
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
  flex-shrink: 0;
}

.profile-info h1 {
  font-size: 2rem;
  color: var(--dark-blue);
  margin-bottom: 5px;
}

.profile-info .nip {
  color: var(--gray);
  font-size: 1rem;
  margin-bottom: 10px;
}

.profile-info .badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--gradient-primary);
  color: white;
}

.profile-info .badge.gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

@media (max-width: 992px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: white;
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--light-gray);
}

.card-header h2 {
  font-size: 1.3rem;
  color: var(--dark-blue);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header .badge-count {
  background: var(--light-gray);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray);
}

.identitas-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 30px;
}

@media (max-width: 768px) {
  .identitas-list {
    grid-template-columns: 1fr;
  }
}

.identitas-item {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-bottom: 1px solid var(--light-gray);
}

.identitas-item .label {
  font-size: 0.8rem;
  color: var(--gray);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.identitas-item .value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
}

.rekap-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--light-gray);
  padding: 15px;
  border-radius: 12px;
  text-align: center;
}

.stat-box .number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-box .label {
  font-size: 0.8rem;
  color: var(--gray);
}

.rekap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.rekap-table th {
  background: var(--light-gray);
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  color: var(--dark);
}

.rekap-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--light-gray);
}

.rekap-table tr:hover {
  background: var(--light);
}

.tahun-filter {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tahun-filter select {
  padding: 8px 16px;
  border-radius: 8px;
  border: 2px solid var(--light-gray);
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
}

.chart-wrapper {
  position: relative;
  height: 350px;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--gray);
}

.loading .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--light-gray);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

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

/* ===== LOCKED OVERLAY ===== */
.locked-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.5s ease;
}

.locked-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.locked-content {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 60px 50px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.locked-content .lock-icon {
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.locked-content h2 {
  font-size: 2rem;
  color: var(--dark-blue);
  margin-bottom: 15px;
}

.locked-content p {
  font-size: 1.1rem;
  color: var(--gray);
  margin-bottom: 30px;
  line-height: 1.7;
}

.locked-content .btn {
  margin: 5px;
}

.locked-content .btn-secondary {
  border-color: var(--gray);
  color: var(--gray);
}

.locked-content .btn-secondary:hover {
  background: var(--gray);
  color: white;
  border-color: var(--gray);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--dark-blue);
  color: white;
  padding: 80px 20px 30px;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 0% 100%, rgba(37,99,235,0.1) 0%, transparent 50%),
              radial-gradient(circle at 100% 0%, rgba(124,58,237,0.1) 0%, transparent 50%);
}

.footer-container {
  position: relative;
  z-index: 1;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 60px;
}

@media (max-width: 992px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  font-size: 1.3rem;
  margin-bottom: 25px;
  color: white;
  position: relative;
  padding-bottom: 15px;
}

.footer-col h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.footer-logo img {
  height: 50px;
  margin-bottom: 20px;
}

.footer-logo p {
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  margin-bottom: 25px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 15px;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-links a:hover {
  color: white;
  transform: translateX(5px);
}

.footer-contact .contact-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
}

.footer-contact i {
  color: var(--accent);
  font-size: 1.2rem;
  margin-top: 5px;
}

.footer-contact p {
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
}

.partner-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
  padding: 40px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin: 40px 0;
}

.partner-logo {
  height: 40px;
  opacity: 0.8;
  transition: var(--transition);
}

.partner-logo:hover {
  opacity: 1;
  transform: scale(1.1);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}

.copyright {
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
}

.copyright a {
  color: var(--accent);
  text-decoration: none;
}

.copyright a:hover {
  text-decoration: underline;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-link {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: var(--transition);
}

.social-link:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

/* ===== SCROLL TO TOP ===== */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 999;
  box-shadow: var(--shadow-lg);
}

.scroll-top.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  transform: translateY(-5px);
}

/* ===== RESPONSIVE HEADER ===== */
@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: white;
    flex-direction: column;
    align-items: center;
    padding: 50px 20px;
    transition: left 0.4s ease;
    box-shadow: var(--shadow-lg);
  }

  .nav.active {
    left: 0;
  }

  .nav-links {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .nav-link {
    font-size: 1.2rem;
  }

  .header-actions {
    flex-direction: column;
    width: 100%;
    gap: 15px;
  }

  .mobile-toggle {
    display: block;
  }

  .user-btn {
    min-width: auto;
    padding: 8px 15px;
  }

  .user-name {
    display: none;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
  }

  .profile-container {
    padding: 100px 15px 60px;
  }

  .locked-content {
    padding: 40px 25px;
  }
}

/* ===== SERTIFIKAT BUTTON ===== */
.btn-sertifikat {
  background: var(--gradient-primary);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: white;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  position: relative;
}

.btn-sertifikat:hover:not(:disabled) {
  transform: scale(1.15);
  box-shadow: var(--shadow-md);
}

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

.btn-sertifikat:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Tooltip untuk sertifikat */
.btn-sertifikat[title]:hover::after {
  content: attr(title);
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  white-space: nowrap;
  z-index: 10;
}

/* Responsive untuk tabel */
@media (max-width: 768px) {
  .rekap-table {
    font-size: 0.75rem;
  }
  
  .rekap-table th,
  .rekap-table td {
    padding: 6px 8px;
  }
  
  .btn-sertifikat {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }
}

/* Styling untuk header tabel */
.rekap-table th {
  background: var(--light-gray);
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  color: var(--dark);
  font-size: 0.85rem;
  white-space: nowrap;
}

.rekap-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--light-gray);
  vertical-align: middle;
}

.rekap-table tr:hover {
  background: var(--light);
}

/* Animasi loading untuk sertifikat */
@keyframes fadeInSertifikat {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.btn-sertifikat {
  animation: fadeInSertifikat 0.3s ease;
}
