/* ==========================================================================
   DESIGN SYSTEM - PORTAL AKADEMIK UIN SATU TULUNGAGUNG
   ========================================================================== */

/* 1. Imports & Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* 2. CSS Variables (Design Tokens) */
:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  /* Theme Colors - Light Mode */
  --bg-primary: #f5f8f6;
  --bg-secondary: #ffffff;
  --text-primary: #111f19;
  --text-secondary: #4a6055;
  --text-muted: #789083;
  
  --accent-green: #006c40;
  --accent-green-rgb: 0, 108, 64;
  --accent-green-light: rgba(0, 108, 64, 0.08);
  --accent-green-hover: #00502f;
  
  --accent-blue: #1e70e4;
  --accent-blue-rgb: 30, 112, 228;
  --accent-blue-light: rgba(30, 112, 228, 0.12);
  
  /* Layout elements */
  --border-color: rgba(0, 108, 64, 0.08);
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(255, 255, 255, 0.6);
  --shadow-sm: 0 4px 6px -1px rgba(0, 108, 64, 0.03), 0 2px 4px -1px rgba(0, 108, 64, 0.02);
  --shadow-md: 0 10px 25px -5px rgba(0, 108, 64, 0.05), 0 8px 10px -6px rgba(0, 108, 64, 0.05);
  --shadow-lg: 0 20px 50px -12px rgba(0, 108, 64, 0.08);
  
  --nav-bg: rgba(255, 255, 255, 0.8);
  --glass-blur: blur(16px);
}

[data-theme="dark"] {
  /* Theme Colors - Dark Mode */
  --bg-primary: #08100c;
  --bg-secondary: #0e1b15;
  --text-primary: #f0f7f3;
  --text-secondary: #a3b8ad;
  --text-muted: #6e887b;
  
  --accent-green: #00a863;
  --accent-green-rgb: 0, 168, 99;
  --accent-green-light: rgba(0, 168, 99, 0.12);
  --accent-green-hover: #00cb77;
  
  --accent-blue: #3b82f6;
  --accent-blue-rgb: 59, 130, 246;
  --accent-blue-light: rgba(59, 130, 246, 0.15);
  
  /* Layout elements */
  --border-color: rgba(255, 255, 255, 0.06);
  --card-bg: rgba(14, 27, 21, 0.7);
  --card-border: rgba(255, 255, 255, 0.04);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.6);
  
  --nav-bg: rgba(14, 27, 21, 0.8);
}

/* 3. Base Reset & Animations */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

/* 4. Ambient Background Blobs */
.blob-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.12;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.blob-1 {
  top: -10%;
  right: -5%;
  width: 45vw;
  height: 45vw;
  background-color: rgba(var(--accent-green-rgb), 0.8);
  animation: float-1 25s infinite alternate ease-in-out;
}

.blob-2 {
  bottom: -5%;
  left: -5%;
  width: 40vw;
  height: 40vw;
  background-color: rgba(var(--accent-blue-rgb), 0.7);
  animation: float-2 20s infinite alternate ease-in-out;
}

@keyframes float-1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.1); }
  100% { transform: translate(20px, -20px) scale(0.9); }
}

@keyframes float-2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(0.95); }
  100% { transform: translate(-20px, 30px) scale(1.05); }
}

/* 5. Header & Glassmorphic Navbar */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--nav-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.4s ease, border-bottom 0.4s ease;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Dark Mode Switch Styling */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
}

.theme-switch {
  display: inline-block;
  height: 32px;
  position: relative;
  width: 60px;
}

.theme-switch input {
  display: none;
}

.slider {
  background-color: var(--text-muted);
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.slider:before {
  background-color: #fff;
  bottom: 3px;
  content: "";
  height: 26px;
  left: 3px;
  position: absolute;
  transition: .4s cubic-bezier(0.3, 1.5, 0.7, 1);
  width: 26px;
  border-radius: 50%;
  z-index: 2;
}

input:checked + .slider {
  background-color: var(--accent-green);
}

input:checked + .slider:before {
  transform: translateX(28px);
}

.slider .bi-sun-fill {
  color: #f9bc00;
  font-size: 0.85rem;
  z-index: 1;
}

.slider .bi-moon-stars-fill {
  color: #e8f1ec;
  font-size: 0.85rem;
  z-index: 1;
}

/* 6. Services Grid & Cards */
.services-section {
  padding: 60px 0 80px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.service-card-wrapper {
  transition: all 0.4s ease;
}

.service-card {
  background-color: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 30px 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

/* Accent top-border */
.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-green) 0%, var(--accent-blue) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--accent-green-rgb), 0.25);
}

.service-card:hover::before {
  transform: scaleX(1);
}

/* Card Icon Box */
.card-icon-box {
  width: 60px;
  height: 60px;
  background-color: var(--accent-green-light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.8rem;
  color: var(--accent-green);
  transition: all 0.4s ease;
}

.service-card:hover .card-icon-box {
  background-color: var(--accent-green);
  color: #ffffff;
  transform: rotate(5deg) scale(1.05);
  box-shadow: 0 8px 20px rgba(var(--accent-green-rgb), 0.25);
}

/* Card Content */
.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex-grow: 1;
  line-height: 1.5;
}

.card-action-link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-green);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.card-action-link i {
  transition: transform 0.3s ease;
}

.service-card:hover .card-action-link i {
  transform: translateX(4px);
}

/* 7. Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 46px;
  height: 46px;
  background-color: var(--accent-green);
  color: #ffffff;
  border-radius: 50%;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(var(--accent-green-rgb), 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  z-index: 99;
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--accent-green-hover);
  color: #ffffff;
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(var(--accent-green-rgb), 0.4);
}

/* 8. Responsive Adjustments */
@media (max-width: 991px) {
  .services-section {
    padding-top: 40px;
  }
}

@media (max-width: 575px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .services-section {
    padding-top: 40px;
    padding-bottom: 60px;
  }
  .services-section h1 {
    font-size: 1.85rem !important;
  }
  .service-card {
    padding: 24px 20px;
  }
  .card-title {
    font-size: 1.15rem;
  }
  .brand-title {
    font-size: 1.05rem;
  }
  .brand-subtitle {
    font-size: 0.7rem;
  }
}
