/* Modern Minimalist EPrints Theme */

:root {
  --primary-color: #16a34a; /* Green 600 */
  --primary-hover: #15803d; /* Green 700 */
  --bg-color: #ffffff; /* Pure White */
  --card-bg: #ffffff;
  --text-main: #334155; /* Slate 700 - Softer than black */
  --text-heading: #0f172a; /* Slate 900 */
  --text-muted: #94a3b8; /* Slate 400 */
  --border-color: #f1f5f9; /* Slate 100 */
  --shadow-soft: 0 20px 40px -10px rgba(0, 0, 0, 0.05); /* Soft ambient shadow */
  --radius-xl: 24px;
  --radius-lg: 16px;
  --font-heading:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-heading);
  -webkit-font-smoothing: antialiased;
}

/* Animations */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.98) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Hero Container */
.hero-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* Hero Section */
.modern-hero {
  text-align: center;
  padding: 80px 40px 60px;
  background: #0f172a;

  /* Framed Layout - Match cards width */
  width: 100%;
  max-width: 100%;
  margin: 0;
  position: relative;

  /* Background */
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.5), rgba(15, 23, 42, 0.7)),
    url("/images/perpustakaan.png");
  background-size: cover;
  background-position: center center;
  
  /* Frame Styling */
  border-radius: 24px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 0 0 1px rgba(34, 197, 94, 0.3),
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    inset 0 0 60px rgba(0, 0, 0, 0.3);
  
  animation: fadeInScale 0.8s ease-out forwards;
  overflow: hidden;
}

/* Frame Corner Accents */
.modern-hero::before,
.modern-hero::after {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  border: 3px solid rgba(34, 197, 94, 0.5);
  pointer-events: none;
}

.modern-hero::before {
  top: 15px;
  left: 15px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 12px;
}

.modern-hero::after {
  bottom: 15px;
  right: 15px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 12px;
}

.modern-hero h1,
.modern-hero .hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  line-height: 1.2;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Add shadow for readability */

  /* Solid White Text for maximum contrast on image */
  color: #ffffff;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;

  /* Visible immediately with subtle fade-in */
  opacity: 1;
  animation: fadeInUp 1s ease-out forwards;
}

.hero-line-1 {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 8px;
}

.hero-line-2 {
  display: block;
  font-size: 3.5rem;
  font-weight: 800;
}

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

/* ... reveal keyframes remain but disabled for typing effect override ... */

/* Typing Cursor Effect */
.typing-cursor::after {
  content: "|";
  display: inline-block;
  color: #22c55e; /* Green Cursor */
  animation: blink-caret 0.75s step-end infinite;
  margin-left: 2px;
}

@keyframes blink-caret {
  from,
  to {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.modern-hero p {
  font-size: 1.25rem;
  color: #f1f5f9; /* Slate 100 (White-ish) */
  max-width: 600px;
  margin: 0 auto 50px;
  font-weight: 500;
  line-height: 1.6;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.advanced-search-link,
.advanced-search-link:visited {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  font-size: 0.9rem;
  color: #ffffff !important; /* Force White */
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Minimalist Modern Style */
  background: transparent;
  padding: 10px 24px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: none;
  box-shadow: none;

  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.advanced-search-link:hover {
  background: #ffffff;
  color: #000000 !important; /* Black Text on White Button */
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
  border-color: #ffffff;
  text-decoration: none;
}

.advanced-search-link::after {
  content: "→";
  transition: transform 0.3s ease;
}

.advanced-search-link:hover::after {
  transform: translateX(4px);
}

/* Minimalist Search Container */
.modern-search-container {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  padding: 3px; /* Slightly thinner border line */
  border-radius: 53px; /* 50px + 3px */
  overflow: hidden;
  z-index: 1;
  /* Shadow moves here so it isn't clipped */
  box-shadow: 0 15px 40px -10px rgba(22, 163, 74, 0.2);
  background: white; /* Fallback */
}

/* Rotating Green Light Effect */
.modern-search-container::before {
  content: "";
  position: absolute;
  /* Determine size based on diagonal to ensure coverage during rotation */
  /* Using a very large fixed percentage relative to the element */
  width: 600%;
  height: 600%;
  top: -250%;
  left: -250%;
  z-index: -1;
  background: conic-gradient(
    transparent,
    transparent,
    transparent,
    #22c55e,
    /* Solid Green Trail */ transparent
  );
  /* Improved gradient for better "beam" effect */
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 260deg,
    #4ade80 300deg,
    /* Light Green */ #16a34a 330deg,
    /* Dark Green */ #22c55e 360deg /* Primary Green */
  );
  animation: rotateBorder 4s linear infinite;
}

@keyframes rotateBorder {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.modern-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 8px 8px 8px 24px;
  border-radius: 50px;
  border: none;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  /* Remove shadow from here to avoid clipping */
}

.modern-search-form:focus-within {
  transform: translateY(-1px);
  /* Enhance the glow on focus */
}

.modern-search-input {
  flex: 1;
  border: none;
  padding: 12px 0;
  font-size: 1.2rem;
  outline: none;
  color: var(--text-heading);
  background: transparent;
}

.modern-search-input::placeholder {
  color: #cbd5e1; /* Very light gray placeholder */
}

.modern-search-select {
  border: none;
  background: transparent;
  color: var(--text-heading);
  font-size: 0.9rem;
  padding: 0 10px;
  outline: none;
  cursor: pointer;
  border-right: 1px solid #f1f5f9;
  margin-right: 5px;
  height: 100%;
  font-weight: 500;
}

.modern-search-select option {
  color: #333;
  background: #fff;
}

.modern-search-btn {
  background: var(--text-heading); /* Black button for high contrast */
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 0; /* Hide text, show icon if we had one, or just "Search" */
  padding: 0;
}

/* Hack to show a search icon instead of text since we can't change HTML easily right now without xpage edit. 
   Wait, I can just use CSS content trick or keep text. 
   Let's keep the text "Search" but style it as a pill button inside if the HTML allows. 
   The HTML is <button>Search</button>. 
   Let's revert to a pill button shape for the 'Search' text.
*/
.modern-search-btn {
  width: auto;
  height: auto;
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  /* Green Button */
  background: var(--primary-color);
  color: white;
}

.modern-search-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.3);
}

.advanced-search-link {
  display: block;
  margin-top: 20px;
  font-size: 0.95rem;
  color: #475569; /* Dark Grey (Slate 600) */
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.advanced-search-link:hover {
  color: #0f172a; /* Darker on hover */
  text-decoration: underline;
}

/* Global Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-entry {
  opacity: 0;
  animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.delay-1 {
  animation-delay: 0.15s;
}
.delay-2 {
  animation-delay: 0.3s;
}
.delay-3 {
  animation-delay: 0.45s;
}

/* Discovery Grid (Modernized) */
.discovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Interactive Card (Shared Style) - Replaces basic discovery-card for upgraded look */
.interactive-card {
  background: #ffffff;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 2px solid #e2e8f0; /* Default Grey */
  text-align: left;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  height: auto;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.interactive-card:hover {
  transform: translateY(-5px);
  border-color: #22c55e; /* Green Glow on Hover */
  box-shadow: 0 15px 30px -10px rgba(34, 197, 94, 0.15); /* Green Shadow */
}

/* Backwards compatibility for discovery-card if used elsewhere, pointing to same base */
.discovery-card {
  /* Inherits basic properties if needed, but we encourage switching to interactive-card */
}

.discovery-card::after {
  display: none;
} /* Remove gradient overlay */

.card-icon {
  width: 56px;
  height: 56px;
  background: #dcfce7; /* Green 100 */
  color: #16a34a; /* Green 600 */
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.interactive-card:hover .card-icon {
  background: #16a34a;
  color: white;
  transform: rotate(5deg) scale(1.1); /* Playful rotation */
}

.interactive-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-heading);
}

/* ... animations ... */

/* Search Container Radius Fix (Mobile) - Ensuring this persists */
@media (max-width: 768px) {
  .modern-search-container {
    border-radius: 27px;
  }
  .modern-search-form {
    flex-direction: column;
    padding: 20px;
    border-radius: 24px;
    gap: 15px;
  }
  .modern-search-input {
    width: 100%;
    text-align: center;
    padding: 5px 0 10px;
    border-bottom: 1px solid #f1f5f9;
    margin-right: 0;
  }
  .modern-search-btn {
    width: 100%;
    border-radius: 12px;
    height: 48px;
  }
}

/* ... previous styles ... */

/* ... previous styles ... */

/* ... previous styles ... */

/* Site Footer (White Theme Premium) */
.site-footer {
  background: #ffffff;
  color: #334155; /* Slate 700 */
  padding: 80px 20px 40px;
  margin-top: 100px;
  border-top-left-radius: 60px;
  border-top-right-radius: 60px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.05); /* Soft light shadow */
  border-top: 1px solid #f1f5f9;
}

.site-footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 80px;
  position: relative;
  z-index: 2;
  justify-content: center; /* Center the grid columns if they don't fill width */
  text-align: left; /* Keep text left aligned for readability, or center if preferred? usually footer text is left */
}

/* On large screens, maybe we want the columns to be centered relative to the page */
/* On large screens, force perfect symmetry */
@media (min-width: 1024px) {
  .site-footer-grid {
    grid-template-columns: 1fr 1fr; /* Exact 50/50 split */
    gap: 120px; /* Larger gap to push content towards center-sides or allow breathing room? 
                       Actually, standard gap is fine. Let's use a cleaner look. */
    max-width: 1000px; /* Constrain width to keep them readable */
  }
}

.footer-section h3 {
  color: #0f172a; /* Dark Slate Heading */
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.5px;
}

/* Icon Glow Effect */
.footer-section:hover h3 svg {
  filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.4));
  transform: scale(1.1);
}

.footer-section h3 svg {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-section p {
  color: #475569; /* Slate 600 */
  line-height: 1.8;
  margin-bottom: 24px;
  font-size: 1rem;
  max-width: 400px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #22c55e;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 8px 0;
}

.footer-link:hover {
  color: #16a34a; /* Darker green on light bg */
  transform: translateX(8px);
}

/* Updated Pattern for White Background (Clean) */
.footer-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.6;
  /* No Pattern */
  background-image: none;
  pointer-events: none;
  z-index: 1;
}

/* Subtle spotlight for white theme (warm/grey) */
.site-footer::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(34, 197, 94, 0.03) 0%,
    transparent 40%
  );
  animation: rotateSpotlight 20s linear infinite;
  pointer-events: none;
  z-index: 1;
}

/* Footer Bottom (OAI) */
.footer-bottom-bar {
  max-width: 1200px;
  margin: 80px auto 0;
  padding-top: 30px;
  border-top: 1px solid #e2e8f0; /* Light Grey Line */
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.footer-bottom-bar a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
  border-bottom: 1px dotted #94a3b8;
}

.footer-bottom-bar a:hover {
  color: #22c55e;
  border-bottom-color: #22c55e;
}

/* ... keep previous necessary styles ... */

/* Logo Optimization */
.ep_tm_header .logo img {
  max-width: 200px;
  height: auto;
  object-fit: contain;
}

/* Mobile Responsiveness */
/* Mobile Responsiveness (Refined) */
@media (max-width: 768px) {
  /* Header & Logo */
  .ep_tm_header .logo img {
    max-width: 140px;
  }

  /* Hero Section */
  .modern-hero {
    padding: 60px 20px 40px;
  }

  .modern-hero h1 {
    font-size: 2.2rem;
    margin-bottom: 16px;
  }

  .modern-hero p {
    font-size: 1rem;
    margin-bottom: 30px;
    padding: 0 10px;
  }

  /* Search Box */
  .modern-search-container {
    border-radius: 27px;
    margin: 0 10px;
  }

  .modern-search-form {
    flex-direction: column;
    padding: 20px;
    border-radius: 24px;
    gap: 15px;
  }

  .modern-search-input {
    width: 100%;
    text-align: center;
    padding: 5px 0 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 1.1rem;
  }

  .modern-search-btn {
    width: 100%;
    border-radius: 12px;
    height: 48px;
    font-size: 1rem;
  }

  /* Discovery Grid */
  .discovery-grid {
    gap: 16px;
    margin: 30px auto;
    padding: 0 16px;
    grid-template-columns: 1fr; /* Force single column on mobile */
  }

  .interactive-card {
    padding: 20px;
  }

  /* Charts */
  .chart-container {
    height: 250px !important; /* Force appropriate height on mobile */
  }

  /* Footer */
  .site-footer {
    padding: 60px 20px 40px;
    margin-top: 60px;
    border-top-left-radius: 30px; /* Smaller radius for mobile */
    border-top-right-radius: 30px;
  }

  .site-footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center; /* Center footer text on mobile */
  }

  .footer-section h3 {
    justify-content: center; /* Center headings */
    font-size: 1.25rem;
  }

  .footer-section p {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-link {
    justify-content: center;
  }

  .footer-bottom-bar {
    flex-direction: column;
    gap: 10px;
    margin-top: 40px;
  }
}

/* Extra Small Screens */
@media (max-width: 480px) {
  .modern-hero h1 {
    font-size: 1.75rem;
  }
}
