/* ====================================
   K-Campus Indonesia - Base Styles
   Bootstrap 5 + Custom Variables
   ==================================== */

/* ====================================
   CSS Variables (Bootstrap Override)
   ==================================== */
:root {
  /* Refined Color Palette - More sophisticated blues */
  --bs-primary: #3b82f6;
  --bs-primary-rgb: 59, 130, 246;
  --bs-secondary: #0891b2;
  --bs-secondary-rgb: 8, 145, 178;

  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-primary-dark: #2563eb;
  --color-primary-light: rgba(59, 130, 246, 0.08);
  --color-primary-soft: rgba(59, 130, 246, 0.04);
  --color-secondary: #0891b2;
  --color-accent: #06b6d4;

  /* Neutral Grays - More refined */
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-900: #0f172a;

  /* Layout */
  --header-height: 80px;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --border-radius-sm: 8px;

  /* Shadows - More subtle and layered */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================================
   Base Resets for Bootstrap
   ==================================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--color-gray-700);
  line-height: 1.6;
}

/* Override Bootstrap card defaults for more refined look */
.card {
  border: 1px solid var(--color-gray-200) !important;
  border-radius: var(--border-radius) !important;
  transition: all var(--transition-smooth) !important;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg) !important;
}

.card-body {
  padding: 1.5rem !important;
}

.card-header {
  padding: 1.25rem 2rem !important;
}

/* Fix icon alignment in button groups */
.btn-group .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}

.shadow {
  box-shadow: var(--shadow) !important;
}

.shadow-lg {
  box-shadow: var(--shadow-lg) !important;
}

/* Refined button styles */
.btn {
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  transition: all var(--transition-base);
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--color-primary);
  border: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline-primary {
  border-width: 1.5px;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline-primary:hover {
  background: var(--color-primary);
  transform: translateY(-1px);
}

/* Refined text colors */
.text-primary {
  color: var(--color-primary) !important;
}

.text-muted {
  color: var(--color-gray-600) !important;
}

/* Refined section title styles */
h2.text-primary,
h3.text-primary,
h4.text-primary,
h5.text-primary {
  color: var(--color-gray-700) !important;
}

.card-title.text-primary {
  color: var(--color-gray-700) !important;
}

.border-primary.border-3,
.border-bottom.border-primary.border-3 {
  border: none !important;
}

/* ====================================
   Custom Header (Fixed Navigation)
   ==================================== */
.site-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  height: var(--header-height);
  border-bottom: 1px solid var(--color-gray-200);
}

.site-header .container {
  height: 100%;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  padding: 0;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.site-logo:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

.site-logo .logo-img {
  height: 45px;
  width: auto;
  display: block;
}

.logo-icon {
  font-size: 2rem;
}

/* Main Navigation */
.main-nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--bs-body-color);
  font-weight: 500;
  border-radius: 0.375rem;
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Dropdown */
.nav-item.has-dropdown {
  position: relative;
}

.nav-link.dropdown-toggle {
  cursor: pointer;
}

.nav-link.dropdown-toggle::after {
  display: none;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bs-white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-radius: 0.75rem;
  padding: 0.5rem;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0);
  transition: opacity var(--transition-base), visibility var(--transition-base);
  z-index: 1000;
  margin-top: 0;
  list-style: none;
  display: none;
  /* Add padding at top to create hover-friendly area */
  padding-top: 0.75rem;
}

.nav-item.has-dropdown:hover .dropdown-menu,
.nav-item.has-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  display: block;
}

/* Hover-friendly area: extend hover zone slightly above dropdown */
.nav-item.has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px;
  z-index: 999;
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu .nav-link {
  white-space: nowrap;
  cursor: pointer;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 3px;
  background: var(--bs-body-color);
  border-radius: 2px;
  transition: all var(--transition-base);
}

/* ====================================
   Custom Hero Section
   ==================================== */
.hero-gradient {
  background-image: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  padding: 3rem 0 4rem;
  position: relative;
  overflow: hidden;
  margin-top: var(--header-height);
}

/* Hero background images for each page */
.hero-gradient.hero-with-image {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url('https://images.unsplash.com/photo-1541339907198-e08756dedf3f?w=1920&q=80') !important;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding: 4rem 0 5rem !important;
}

.hero-gradient.hero-beasiswa {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url('https://images.unsplash.com/photo-1523240795612-9a054b0db644?w=1920&q=80') !important;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero-gradient.hero-universitas {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url('https://images.unsplash.com/photo-1562774053-701939374585?w=1920&q=80') !important;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero-gradient.hero-panduan {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url('https://images.unsplash.com/photo-1456513080510-7bf3a84b82f8?w=1920&q=80') !important;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero-gradient.hero-testimoni {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=1920&q=80') !important;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero-gradient.hero-berita {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url('https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=1920&q=80') !important;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero-gradient.hero-konsultasi {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url('https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?w=1920&q=80') !important;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero-gradient.hero-university {
  background-size: cover !important;
  background-position: center !important;
  background-attachment: fixed !important;
}

.hero-gradient .container {
  position: relative;
  z-index: 2;
}

.hero-gradient .display-4 {
  font-size: 2.5rem !important;
}

.hero-gradient .display-5 {
  font-size: 2rem !important;
}

.hero-gradient .lead {
  font-size: 1.1rem !important;
}

.hero-gradient .breadcrumb {
  font-size: 0.875rem !important;
  margin-bottom: 1.5rem !important;
}

.hero-gradient .breadcrumb-item + .breadcrumb-item::before {
  font-size: 0.75rem !important;
  color: rgba(255, 255, 255, 0.5) !important;
}

.hero-gradient .breadcrumb a {
  text-decoration: none;
}

.hero-gradient .breadcrumb a:hover {
  text-decoration: underline;
}

/* ====================================
   Page Content Spacing
   ==================================== */
.page-content {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ====================================
   Timeline Component (Custom)
   ==================================== */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
  transform: translateX(-50%);
  border-radius: 2px;
}

.timeline-item {
  display: flex;
  gap: 2rem;
  margin-bottom: 3rem;
  position: relative;
}

.timeline-item:nth-child(odd) {
  flex-direction: row;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
}

.timeline-marker {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
  position: relative;
  z-index: 2;
  border: 4px solid white;
}

.timeline-content {
  flex: 1;
}

/* ====================================
   Custom List Styles
   ==================================== */
.list-check li::before {
  content: '✓';
  margin-right: 0.5rem;
  color: #28a745;
  font-weight: 700;
}

.list-divided li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.list-divided li:last-child {
  border-bottom: none;
}

/* ====================================
   Gradient Cards (CTA sections)
   ==================================== */
.bg-gradient {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%) !important;
  position: relative;
  overflow: hidden;
}

/* Refined card headers with subtle gradient */
.card-header.bg-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%) !important;
  border: none !important;
  position: relative;
  overflow: hidden;
}

.card-header.bg-primary::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.bg-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.bg-gradient h1,
.bg-gradient h2,
.bg-gradient h3,
.bg-gradient h4,
.bg-gradient h5,
.bg-gradient h6,
.bg-gradient p,
.bg-gradient .lead {
  color: white !important;
  position: relative;
  z-index: 1;
}

/* Buttons inside gradient sections should keep their own colors */
.bg-gradient .btn-light {
  color: var(--color-primary) !important;
  background-color: white !important;
  border-color: white !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
}

.bg-gradient .btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.bg-gradient .btn-outline-light {
  color: white !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
  border-width: 1.5px !important;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
}

.bg-gradient .btn-outline-light:hover {
  background-color: white !important;
  color: var(--color-primary) !important;
  border-color: white !important;
  transform: translateY(-2px);
}

/* ====================================
   Footer
   ==================================== */
.site-footer {
  background: var(--bs-dark);
  color: var(--bs-white);
}

.site-footer a:hover {
  color: var(--bs-white) !important;
  transition: color var(--transition-base);
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  font-size: 1.25rem;
  transition: all var(--transition-base);
}

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

/* ====================================
   Mobile Responsive
   ==================================== */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 280px;
    height: calc(100vh - var(--header-height));
    background: var(--bs-white);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    transition: right var(--transition-base);
    overflow-y: auto;
    z-index: 1030;
  }

  .main-nav.active {
    right: 0;
  }

  .nav-menu {
    flex-direction: column;
    padding: 0.5rem 1.5rem 1.5rem 1.5rem;
    gap: 0.25rem;
    min-height: 100%;
  }

  .nav-link {
    width: 100%;
    padding: 1rem;
  }

  .dropdown-menu {
    position: static;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none;
    background: transparent;
    margin: 0;
    padding: 0;
    display: none !important;
  }

  .nav-item.has-dropdown.active .dropdown-menu {
    display: block !important;
  }

  .dropdown-menu .nav-link {
    padding: 0.75rem 1rem 0.75rem 2rem;
    font-size: 0.9rem;
  }

  /* Mobile Timeline */
  .timeline::before {
    left: 40px;
  }

  .timeline-item {
    flex-direction: column !important;
    padding-left: 80px;
  }

  .timeline-marker {
    position: absolute;
    left: 0;
    width: 60px;
    height: 60px;
    font-size: 1rem;
  }
}

/* ====================================
   Alert Component Styles
   ==================================== */
.alert {
  border-radius: var(--border-radius);
}

.alert-info {
  background-color: rgba(13, 110, 253, 0.06) !important;
  border-color: rgba(13, 110, 253, 0.15) !important;
  color: #084298;
}

.alert-success {
  background-color: rgba(25, 135, 84, 0.06) !important;
  border-color: rgba(25, 135, 84, 0.15) !important;
  color: #0f5132;
}

.alert-warning {
  background-color: rgba(255, 193, 7, 0.06) !important;
  border-color: rgba(255, 193, 7, 0.15) !important;
  color: #664d03;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.06) !important;
  border-color: rgba(220, 53, 69, 0.15) !important;
  color: #842029;
}

/* ========================================
   Sophisticated Tab Navigation Styles
   ======================================== */

/* Tab container */
.nav-tabs {
  border-bottom: none !important;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

/* Tab items */
.nav-tabs .nav-item {
  margin-bottom: 0;
}

/* Tab links */
.nav-tabs .nav-link {
  border: none !important;
  border-radius: 8px 8px 0 0;
  padding: 1rem 2rem;
  font-weight: 500;
  color: var(--color-gray-600);
  background: transparent;
  position: relative;
  transition: color 0.2s ease, background-color 0.2s ease;
  margin-bottom: -2px;
}

/* Hover effect */
.nav-tabs .nav-link:hover {
  color: var(--color-primary);
  background: var(--color-gray-100);
}

/* Active tab */
.nav-tabs .nav-link.active {
  color: var(--color-primary);
  background: rgba(0, 102, 204, 0.05);
  font-weight: 600;
  border-bottom: 3px solid var(--color-primary) !important;
}

/* Focus state for accessibility - no outline */
.nav-tabs .nav-link:focus {
  outline: none;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .nav-tabs {
    gap: 0.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .nav-tabs .nav-link {
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }
}
