/* Header Search */
.header-search {
    display: flex;
    align-items: center;
    margin-right: calc(2 * var(--einheit));
    margin-top: var(--einheit);
}

.header-search form {
    display: flex;
    align-items: center;
    position: relative;
}

.header-search .form-item {
    margin: 0;
}

.header-search input[type="text"] {
    width: 250px;
    padding: 8px 12px;
    border: 2px solid white;
    border-radius: var(--borderradius);
    background: rgba(255, 255, 255, 0.9);
    color: var(--blue);
    font-size: 14px;
    transition: 0.2s;
}

.header-search input[type="text"]:focus {
    outline: none;
    background: white;
    width: 300px;
}

.header-search input[type="text"]::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

/* Visually hide submit button but keep it functional for Enter key */
.header-search input[type="submit"] {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Mobile Search Icon */
.search-icon {
    display: none;
}

.search-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

/* Search results container below header search */
#edit-search {
  margin-top: 30px;
  width:50%;
}

#edit-submit-daemmatlas-site-search {
  position: relative;
  top: -42px;
  left: 54%;
}

/* Search results styling */
.view-daemmatlas-site-search .views-row {
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.view-daemmatlas-site-search .views-row:last-child {
  border-bottom: none;
}

/* Pager styling */
ul.pager__items {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding-left: 0;
}

.pager__item {
  display: inline-block;
}

/* Title link styling */
.view-daemmatlas-site-search .views-field-title a {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
}

.view-daemmatlas-site-search .views-field-title a:hover {
  color: #0066cc;
  text-decoration: underline;
}

/* Excerpt styling */
.view-daemmatlas-site-search .views-field-search-api-excerpt {
  color: #666;
  line-height: 1.6;
}

/* Highlight search terms */
.view-daemmatlas-site-search strong {
  background-color: #ffeb3b;
  font-weight: 600;
  padding: 0 2px;
}

/* Mobile Styles */
@media (max-width: 768px) {
    
    /* Hide desktop search on mobile */
    .header-search {
        display: none;
    }
    
    /* Show search icon on mobile */
    .search-icon {
        display: block;
        position: fixed;
        top: var(--einheit);
        right: calc(50px + var(--einheit));
        background: transparent;
        width: 35px;
        height: 35px;
        z-index: 999;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    
    .search-icon:hover {
        opacity: 0.8;
    }
    
    /* Mobile search overlay (optional - can be enhanced later) */
    body.search-active .header-search {
        display: flex;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--blue);
        padding: var(--einheit);
        z-index: 998;
    }
    
    body.search-active .header-search input[type="text"] {
        width: 100%;
        max-width: none;
    }
}

/* Search result title links */
.views-field-title a {
    margin-top: 20px;
    display: inline-block;
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
}

.views-field-title a:hover {
    text-decoration: underline;
}
