@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700;800&display=swap");

*,
*::before,
*::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transform: translateZ(0); /* Force new stacking context */
}

input {
  font-family: "Poppins", sans-serif;
}

/* Header */
.landing-header {
  background: rgba(255, 255, 255, 0.95);
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  transform: translateZ(0); /* Create new stacking context */
}

.header-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo img {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.header-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: rgb(62, 144, 216);
  margin: 0;
  line-height: 1.2;
}

.header-text p {
  font-size: 0.85rem;
  color: #6c757d;
  margin: 0;
}


.landing-main {
  flex: 1 0 auto;
  width: 100%;
  background: linear-gradient(135deg, #ffffff 0%, #f5f9ff 25%, #e3f2fd 50%, #bbdefb 75%, rgb(62, 144, 216) 100%);
  padding: 2rem;
  display: flex;
  align-items: stretch;
  gap: 2rem;
  max-width: 100%;
  margin: 0 auto;
}

/* Override untuk detail berita page */
.landing-main.detail-berita-page {
  display: block;
}

/* Login Section - Left Side */
.login-section {
  width: 45%;
  padding: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrapper {
  width: 100%;
  max-width: 520px;
  background: rgba(255, 255, 255, 0.9);
  padding: 3rem;
  border-radius: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 2.5rem;
}

.logo img {
  height: 65px;
  width: auto;
  object-fit: contain;
}

.heading {
  text-align: center;
  margin-bottom: 2.5rem;
}

.heading h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: rgb(62, 144, 216);
  margin-bottom: 0.5rem;
}

.heading .subtitle {
  color: rgb(62, 144, 216);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.login-form {
  width: 100%;
}

.input-wrap {
  position: relative;
  height: 50px;
  margin-bottom: 2rem;
}

.input-field {
  position: absolute;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  outline: none;
  border-bottom: 2px solid #dee2e6;
  padding: 0;
  font-size: 1rem;
  color: #333;
  transition: 0.4s;
}

.input-field:focus {
  border-bottom-color: rgb(62, 144, 216);
}

.password-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #adb5bd;
  font-size: 1rem;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.password-toggle:hover {
  color: rgb(62, 144, 216);
}

.password-field {
  padding-right: 40px !important;
}

.input-wrap label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #adb5bd;
  pointer-events: none;
  transition: 0.4s;
}

.input-field.active + label,
.input-field:focus + label,
.input-field:not(:placeholder-shown) + label {
  font-size: 0.8rem;
  top: -5px;
  color: rgb(62, 144, 216);
}

.sign-btn {
  display: inline-block;
  width: 100%;
  height: 50px;
  background-color: rgb(62, 144, 216);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 0.8rem;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sign-btn:hover {
  background-color: rgb(45, 120, 180);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(62, 144, 216, 0.3);
}

.sign-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.text {
  color: #6c757d;
  font-size: 0.85rem;
  text-align: center;
  margin: 0;
}

.text a {
  color: rgb(62, 144, 216);
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s;
}

.text a:hover {
  color: rgb(45, 120, 180);
  text-decoration: underline;
}

/* Content Section - Right Side */
.content-section {
  width: 55%;
  padding: 1.5rem;
  overflow: visible;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-block {
  width: 100%;
}

.section-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(62, 144, 216, 0.3);
}

.section-header h3 {
  color: rgb(62, 144, 216);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.card-item {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: 0.3s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.card-image {
  width: 100%;
  height: 140px;
  overflow: hidden;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s;
}

.card-item:hover .card-image img {
  transform: scale(1.1);
}

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-date {
  color: rgb(62, 144, 216);
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
}

.card-item h4 {
  color: #333;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-item p {
  color: #6c757d;
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.read-more {
  color: rgb(62, 144, 216);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: 0.3s;
  margin-top: auto;
}

.read-more:hover {
  color: rgb(45, 120, 180);
}

.read-more i {
  transition: 0.3s;
}

.read-more:hover i {
  transform: translateX(5px);
}

/* Section Footer */
.section-footer {
  margin-top: 2rem;
  text-align: center;
}

.btn-view-all {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 2rem;
  background-color: rgb(62, 144, 216);
  color: #fff;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: 0.3s;
  box-shadow: 0 4px 10px rgba(62, 144, 216, 0.3);
}

.btn-view-all:hover {
  background-color: rgb(45, 120, 180);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(62, 144, 216, 0.4);
  color: #fff;
}

/* Berita Page */
.berita-page {
  padding: 2rem;
}

.berita-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.berita-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.berita-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: rgb(62, 144, 216);
  margin: 0;
  display: flex;
  align-items: center;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.5rem;
  background-color: transparent;
  color: rgb(62, 144, 216);
  text-decoration: none;
  border: 2px solid rgb(62, 144, 216);
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.3s;
}

.btn-back:hover {
  background-color: rgb(62, 144, 216);
  color: #fff;
}

.berita-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1200px) {
  .berita-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .berita-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Search Box */
.berita-search-wrapper {
  margin-bottom: 2rem;
}

.berita-search {
  position: relative;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.berita-search .search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 2;
  transition: 0.3s;
}

.berita-search .search-input {
  width: 100%;
  padding: 1rem 3rem 1rem 3.5rem;
  font-size: 1rem;
  border: 2px solid #e3f2fd;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  outline: none;
  font-family: "Poppins", sans-serif;
  color: #333;
}

.berita-search .search-input::placeholder {
  color: #adb5bd;
  font-weight: 400;
}

.berita-search .search-input:focus {
  border-color: rgb(62, 144, 216);
  box-shadow: 0 6px 20px rgba(62, 144, 216, 0.2);
  background: #fff;
  transform: translateY(-2px);
}

.berita-search .search-clear-btn.show {
  opacity: 1;
  visibility: visible;
}

.berita-search .search-input:focus ~ .search-icon {
  color: rgb(62, 144, 216);
}

.berita-search .search-clear-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: #e0e0e0;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 2;
}

.berita-search .search-clear-btn:hover {
  background: #f44336;
  color: #fff;
  transform: translateY(-50%) scale(1.1);
}

.search-info {
  margin-top: 1rem;
  padding: 0.75rem 1.25rem;
  background: rgba(62, 144, 216, 0.1);
  border-left: 4px solid rgb(62, 144, 216);
  border-radius: 0.5rem;
  color: rgb(62, 144, 216);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  animation: slideDown 0.3s ease;
}

.search-info i {
  font-size: 1rem;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Load More */
.berita-load-more {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid rgba(62, 144, 216, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.btn-load-more {
  background-color: rgb(62, 144, 216);
  color: #fff;
  border: 2px solid rgb(62, 144, 216);
  padding: 0.75rem 2rem;
  border-radius: 0.8rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 200px;
  justify-content: center;
}

.btn-load-more:hover:not(:disabled) {
  background-color: rgb(45, 120, 180);
  border-color: rgb(45, 120, 180);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(62, 144, 216, 0.3);
}

.btn-load-more:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.load-more-info {
  color: #6c757d;
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 768px) {
  .berita-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .berita-header h2 {
    font-size: 1.5rem;
  }

  .berita-grid {
    grid-template-columns: 1fr;
  }

  .berita-search {
    max-width: 100%;
  }

  .berita-search .search-input {
    padding: 0.875rem 0.875rem 0.875rem 3rem;
    font-size: 0.95rem;
  }

  .berita-search .search-icon {
    left: 1rem;
    font-size: 1rem;
  }

  .search-info {
    max-width: 100%;
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
  }

  .btn-load-more {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    min-width: 150px;
  }
}

/* Detail Berita Page */
.detail-berita-page {
  padding: 2rem;
  position: relative;
  display: block;
}

.detail-berita-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.btn-back-detail {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.5rem;
  background-color: transparent;
  color: rgb(62, 144, 216);
  text-decoration: none;
  border: 2px solid rgb(62, 144, 216);
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.3s;
  margin-bottom: 2rem;
}

.btn-back-detail:hover {
  background-color: rgb(62, 144, 216);
  color: #fff;
}

.detail-berita-layout {
  display: block;
  position: relative;
}

.detail-berita-main {
  width: 100%;
  max-width: calc(100% - 410px);
  min-width: 0;
}

.berita-detail {
  background: #fff;
  border-radius: 1rem;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.berita-detail-image {
  width: 100%;
  max-height: 600px;
  overflow: hidden;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}

.berita-detail-image img {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
  transition: 0.5s;
}

.berita-detail:hover .berita-detail-image img {
  transform: scale(1.05);
}

.berita-detail-header {
  padding: 2rem 2rem 1.5rem;
  margin-bottom: 0;
  border-bottom: 1px solid #f0f0f0;
}

.berita-detail-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.berita-detail-date,
.berita-detail-author {
  color: #6c757d;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.berita-detail-date i,
.berita-detail-author i {
  color: rgb(62, 144, 216);
  margin-right: 0.5rem;
}

.berita-detail-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: #333;
  margin: 0;
  line-height: 1.3;
}

.berita-detail-content {
  padding: 2rem;
  font-size: 1.05rem;
  line-height: 1.9;
  color: #444;
  text-align: justify;
  text-justify: inter-word;
}

/* Sidebar - Fixed position relative to viewport */
.detail-berita-sidebar {
  position: fixed !important;
  width: 380px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 99 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  will-change: auto !important;
}

/* Calculate right position based on container */
@media (min-width: 1401px) {
  .detail-berita-sidebar {
    right: calc((100vw - 1400px) / 2) !important;
    left: auto !important;
  }
}

@media (min-width: 1025px) and (max-width: 1400px) {
  .detail-berita-sidebar {
    right: 2rem !important;
    left: auto !important;
  }
}

.detail-berita-container {
  position: static;
}

.detail-berita-container::after {
  content: '';
  display: block;
  width: 380px;
  flex-shrink: 0;
}

/* Scrollbar styling for sidebar */
.detail-berita-sidebar::-webkit-scrollbar {
  width: 6px;
}

.detail-berita-sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.detail-berita-sidebar::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.detail-berita-sidebar::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.sidebar-widget {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.widget-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 1.5rem 0;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
  display: flex;
  align-items: center;
}

.recent-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recent-post-item {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 1rem;
}

.recent-post-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recent-post-link {
  display: flex;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  transition: 0.3s;
}

.recent-post-link:hover {
  transform: translateX(5px);
}

.recent-post-image {
  width: 100px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 0.5rem;
  overflow: hidden;
}

.recent-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.3s;
}

.recent-post-link:hover .recent-post-image img {
  transform: scale(1.1);
}

.recent-post-content {
  flex: 1;
  min-width: 0;
}

.recent-post-content h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-post-link:hover .recent-post-content h4 {
  color: rgb(62, 144, 216);
}

.recent-post-date {
  font-size: 0.75rem;
  color: #6c757d;
  display: flex;
  align-items: center;
}

.recent-post-date i {
  color: rgb(62, 144, 216);
  font-size: 0.7rem;
}


@media (max-width: 1024px) {
  .detail-berita-container {
    padding: 0 0.5rem;
  }

  .detail-berita-layout {
    display: block;
  }

  .detail-berita-main {
    max-width: 100%;
    width: 100%;
  }

  .detail-berita-sidebar {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    max-height: none !important;
    overflow-y: visible !important;
  }

  .detail-berita-container::after {
    display: none;
  }
}

@media (max-width: 768px) {
  .detail-berita-page {
    padding: 1.5rem 1rem;
  }

  .berita-detail-image {
    max-height: 300px;
  }

  .berita-detail-image img {
    max-height: 300px;
  }

  .berita-detail-header {
    padding: 1.5rem 1.5rem 1rem;
  }

  .berita-detail-header h1 {
    font-size: 1.75rem;
  }

  .berita-detail-content {
    padding: 1.5rem;
    font-size: 0.95rem;
  }

  .sidebar-widget {
    padding: 1.25rem;
  }
}

/* Footer */
.landing-footer {
  background: #1a1a1a;
  color: #fff;
  padding: 1.5rem 2rem;
  margin-top: auto;
  width: 100%;
  flex-shrink: 0;
}

.footer-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.footer-content p {
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .landing-main {
    flex-direction: column;
    padding: 1.5rem;
  }

  .login-section,
  .content-section {
    width: 100%;
  }

  .login-section {
    padding: 2rem;
  }

  .login-wrapper {
    max-width: 500px;
  }

  .content-section {
    padding: 1.5rem;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .landing-header {
    padding: 1rem;
  }

  .header-logo {
    flex-direction: column;
    text-align: center;
  }


  .landing-main {
    padding: 1rem;
    gap: 1.5rem;
  }

  .login-section {
    padding: 1.5rem 1rem;
  }

  .login-wrapper {
    padding: 2rem 1.5rem;
  }

  .heading h2 {
    font-size: 2rem;
  }

  .content-section {
    padding: 1.5rem 1rem;
  }

  .section-header h3 {
    font-size: 1.25rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card-image {
    height: 180px;
  }

  .card-body {
    padding: 1rem;
  }

  .header-content {
    padding: 0 1rem;
  }

  .landing-main {
    padding: 1.5rem 1rem;
  }

  .landing-footer {
    padding: 1.25rem 1rem;
  }

  .footer-content {
    padding: 0 1rem;
  }

  .footer-content p {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .landing-main {
    padding: 0.5rem;
    gap: 1rem;
  }

  .login-section {
    padding: 1rem 0.5rem;
  }

  .login-wrapper {
    padding: 1.5rem 1rem;
  }

  .logo img {
    width: 80px;
  }

  .heading h2 {
    font-size: 1.75rem;
  }

  .content-section {
    padding: 1rem 0.5rem;
  }

  .content-wrapper {
    gap: 1.5rem;
  }

  .card-item h4 {
    font-size: 0.95rem;
  }
}

