.search-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    width: 100%;
    text-align: center;
}
.search-page-container,
.search-page-container * {
  font-family: 'Nunito', sans-serif !important;
}

#custom-search-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    max-width: 500px;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1000px;
}

#search-query {
    width: 100%;
    padding: 12px 40px 12px 15px; /* space for clear icon on right */
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    height: 48px; /* Added fixed height */
}

#search-query:focus {
    border-color: #2c1d64;
}

.clear-icon {
    position: absolute;
    right: 10px; /* Position inside the input field */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    color: #999;
    display: none;
    user-select: none;
    background: transparent;
    border: none;
    padding: 0;
    line-height: 1;
}

.clear-icon:hover {
    color: #333;
}

.search-btn {
    text-align: center !important;
    margin-top: 15px;
    background-color: #2c1d64;
    color: #fff;
    border: none;
    /* REMOVED: right: -50px; This was causing the issue */
    padding: 14px 40px;
    padding-right: 50px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
    
   
   
}
.result-count {
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
  font-size: 20px;
}

.search-btn:hover {
    background-color: #3e2b8a;
}

/* Search results section */
#search-results {
    margin-top: 25px;
    max-width: 800px;
    width: 100%;
    text-align: left;
}

.result-item {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.result-item h1,
.result-item h2,
.result-item h4,
.result-item h6,
.result-item h4 a {
    margin: 0 0 8px;
    color: #2c1d64 !important;
    -webkit-text-fill-color: #2c1d64 !important;
    font-size: 22px;
    text-decoration: none !important;
}

.result-item p {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    font-size: 18px;
}

.result-item a.url {
    color:#0073aa !important;
    -webkit-text-fill-color: #0073aa !important;
    font-size: 15px;
    text-decoration: none;
}

.error-message {
    color: #d9534f;
    margin-top: 10px;
    font-size: 24px;
    display: none;
}
/* --------------------------- */
/* RESPONSIVE DESIGN */
/* --------------------------- */

/* Tablets (768px and below) */
@media (max-width: 768px) {
    .search-page-container {
    padding: 30px 15px;
  }

  /* Stack input and button vertically */
  #custom-search-form {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
    .search-btn {
        margin-top: 15px;
        width: 100%;
        padding: 12px 0;
        font-size: 16px;
    }

    .result-item h4 a {
        font-size: 20px;
    }

    .result-item p {
        font-size: 16px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .search-input-wrapper {
    position: relative;
    display: row;
    align-items: center;
    width: 100%;
    max-width: 1000px;
}
    

    .search-page-container {
    padding: 30px 15px;
  }

  /* Stack input and button vertically */
  #custom-search-form {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
    #search-query {
        font-size: 14px;
        padding: 10px 35px 10px 12px;
    }

    .search-btn {
        margin-top: 15px;
        font-size: 15px;
        padding: 12px 0;
        width: 100%;
    }

    .result-item {
        padding: 12px;
    }

    .result-item h4 a {
        font-size: 18px;
    }

    .result-item p {
        font-size: 15px;
    }

    .result-count {
        font-size: 18px;
    }
}