/* Common Styles for Dinperkim Application */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

/* Media Fallback Styles */
.media-fallback-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px; /* Adjust as needed */
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    color: #6c757d;
    background-color: #f8f9fa;
}

.media-fallback-icon {
    width: 50px; /* Adjust icon size as needed */
    height: 50px;
    margin-bottom: 10px;
    opacity: 0.6;
}

/* Base styles */
body {
  height: 100%;
  font-family: 'Roboto', Arial, sans-serif;
  background: #eef2f9;
  margin: 0;
  padding: 0;
  /* overflow: hidden; */ /* Removing this to allow natural page scrolling */
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100%;
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
}

/* Sidebar styles */
.sidebar {
  width: 120px;
  background: #09305a;
  height: 100vh;
  position: relative;
  z-index: 1000;
  transition: width 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 0;
  border-radius: 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.sidebar .nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 15px 0;
  margin: 5px 0;
  width: 100%;
  text-align: center;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.sidebar .nav-link i {
  font-size: 2rem;
  margin-bottom: 5px;
}

.sidebar .nav-link span {
  font-size: 0.7rem;
  display: block;
  white-space: nowrap;
  font-weight: 500;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.2);
  border-left: 3px solid #ffffff;
}

.sidebar .nav-link.active i,
.sidebar .nav-link:hover i {
  transform: scale(1.1);
}

.sidebar-user {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.sidebar-user i {
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Main content wrapper */
.main-content-wrapper {
  flex: 1;
  margin-left: 0;
  padding: 20px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.main-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px;
}

.main-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 10px 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-title {
  font-size: 1.8rem;
  margin: 0;
  color: #333;
}

.header-logo {
  height: 50px;
  margin-left: 20px;
}

/* JSON Viewer Styles */
.header {
  background: #1976d2;
  color: #fff;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Photo Grid Scrollable */
.photo-grid-scrollable {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px; /* Add some padding for scrollbar */
    white-space: nowrap; /* Ensure items stay in a single line */
}

.photo-grid-scrollable .col-6, .photo-grid-scrollable .col-md-4, .photo-grid-scrollable .col-lg-3 {
    flex-shrink: 0; /* Prevent items from shrinking */
}

@media (min-width: 992px) {
    .photo-grid-scrollable .col-lg-3 {
        width: 25%;
    }
}

.header img {
  height: 44px;
  margin-right: 18px;
  background: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.header-title {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.json-container {
  max-width: 800px;
  margin: 40px auto 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.09);
  padding: 28px 24px 24px 24px;
  font-size: 1.03rem;
  word-break: break-all;
}

.json-title {
  color: #1976d2;
  font-size: 1.18rem;
  font-weight: 700;
}

/* Additional Styles for Index Page */
.sidebar-nav .nav-item a i { 
  font-size: 1.5rem; 
}

.sidebar-user img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
}

.main-content-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #f4f7fc;
  padding: 20px;
  min-height: 0;
  max-width: 100%;
  overflow-x: auto;
}

.main-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: #fff;
  padding: 15px 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.main-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.content-columns {
  display: flex;
  gap: 20px;
  flex-grow: 1;
  overflow: hidden;
  min-height: 0;
  max-width: 100%;
}

.left-column-list {
  flex: 0 0 380px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  padding: 15px;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
  min-height: 0;
}

.search-bar-container {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.feature-list-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

.right-column-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  max-width: 100%;
  overflow-x: auto;
}

.map-card {
  width: 100%;
  min-width: 0;
  min-height: 400px;
  height: auto;
  flex-grow: 3;
  flex-shrink: 0;
  border-radius: 12px 12px 20px 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  max-width: 100%;
  overflow-x: hidden;
}

.app-container {
  display: flex;
  width: 100%;
  max-width: 1400px;
  height: 100%;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  overflow: hidden;
  position: relative;
}

.app-container::before,
.app-container::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 40px;
  background: #3f51b5;
  border-radius: 0 0 40px 40px;
  z-index: -1;
}

.app-container::before { top: -20px; border-radius: 0 0 40px 40px; }
.app-container::after { bottom: -20px; border-radius: 40px 40px 0 0; }

.left-sidebar {
  width: 120px;
  background: linear-gradient(180deg, #3f51b5 0%, #303f9f 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.sidebar-logo { margin-bottom: 30px; }
.sidebar-logo img {
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-nav .nav-item { width: 100%; text-align: center; }
.sidebar-nav .nav-item a {
  color: #fff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 10px 0;
  opacity: 0.7;
  transition: opacity 0.2s, background-color 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav .nav-item a:hover,
.sidebar-nav .nav-item.active a {
  opacity: 1;
  background-color: rgba(255,255,255,0.1);
  border-left-color: #fff;
}

.sidebar-nav .nav-item a i { font-size: 1.5rem; }
.sidebar-user img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
}

.main-content-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #f4f7fc;
  padding: 20px;
  min-height: 0;
  max-width: 100%;
  overflow-x: auto;
}

.main-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: #fff;
  padding: 15px 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.main-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #333;
  margin: 0;
}

/* Responsive styles */
@media (max-width: 992px) {
  .app-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
  }
  .sidebar {
    width: 100%;
    height: auto; /* Allow height to adjust */
    flex-direction: row;
    padding: 5px 10px;
    justify-content: space-around; /* Better for multiple items */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
    position: static; /* Let it be part of the document flow */
    background: #09305a;
  }

  .sidebar-logo { display: none; } /* Hide logo on mobile nav */

  .sidebar-menu {
    flex-direction: row;
    flex-grow: 1; /* Allow menu to take available space */
    justify-content: space-around;
    gap: 10px;
  }

  .sidebar .nav-link {
    padding: 10px 5px;
    flex-grow: 1; /* Allow items to fill space */
    border-left: none; /* Remove side border */
    border-top: 3px solid transparent; /* Use top border for active state */
  }

  .sidebar .nav-link.active,
  .sidebar .nav-link:hover {
    border-left: none;
    border-top-color: #fff;
  }
  
  .main-content-wrapper {
    margin-left: 0;
    margin-top: 0; /* Remove top margin as sidebar is in-flow */
    padding: 15px;
    height: auto; /* Let content define height */
    flex-grow: 1;
  }

  .content-columns {
    flex-direction: column;
    overflow: visible;
  }

  .left-column-list {
    flex: 0 0 auto; /* Don't shrink, don't grow, base on content */
    max-height: 50vh; /* Limit height */
  }

  .right-column-details {
    flex-grow: 1;
  }

  .sidebar-user { display: none; }
}

/* Custom Styles */
.broken-link {
     color: #dc3545 !important; /* Bootstrap danger color */
     text-decoration: line-through;
     font-style: italic;
 }

.broken-photo {
    opacity: 0.6;
    pointer-events: none; /* Disable clicks */
}