/*--------------------------------------------------------------
# Modern UI Enhancements for Rumah Jurnal
# Premium Design with Glassmorphism & Animations
--------------------------------------------------------------*/

/* Modern Color Palette & Design Tokens */
:root {
  /* Primary Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-hero: linear-gradient(
    135deg,
    #667eea 0%,
    #764ba2 50%,
    #f093fb 100%
  );

  /* Stat Card Gradients */
  --gradient-s1: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
  --gradient-s2: linear-gradient(135deg, #c0c0c0 0%, #808080 100%);
  --gradient-s3: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
  --gradient-s4: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-s5: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);

  /* Modern Colors */
  --color-primary: #667eea;
  --color-primary-dark: #5568d3;
  --color-accent: #f093fb;
  --color-text-dark: #1a202c;
  --color-text-light: #718096;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
  --shadow-colored: 0 8px 24px rgba(102, 126, 234, 0.25);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Modern Typography Enhancement */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap");

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Outfit", "Roboto", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/*--------------------------------------------------------------
# Modern Hero Section
--------------------------------------------------------------*/
.hero.section.dark-background {
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.hero.section.dark-background::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      circle at 20% 50%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.hero .info {
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*--------------------------------------------------------------
# Modern Journal Statistics Grid
--------------------------------------------------------------*/
.journal-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 30px 20px;
  text-decoration: none;
  color: white;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  min-height: 200px;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.9;
  z-index: -1;
  transition: opacity var(--transition-base);
}

.stat-card-s1::before {
  background: var(--gradient-s1);
}

.stat-card-s2::before {
  background: var(--gradient-s2);
}

.stat-card-s3::before {
  background: var(--gradient-s3);
}

.stat-card-s4::before {
  background: var(--gradient-s4);
}

.stat-card-s5::before {
  background: var(--gradient-s5);
}

.stat-card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: var(--shadow-xl);
  border-color: rgba(255, 255, 255, 0.6);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  font-size: 48px;
  margin-bottom: 10px;
  animation: float 3s ease-in-out infinite;
}

.stat-content {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-number {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  font-family: "Outfit", sans-serif;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-label {
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.95;
}

.stat-badge {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(5px);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Responsive Stats Grid */
@media (max-width: 768px) {
  .journal-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .stat-card {
    padding: 20px 15px;
    min-height: 160px;
  }

  .stat-icon {
    font-size: 36px;
  }

  .stat-number {
    font-size: 42px;
  }

  .stat-label {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .journal-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Modern Category Buttons with Glassmorphism */
.btn-get-started {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--color-primary);
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-get-started:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  color: var(--color-primary-dark);
  border-color: var(--color-primary);
}

.btn-get-started i {
  transition: transform var(--transition-base);
}

.btn-get-started:hover i {
  transform: translateX(4px);
}

/*--------------------------------------------------------------
# Modern Journal Cards
--------------------------------------------------------------*/
.recent-blog-posts {
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.post-item {
  background: var(--glass-bg);
  border-radius: 20px;
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.8);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.post-item:hover {
  transform: translateY(-12px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-primary);
}

/* Image Container with Gradient Overlay */
.post-img {
  position: relative;
  height: 280px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-img::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.2), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.post-item:hover .post-img::after {
  opacity: 1;
}

.post-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--transition-slow);
  padding: 12px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
}

.post-item:hover .post-img img {
  transform: scale(1.05);
}

/* Card Content */
.post-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Important for flexbox */
}

.post-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 16px;
  line-height: 1.4;
  /* Fixed height for title to ensure consistency */
  height: 56px; /* 2 lines * 28px line-height */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-base);
}

.post-item:hover .post-title {
  color: var(--color-primary);
}

/* Meta Information */
.meta {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 13px;
  color: var(--color-text-light);
  /* Fixed height for meta to ensure consistency */
  min-height: 60px;
}

.meta i {
  color: var(--color-primary);
  font-size: 14px;
}

/* Premium Accreditation Badge */
.meta .d-flex.align-items-center:last-child {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 6px 12px;
  border-radius: 20px;
  color: white !important;
  font-weight: 600;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  margin-top: 8px;
  display: inline-flex;
  width: fit-content;
}

.meta .d-flex.align-items-center:last-child i {
  color: white !important;
}

.meta .d-flex.align-items-center:last-child span {
  color: white !important;
}

/* Spacer to push buttons to bottom */
.post-content > .col-xl-12:last-child {
  margin-top: auto;
  padding-top: 16px;
}

/* Modern Action Buttons */
.btn-get-journal {
  background: var(--gradient-primary);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-colored);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin: 4px;
  border: none;
}

.btn-get-journal:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
  color: white;
}

.btn-get-journal i {
  transition: transform var(--transition-base);
}

.btn-get-journal:hover i {
  transform: translateX(4px);
}

.btn-get-journal.show-desc {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
}

.btn-get-journal.show-desc:hover {
  box-shadow: 0 12px 32px rgba(240, 147, 251, 0.4);
}

/*--------------------------------------------------------------
# Modern Navigation
--------------------------------------------------------------*/
.header {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition-base);
}

.scrolled .header {
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header .logo h1 {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/*--------------------------------------------------------------
# Section Title Enhancement
--------------------------------------------------------------*/
.section-title h2 {
  font-size: 42px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.section-title p {
  font-size: 18px;
  color: var(--color-text-light);
  font-weight: 500;
}

/*--------------------------------------------------------------
# Animations & Micro-interactions
--------------------------------------------------------------*/
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Loading Animation */
.loading-shimmer {
  animation: shimmer 2s infinite;
  background: linear-gradient(
    to right,
    #f6f7f8 0%,
    #edeef1 20%,
    #f6f7f8 40%,
    #f6f7f8 100%
  );
  background-size: 1000px 100%;
}

/*--------------------------------------------------------------
# Responsive Enhancements
--------------------------------------------------------------*/
@media (max-width: 768px) {
  .post-img {
    height: 220px;
  }

  .post-title {
    font-size: 18px;
  }

  .btn-get-started {
    padding: 10px 20px;
    font-size: 13px;
    margin: 6px 4px;
  }

  .section-title h2 {
    font-size: 32px;
  }

  .btn-get-journal {
    width: 100%;
    justify-content: center;
    margin: 6px 0;
  }
}

/*--------------------------------------------------------------
# Smooth Scroll
--------------------------------------------------------------*/
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

/*--------------------------------------------------------------
# Utility Classes
--------------------------------------------------------------*/
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.shadow-hover {
  transition: box-shadow var(--transition-base);
}

.shadow-hover:hover {
  box-shadow: var(--shadow-xl);
}
